Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/java/org/gvsig/raster/tools/LayerDatatypeSextanteAlgorithm.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/java/org/gvsig/raster/tools/LayerDatatypeSextanteAlgorithm.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/java/org/gvsig/raster/tools/LayerDatatypeSextanteAlgorithm.java	(revision 8183)
@@ -0,0 +1,194 @@
+package org.gvsig.raster.tools;
+
+import java.util.HashMap;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.geoprocess.lib.sextante.AbstractSextanteGeoProcess;
+import org.gvsig.geoprocess.lib.sextante.dataObjects.FLyrRasterIRasterLayer;
+import org.gvsig.raster.algorithm.RasterBaseAlgorithmLibrary;
+import org.gvsig.raster.algorithm.process.DataProcess;
+import org.gvsig.raster.algorithm.process.IProcessActions;
+import org.gvsig.raster.algorithm.process.ProcessException;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+
+import es.unex.sextante.core.AnalysisExtent;
+import es.unex.sextante.core.Sextante;
+import es.unex.sextante.dataObjects.IRasterLayer;
+import es.unex.sextante.exceptions.GeoAlgorithmExecutionException;
+import es.unex.sextante.exceptions.NullParameterAdditionalInfoException;
+import es.unex.sextante.exceptions.NullParameterValueException;
+import es.unex.sextante.exceptions.RepeatedParameterNameException;
+import es.unex.sextante.exceptions.WrongParameterIDException;
+import es.unex.sextante.exceptions.WrongParameterTypeException;
+
+/**
+ * Process to change a layer of data type
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class LayerDatatypeSextanteAlgorithm extends AbstractSextanteGeoProcess implements IProcessActions {
+    public static final String RESULT            = "RESULT";
+    public static final String LAYER             = "RasterStore1";
+	public static final String DATATYPE          = "Datatype";
+	public static final String ADJUST_DEC2INT    = "AdjustDec2Int";
+	public static final String ADJUST_BIG2SMALL  = "AdjustBig2Small";
+
+	public static String[]    DEC2INT_OPTIONS    = new String[]{"Trunk", "Round", "Ceil", "Floor"};
+	public static String[]    BIG2SMALL_OPTIONS  = new String[]{"Trunk", "Maxvalue", "NoData"};
+	public static String[]    DATATYPES          = new String[]{"Byte", "UShort", "Short", "Integer", "Float", "Double"};
+
+    private DataProcess        task            = null;
+
+
+    public void defineCharacteristics() {
+        setName(getTranslation("layer_datatype"));
+        setGroup(getTranslation("raster_layer"));
+
+        try {
+            m_Parameters.addInputRasterLayer(LAYER, getTranslation("Input_layer"), true);
+            m_Parameters.addSelection(DATATYPE, getTranslation("dst_datatype"), DATATYPES);
+            m_Parameters.addSelection(ADJUST_DEC2INT, getTranslation("dec_2_int"), DEC2INT_OPTIONS);
+            m_Parameters.addSelection(ADJUST_BIG2SMALL, getTranslation("big_2_small"), BIG2SMALL_OPTIONS);
+        } catch (RepeatedParameterNameException e) {
+            Sextante.addErrorToLog(e);
+        }
+        addOutputRasterLayer(RESULT, getTranslation("principalcomponents"));
+    }
+
+    public boolean processAlgorithm() throws GeoAlgorithmExecutionException {
+
+    	if(existsOutPutFile(LayerDatatypeSextanteAlgorithm.RESULT, 0)) {
+    		throw new GeoAlgorithmExecutionException(getTranslation("file_exists"));
+    	}
+
+    	IRasterLayer input = m_Parameters.getParameterValueAsRasterLayer(LAYER);
+
+    	FLyrRaster lyrRaster = ((FLyrRaster)input.getBaseDataObject());
+    	IRasterLayer output = null;
+
+    	output = getNewRORasterLayer(
+    			RESULT,
+    			Sextante.getText("layerdatatype_description"),
+    			input.getDataType(),
+    			input.getBandsCount());
+
+    	String fileName = ((FLyrRasterIRasterLayer)output).getName();
+
+    	try {
+    		setProgressText(getTranslation("convert_datatype"));
+			task = createLayerDatatypeProcess(lyrRaster.getDataStore(), fileName);
+			task.execute();
+			HashMap<String, Object> params = task.getResult();
+			fileName = (String)params.get("FileName");
+
+			((FLyrRasterIRasterLayer)output).setBaseDataObject(fileName);
+		} catch (ProcessInterruptedException e) {
+			Sextante.addErrorToLog(e);
+		} catch (ProcessException e) {
+			Sextante.addErrorToLog(e);
+		}
+
+		if(getTaskMonitor().isCanceled())
+			return false;
+
+        return true;
+    }
+
+    /**
+     * Creates a process to calculate statistics
+     * @param inputStore
+     * @return
+     * @throws ProcessException
+     * @throws NullParameterAdditionalInfoException
+     * @throws NullParameterValueException
+     * @throws WrongParameterIDException
+     * @throws WrongParameterTypeException
+     */
+    private DataProcess createLayerDatatypeProcess(RasterDataStore inputStore, String fileName) throws ProcessException, WrongParameterTypeException, WrongParameterIDException, NullParameterValueException, NullParameterAdditionalInfoException {
+    	DataProcess taskStats = RasterBaseAlgorithmLibrary.getManager().createRasterTask("LayerDatatypeProcess");
+    	taskStats.setActions(this);
+    	List<String> params = taskStats.getRasterTaskInputParameters("LayerDatatypeProcess");
+    	for (int i = 0; i < params.size(); i++) {
+    		String paramName = params.get(i);
+    		Class<?> paramType = taskStats.getParameterTypeByProcess("LayerDatatypeProcess", paramName);
+    		if(paramType == RasterDataStore.class) {
+    			taskStats.addParam(paramName, (RasterDataStore)inputStore);
+    		}
+
+    		if(paramName.equals("Path")) {
+    			taskStats.addParam(paramName, fileName);
+    		}
+
+    		if(paramName.equals(DATATYPE)) {
+    			String value = m_Parameters.getParameterValueAsString(DATATYPE);
+    			int position = 0;
+    			for (int j = 0; j < DATATYPES.length; j++) {
+					if(DATATYPES[j].equals(value))
+						position = j;
+				}
+    			taskStats.addParam(paramName, position);
+    		}
+
+    		if(paramName.equals(ADJUST_DEC2INT)) {
+    			String value = m_Parameters.getParameterValueAsString(ADJUST_DEC2INT);
+    			int position = 0;
+    			for (int j = 0; j < DEC2INT_OPTIONS.length; j++) {
+					if(DEC2INT_OPTIONS[j].equals(value))
+						position = j;
+				}
+    			taskStats.addParam(paramName, position);
+    		}
+
+    		if(paramName.equals(ADJUST_BIG2SMALL)) {
+    			String value = m_Parameters.getParameterValueAsString(ADJUST_BIG2SMALL);
+    			int position = 0;
+    			for (int j = 0; j < BIG2SMALL_OPTIONS.length; j++) {
+					if(BIG2SMALL_OPTIONS[j].equals(value))
+						position = j;
+				}
+    			taskStats.addParam(paramName, position);
+    		}
+
+    		if(paramName.equals("WINDOW")) {
+    			AnalysisExtent ext = getAnalysisExtent();
+    			Extent bbox = RasterLocator.getManager().getDataStructFactory().createExtent(
+    					ext.getXMin(), ext.getYMax(), ext.getXMax(), ext.getYMin());
+    			Extent inputBbox = inputStore.getExtent();
+    			if(bbox.getULX() != inputBbox.getULX() ||
+    				bbox.getULY() != inputBbox.getULY() ||
+    				bbox.getLRX() != inputBbox.getLRX() ||
+    				bbox.getLRY() != inputBbox.getLRY()) {
+    				taskStats.addParam(paramName, bbox);
+    			}
+    		}
+    	}
+    	return taskStats;
+    }
+
+	public void interrupted() {
+
+	}
+
+	public void end(Object param) {
+
+	}
+
+	public void updateProgress(int current, int total) {
+		boolean cancelled = setProgress(current, total);
+
+		if(!cancelled) {
+			if(task != null)
+				task.actionCanceled(null);
+		}
+	}
+
+    /*
+     * TODO: Customized panels
+    @Override
+    public Class<? extends GeoAlgorithmParametersPanel> getCustomParametersPanelClass() {
+        return PrincipalComponentsParametersPanel.class;
+    }*/
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/java/org/gvsig/raster/tools/LayerDatatypeSextanteAlgorithm.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/java/org/gvsig/raster/tools/RasterToolsSextanteLibrary.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/java/org/gvsig/raster/tools/RasterToolsSextanteLibrary.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/java/org/gvsig/raster/tools/RasterToolsSextanteLibrary.java	(revision 8183)
@@ -0,0 +1,26 @@
+package org.gvsig.raster.tools;
+
+import org.gvsig.geoprocess.algorithm.base.core.AlgorithmAbstractLibrary;
+import org.gvsig.i18n.Messages;
+import org.gvsig.tools.library.LibraryException;
+
+/**
+ * Initialization of <code>RasterToolsSextanteLibrary</code> library.
+ */
+public class RasterToolsSextanteLibrary extends AlgorithmAbstractLibrary {
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+        // Nothing to do
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        Messages.addResourceFamily(
+            "org.gvsig.raster.tools.sextante.i18n.text", RasterToolsSextanteLibrary.class
+                .getClassLoader(), RasterToolsSextanteLibrary.class.getClass().getName());
+        
+        registerGeoProcess(new LayerDatatypeSextanteAlgorithm());
+    }
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/java/org/gvsig/raster/tools/RasterToolsSextanteLibrary.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/java/org/gvsig/raster/tools
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/java/org/gvsig/raster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/java/org/gvsig
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/java/org
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/java
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources-plugin
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org/gvsig/raster/tools/sextante/i18n/text_cs.properties
===================================================================

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org/gvsig/raster/tools/sextante/i18n/text_fr.properties
===================================================================

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org/gvsig/raster/tools/sextante/i18n/text_de.properties
===================================================================

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org/gvsig/raster/tools/sextante/i18n/text_eu.properties
===================================================================

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org/gvsig/raster/tools/sextante/i18n/text_it.properties
===================================================================

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org/gvsig/raster/tools/sextante/i18n/text.properties
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org/gvsig/raster/tools/sextante/i18n/text.properties	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org/gvsig/raster/tools/sextante/i18n/text.properties	(revision 8183)
@@ -0,0 +1,8 @@
+layer_datatype=Cambiar tipo de dato
+raster_layer=Capas r�ster
+Input_layer=Capa de entrada
+dst_datatype=Tipo de dato de destino
+dec_2_int=De decimal a entero
+big_2_small=De mayor a menor
+file_exists=El fichero existe
+convert_datatype=Convirtiendo el tipo de dato
\ No newline at end of file

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org/gvsig/raster/tools/sextante/i18n/text_zh.properties
===================================================================

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org/gvsig/raster/tools/sextante/i18n/text_en.properties
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org/gvsig/raster/tools/sextante/i18n/text_en.properties	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org/gvsig/raster/tools/sextante/i18n/text_en.properties	(revision 8183)
@@ -0,0 +1,8 @@
+layer_datatype=Change the data type
+raster_layer=Raster layers
+Input_layer=Input layer
+dst_datatype=Data type of the result
+dec_2_int=From decimal to integer
+big_2_small=From greater type to lesser type
+file_exists=The file exists
+convert_datatype=Transforming the data type
\ No newline at end of file

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org/gvsig/raster/tools/sextante/i18n/text_gl.properties
===================================================================

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org/gvsig/raster/tools/sextante/i18n/text_ca.properties
===================================================================

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org/gvsig/raster/tools/sextante/i18n/text_pt.properties
===================================================================

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


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org/gvsig/raster/tools/sextante/i18n
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org/gvsig/raster/tools/sextante
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org/gvsig/raster/tools
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org/gvsig/raster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org/gvsig
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/org
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/help/LayerDatatypeSextanteAlgorithm.xml
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/help/LayerDatatypeSextanteAlgorithm.xml	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/help/LayerDatatypeSextanteAlgorithm.xml	(revision 8183)
@@ -0,0 +1,21 @@
+<?xml version='1.0' encoding='ISO-8859-1' standalone='yes' ?>
+<help>
+	<element name="DESCRIPTION"
+		text=""
+		description="Descripci&#243;n" type="0">
+		<!-- <image description="" file="">
+		</image>-->
+	</element>
+	<element name="ADDITIONAL_INFO" text=""
+		description="Informaci&#243;n adicional" type="0">
+	</element>
+	<element name="EXTENSION_AUTHOR" text=""
+		description="Algoritmo creado por" type="0">
+	</element>
+	<element name="HELP_AUTHOR" text="" description="Ayuda creada por"
+		type="0">
+	</element>
+	<element name="USER_NOTES" text="" description="Notas de usuario"
+		type="0">
+	</element>
+</help>

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/help/LayerDatatypeSextanteAlgorithm.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/help/LayerDatatypeSextanteAlgorithm_en.xml
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/help/LayerDatatypeSextanteAlgorithm_en.xml	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/help/LayerDatatypeSextanteAlgorithm_en.xml	(revision 8183)
@@ -0,0 +1,21 @@
+<?xml version='1.0' encoding='ISO-8859-1' standalone='yes' ?>
+<help>
+	<element name="DESCRIPTION"
+		text=""
+		description="Descripci&#243;n" type="0">
+		<!-- <image description="" file="">
+		</image> -->
+	</element>
+	<element name="ADDITIONAL_INFO" text=""
+		description="Informaci&#243;n adicional" type="0">
+	</element>
+	<element name="EXTENSION_AUTHOR" text=""
+		description="Algoritmo creado por" type="0">
+	</element>
+	<element name="HELP_AUTHOR" text="" description="Ayuda creada por"
+		type="0">
+	</element>
+	<element name="USER_NOTES" text="" description="Notas de usuario"
+		type="0">
+	</element>
+</help>

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/help/LayerDatatypeSextanteAlgorithm_en.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/help
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 8183)
@@ -0,0 +1 @@
+org.gvsig.raster.tools.RasterToolsSextanteLibrary
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/META-INF/services
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources/META-INF
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main/resources
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src/main
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/src
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/pom.xml
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/pom.xml	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm/pom.xml	(revision 8183)
@@ -0,0 +1,75 @@
+<?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.tools.toolbox.algorithm</artifactId>
+	<packaging>jar</packaging>
+	<name>org.gvsig.raster.tools.toolbox.algorithm</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.tools</artifactId>
+		<version>2.2.62</version>
+	</parent>
+	<dependencies>
+		<dependency>
+		    <groupId>org.gvsig</groupId>
+   			<artifactId>org.gvsig.raster.tools.algorithm.layerdatatype</artifactId>
+            <scope>runtime</scope>
+   		</dependency>
+		<dependency>
+		    <groupId>org.gvsig</groupId>
+   			<artifactId>org.gvsig.raster.algorithm</artifactId>
+            <scope>compile</scope>
+   		</dependency>
+		<dependency>
+		    <groupId>org.gvsig</groupId>
+   			<artifactId>org.gvsig.geoprocess.algorithm.base</artifactId>
+            <scope>compile</scope>
+   		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.geoprocess.lib.sextante</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.ui</artifactId>
+			<scope>compile</scope>
+		</dependency>
+	    <dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.i18n</artifactId>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.mapcontext.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.mapcontext.impl</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.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>
+	</dependencies>
+</project>

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


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.toolbox.algorithm
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath
target


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/java/org/gvsig/raster/app/extension/TestNoDataPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/java/org/gvsig/raster/app/extension/TestNoDataPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/java/org/gvsig/raster/app/extension/TestNoDataPanel.java	(revision 8183)
@@ -0,0 +1,24 @@
+package org.gvsig.raster.app.extension;
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.tools.app.basic.tool.properties.panel.NoDataPanel;
+
+public class TestNoDataPanel {
+		private int                          w        = 510;
+		private int                          h        = 300;
+		private JFrame                       frame    = new JFrame();
+		private NoDataPanel               desc     = null;
+
+		public TestNoDataPanel() {
+			desc = new NoDataPanel();
+			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 TestNoDataPanel();
+		}
+	}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/java/org/gvsig/raster/app/extension/TestNoDataPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/java/org/gvsig/raster/app/extension/TestClipPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/java/org/gvsig/raster/app/extension/TestClipPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/java/org/gvsig/raster/app/extension/TestClipPanel.java	(revision 8183)
@@ -0,0 +1,26 @@
+package org.gvsig.raster.app.extension;
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.tools.app.basic.tool.clip.ui.ClippingPanel;
+import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
+
+public class TestClipPanel {
+		private int                          w        = 510;
+		private int                          h        = 300;
+		private JFrame                       frame    = new JFrame();
+		private ClippingPanel               desc     = null;
+
+		public TestClipPanel() {
+			new DefaultLibrariesInitializer().fullInitialize(true);
+			desc = new ClippingPanel(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 TestClipPanel();
+		}
+	}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/java/org/gvsig/raster/app/extension/TestClipPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/java/org/gvsig/raster/app/extension
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/java/org/gvsig/raster/app
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/java/org/gvsig/raster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/java/org/gvsig
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/java/org
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/java
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/resources/README.txt
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/resources/README.txt	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/resources/README.txt	(revision 8183)
@@ -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.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/resources/README.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/resources/log4j.xml
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/resources/log4j.xml	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/resources/log4j.xml	(revision 8183)
@@ -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.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/resources/log4j.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test/resources
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/test
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/assembly/gvsig-plugin-package.xml
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/assembly/gvsig-plugin-package.xml	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/assembly/gvsig-plugin-package.xml	(revision 8183)
@@ -0,0 +1,41 @@
+<assembly>
+  <id>gvsig-plugin-package</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <baseDirectory>${project.artifactId}</baseDirectory>
+  <includeBaseDirectory>true</includeBaseDirectory>
+  <files>
+    <file>
+      <source>target/${project.artifactId}-${project.version}.jar</source>
+      <outputDirectory>lib</outputDirectory>
+    </file>
+    <file>
+      <source>target/package.info</source>
+    </file>
+  </files>
+
+  <fileSets>
+    <fileSet>
+      <directory>src/main/resources-plugin</directory>
+      <outputDirectory>.</outputDirectory>
+    </fileSet>
+  </fileSets>
+
+
+  <dependencySets>
+    <dependencySet>
+      <useProjectArtifact>false</useProjectArtifact>
+	  <useTransitiveDependencies>false</useTransitiveDependencies>
+      <outputDirectory>lib</outputDirectory>
+      <includes> 
+				<include>org.gvsig:org.gvsig.raster.tools.app.basic:jar</include>
+				<include>org.gvsig:org.gvsig.raster.tools.algorithm.layerdatatype:jar</include>
+				<include>org.gvsig:org.gvsig.raster.tools.algorithm.saveraster:jar</include>
+				<include>org.gvsig:org.gvsig.raster.tools.algorithm.swing.api:jar</include>
+				<include>org.gvsig:org.gvsig.raster.tools.algorithm.swing.impl:jar</include>
+				<include>org.gvsig:org.gvsig.raster.tools.toolbox.algorithm:jar</include>
+	  </includes>
+	</dependencySet>
+  </dependencySets>
+</assembly>

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


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/assembly
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/SaveAsToolboxAction.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/SaveAsToolboxAction.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/SaveAsToolboxAction.java	(revision 8183)
@@ -0,0 +1,74 @@
+/**
+ * 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.tools.app.basic.toolbox;
+
+import javax.swing.ImageIcon;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.geoprocess.sextante.gui.core.GUIFactory;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.tools.app.basic.tool.saveas.SaveAsTocMenuEntry;
+
+/**
+ * Input in Sextante framework for SaveAs tool
+ * 
+ * @author <a href="mailto:nachobrodin@gmail.com">Nacho Brodin</a>
+ */
+public class SaveAsToolboxAction extends AbstractToolboxAction {
+	
+	public SaveAsToolboxAction() {
+		ImageIcon ico = IconThemeHelper.getImageIcon("gvsig-icon16x16");
+		GUIFactory.registerExternalTool(Messages.getText("gv_tools"), ico, this);
+	}
+	
+	@Override
+	public void execute() {
+		if(!super.loadLayer())
+			return;
+		SaveAsTocMenuEntry.getSingleton().execute(null, new FLayer[]{lyr}); 
+	}
+
+	@Override
+	public String getName() {
+		return Messages.getText("save_as");
+	}
+
+	public ImageIcon getIcon() {
+		return (ImageIcon)SaveAsTocMenuEntry.getSingleton().getIcon();
+	}
+	
+	public boolean isPluginInstalled() {
+		try {
+			SaveAsTocMenuEntry.getSingleton();
+		} catch(Exception e) {
+			return false;
+		} catch(Error e) {
+			return false;
+		}
+		return true;
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/SaveAsToolboxAction.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/AbstractToolboxAction.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/AbstractToolboxAction.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/AbstractToolboxAction.java	(revision 8183)
@@ -0,0 +1,122 @@
+/**
+ * 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.tools.app.basic.toolbox;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.geoprocess.lib.sextante.dataObjects.FLyrRasterIRasterLayer;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+
+import es.unex.sextante.dataObjects.IRasterLayer;
+import es.unex.sextante.gui.core.SextanteGUI;
+import es.unex.sextante.gui.core.ToolboxAction;
+
+/**
+ * Base class for toolBox actions
+ *
+ * @author <a href="mailto:nachobrodin@gmail.com">Nacho Brodin</a>
+ */
+public abstract class AbstractToolboxAction extends ToolboxAction {
+	protected FLyrRaster             lyr = null;
+
+	@Override
+	public String getGroup() {
+		return Messages.getText("group_tools");
+	}
+
+
+	@Override
+	public boolean isActive() {
+		IWindow[] windows = PluginServices.getMDIManager().getAllWindows();
+		for (int i = 0; i < windows.length; i++) {
+			if(windows[i] instanceof AbstractViewPanel) {
+				FLayers lyrs = ((AbstractViewPanel)windows[i]).getMapControl().getMapContext().getLayers();
+				for (int j = 0; j < lyrs.getLayersCount(); j++) {
+					if(lyrs.getLayer(j) instanceof FLyrRaster)
+						return true;
+				}
+			}
+		}
+		return false;
+	}
+
+	/**
+	 * Returns true if the plugin which gives the functionality is installed
+	 * in gvSIG
+	 * @return
+	 */
+	public abstract boolean isPluginInstalled();
+
+	/**
+	 * Loads the raster layer for the tool
+	 * @return
+	 */
+	public boolean loadLayer() {
+		if(!isPluginInstalled()) {
+			RasterSwingLibrary.messageBoxError(Messages.getText("plugin_not_installed"), null);
+			return false;
+		}
+
+		if(!isActive()) {
+			RasterSwingLibrary.messageBoxError(Messages.getText("layer_not_valid"), null);
+			return false;
+		}
+
+		boolean existsRasterButNotActive = false;
+		lyr = null;
+		IWindow[] windows = PluginServices.getMDIManager().getOrderedWindows();
+		MapContext mapCtx = null;
+		for (int i = 0; i < windows.length; i++) {
+			if(windows[i] instanceof AbstractViewPanel) {
+				mapCtx = ((AbstractViewPanel)windows[i]).getMapControl().getMapContext();
+				break;
+			}
+		}
+
+		IRasterLayer[] layers = SextanteGUI.getInputFactory().getRasterLayers();
+		for (int i = 0; i < layers.length; i++) {
+			FLyrRaster l = (FLyrRaster)((FLyrRasterIRasterLayer)layers[i]).getBaseDataObject();
+			existsRasterButNotActive = true;
+			if(l.isActive() && mapCtx == l.getMapContext()) {
+				existsRasterButNotActive = false;
+				lyr = l;
+				break;
+			}
+		}
+
+		if(existsRasterButNotActive) {
+			RasterSwingLibrary.messageBoxError(Messages.getText("raster_layer_not_active"), null);
+			return false;
+		}
+
+		return true;
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/AbstractToolboxAction.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/SetViewProjectionToolboxAction.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/SetViewProjectionToolboxAction.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/SetViewProjectionToolboxAction.java	(revision 8183)
@@ -0,0 +1,76 @@
+/**
+ * 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.tools.app.basic.toolbox;
+
+import javax.swing.ImageIcon;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.geoprocess.sextante.gui.core.GUIFactory;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.tools.app.basic.tool.setviewprojection.SetViewProjectionTocMenuEntry;
+
+/**
+ * Input in Sextante framework for "SetViewProjection" tool
+ * 
+ * @author <a href="mailto:nachobrodin@gmail.com">Nacho Brodin</a>
+ */
+public class SetViewProjectionToolboxAction extends AbstractToolboxAction {
+	
+	public SetViewProjectionToolboxAction() {
+		ImageIcon ico = IconThemeHelper.getImageIcon("gvsig-icon16x16");
+		GUIFactory.registerExternalTool(Messages.getText("gv_tools"), ico, this);
+	}
+	
+	@Override
+	public void execute() {
+		if(!super.loadLayer())
+			return;
+		
+		SetViewProjectionTocMenuEntry.getSingleton().execute(null, new FLayer[]{lyr}); 
+	}
+
+	@Override
+	public String getName() {
+		return Messages.getText("set_view_projection");
+	}
+	
+	public ImageIcon getIcon() {
+		return (ImageIcon)SetViewProjectionTocMenuEntry.getSingleton().getIcon();
+	}
+	
+	public boolean isPluginInstalled() {
+		try {
+			SetViewProjectionTocMenuEntry.getSingleton();
+		} catch(Exception e) {
+			return false;
+		} catch(Error e) {
+			return false;
+		}
+		return true;
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/SetViewProjectionToolboxAction.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/FilterToolboxAction.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/FilterToolboxAction.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/FilterToolboxAction.java	(revision 8183)
@@ -0,0 +1,75 @@
+/**
+ * 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.tools.app.basic.toolbox;
+
+import javax.swing.ImageIcon;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.geoprocess.sextante.gui.core.GUIFactory;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.tools.app.basic.tool.filter.FilterTocMenuEntry;
+
+/**
+ * Input in Sextante framework for Radiometric enhancement tool
+ * 
+ * @author <a href="mailto:nachobrodin@gmail.com">Nacho Brodin</a>
+ */
+public class FilterToolboxAction extends AbstractToolboxAction {
+	
+	public FilterToolboxAction() {
+		ImageIcon ico = IconThemeHelper.getImageIcon("gvsig-icon16x16");
+		GUIFactory.registerExternalTool(Messages.getText("gv_tools"), ico, this);
+	}
+   
+   @Override
+   public void execute() {
+	   if(!super.loadLayer())
+		   return;
+	   
+	   FilterTocMenuEntry.getSingleton().execute(null, new FLayer[]{lyr}); 
+   }
+
+   @Override
+   public String getName() {
+	   return Messages.getText("filters");
+   }
+
+   public ImageIcon getIcon() {
+	   return (ImageIcon)FilterTocMenuEntry.getSingleton().getIcon();
+   }
+   
+	public boolean isPluginInstalled() {
+		try {
+			FilterTocMenuEntry.getSingleton();
+		} catch(Exception e) {
+			return false;
+		} catch(Error e) {
+			return false;
+		}
+		return true;
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/FilterToolboxAction.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/ClipToolboxAction.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/ClipToolboxAction.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/ClipToolboxAction.java	(revision 8183)
@@ -0,0 +1,76 @@
+/**
+ * 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.tools.app.basic.toolbox;
+
+import javax.swing.ImageIcon;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.geoprocess.sextante.gui.core.GUIFactory;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.tools.app.basic.tool.clip.ClippingTocMenuEntry;
+
+/**
+ * Input in Sextante framework for clip tool
+ * 
+ * @author <a href="mailto:nachobrodin@gmail.com">Nacho Brodin</a>
+ */
+public class ClipToolboxAction extends AbstractToolboxAction {
+	
+	public ClipToolboxAction() {
+		ImageIcon ico = IconThemeHelper.getImageIcon("gvsig-icon16x16");
+		GUIFactory.registerExternalTool(Messages.getText("gv_tools"), ico, this);
+	}
+	
+	@Override
+	public void execute() {
+		if(!super.loadLayer())
+			return;
+		
+		ClippingTocMenuEntry.getSingleton().execute(null, new FLayer[]{lyr}); 
+	}
+
+	@Override
+	public String getName() {
+		return Messages.getText("clip_raster");
+	}
+
+	public ImageIcon getIcon() {
+		return (ImageIcon)ClippingTocMenuEntry.getSingleton().getIcon();
+	}
+	
+	public boolean isPluginInstalled() {
+		try {
+			ClippingTocMenuEntry.getSingleton();
+		} catch(Exception e) {
+			return false;
+		} catch(Error e) {
+			return false;
+		}
+		return true;
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/ClipToolboxAction.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/LayerDatatypeToolboxAction.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/LayerDatatypeToolboxAction.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/LayerDatatypeToolboxAction.java	(revision 8183)
@@ -0,0 +1,75 @@
+/**
+ * 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.tools.app.basic.toolbox;
+
+import javax.swing.ImageIcon;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.geoprocess.sextante.gui.core.GUIFactory;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.tools.app.basic.tool.layerdatatype.LayerDatatypeTocMenuEntry;
+
+/**
+ * Input in Sextante framework for layer datatype tool
+ * 
+ * @author <a href="mailto:nachobrodin@gmail.com">Nacho Brodin</a>
+ */
+public class LayerDatatypeToolboxAction extends AbstractToolboxAction {
+	
+	public LayerDatatypeToolboxAction() {
+		ImageIcon ico = IconThemeHelper.getImageIcon("gvsig-icon16x16");
+		GUIFactory.registerExternalTool(Messages.getText("gv_tools"), ico, this);
+	}
+	
+	@Override
+	public void execute() {
+		if(!super.loadLayer())
+			return;
+		LayerDatatypeTocMenuEntry.getSingleton().execute(null, new FLayer[]{lyr}); 
+	}
+
+	@Override
+	public String getName() {
+		return Messages.getText("layer_datatype");
+	}
+	
+	public ImageIcon getIcon() {
+		return (ImageIcon)LayerDatatypeTocMenuEntry.getSingleton().getIcon();
+	}
+	
+	public boolean isPluginInstalled() {
+		try {
+			LayerDatatypeTocMenuEntry.getSingleton();
+		} catch(Exception e) {
+			return false;
+		} catch(Error e) {
+			return false;
+		}
+		return true;
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/LayerDatatypeToolboxAction.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/RadiometricEnhancementToolboxAction.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/RadiometricEnhancementToolboxAction.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/RadiometricEnhancementToolboxAction.java	(revision 8183)
@@ -0,0 +1,75 @@
+/**
+ * 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.tools.app.basic.toolbox;
+
+import javax.swing.ImageIcon;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.geoprocess.sextante.gui.core.GUIFactory;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.tools.app.basic.tool.enhanced.EnhancedTocMenuEntry;
+
+/**
+ * Input in Sextante framework for Radiometric enhancement tool
+ * 
+ * @author <a href="mailto:nachobrodin@gmail.com">Nacho Brodin</a>
+ */
+public class RadiometricEnhancementToolboxAction extends AbstractToolboxAction {
+	
+	public RadiometricEnhancementToolboxAction() {
+		ImageIcon ico = IconThemeHelper.getImageIcon("gvsig-icon16x16");
+		GUIFactory.registerExternalTool(Messages.getText("gv_tools"), ico, this);
+	}
+   
+   @Override
+   public void execute() {
+	   if(!super.loadLayer())
+		   return;
+
+	   EnhancedTocMenuEntry.getSingleton().execute(null, new FLayer[]{lyr}); 
+   }
+
+
+   @Override
+   public String getName() {
+      return Messages.getText("radiometric_enhancedment");
+   }
+
+   public ImageIcon getIcon() {
+	   return (ImageIcon)EnhancedTocMenuEntry.getSingleton().getIcon();
+   }
+   
+   public boolean isPluginInstalled() {
+		try {
+			EnhancedTocMenuEntry.getSingleton();
+		} catch(Exception e) {
+			return false;
+		} catch(Error e) {
+			return false;
+		}
+		return true;
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/RadiometricEnhancementToolboxAction.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/OverviewsToolboxAction.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/OverviewsToolboxAction.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/OverviewsToolboxAction.java	(revision 8183)
@@ -0,0 +1,76 @@
+/**
+ * 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.tools.app.basic.toolbox;
+
+import javax.swing.ImageIcon;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.geoprocess.sextante.gui.core.GUIFactory;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.tools.app.basic.tool.overview.OverviewsTocMenuEntry;
+
+/**
+ * Input in Sextante framework for overview tool
+ * 
+ * @author <a href="mailto:nachobrodin@gmail.com">Nacho Brodin</a>
+ */
+public class OverviewsToolboxAction extends AbstractToolboxAction {
+	
+	public OverviewsToolboxAction() {
+		ImageIcon ico = IconThemeHelper.getImageIcon("gvsig-icon16x16");
+		GUIFactory.registerExternalTool(Messages.getText("gv_tools"), ico, this);
+	}
+	
+	@Override
+	public void execute() {
+		if(!super.loadLayer())
+			return;
+		
+		OverviewsTocMenuEntry.getSingleton().execute(null, new FLayer[]{lyr}); 
+	}
+
+	@Override
+	public String getName() {
+		return Messages.getText("overviews");
+	}
+
+	public ImageIcon getIcon() {
+		return (ImageIcon)OverviewsTocMenuEntry.getSingleton().getIcon();
+	}
+
+	public boolean isPluginInstalled() {
+		try {
+			OverviewsTocMenuEntry.getSingleton();
+		} catch(Exception e) {
+			return false;
+		} catch(Error e) {
+			return false;
+		}
+		return true;
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/OverviewsToolboxAction.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/ToolboxRasterToolsLoader.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/ToolboxRasterToolsLoader.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/ToolboxRasterToolsLoader.java	(revision 8183)
@@ -0,0 +1,66 @@
+package org.gvsig.raster.tools.app.basic.toolbox;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Loader for this tool in the toolbox dialog
+ * 
+ * @author <a href="mailto:nachobrodin@gmail.com">Nacho Brodin</a>
+ */
+public class ToolboxRasterToolsLoader {
+	private Logger log      = LoggerFactory.getLogger(ToolboxRasterToolsLoader.class); 
+	private String errorMsg = "The basic raster tools are not been added in the toolbox";
+
+	public void registerTool() {
+		try {
+			Class<?> c = Class.forName("org.gvsig.raster.tools.app.basic.toolbox.ClipToolboxAction");
+			Constructor<?> constructor = c.getConstructor();
+			constructor.newInstance();
+			
+			c = Class.forName("org.gvsig.raster.tools.app.basic.toolbox.FilterToolboxAction");
+			constructor = c.getConstructor();
+			constructor.newInstance();
+			
+			c = Class.forName("org.gvsig.raster.tools.app.basic.toolbox.LayerDatatypeToolboxAction");
+			constructor = c.getConstructor();
+			constructor.newInstance();
+			
+			Class.forName("org.gvsig.raster.tools.app.basic.toolbox.OverviewsToolboxAction");
+			constructor = c.getConstructor();
+			constructor.newInstance();
+			
+			c = Class.forName("org.gvsig.raster.tools.app.basic.toolbox.RadiometricEnhancementToolboxAction");
+			constructor = c.getConstructor();
+			constructor.newInstance();
+			
+			c = Class.forName("org.gvsig.raster.tools.app.basic.toolbox.SaveAsToolboxAction");
+			constructor = c.getConstructor();
+			constructor.newInstance();
+			
+			c = Class.forName("org.gvsig.raster.tools.app.basic.toolbox.SetViewProjectionToolboxAction");
+			constructor = c.getConstructor();
+			constructor.newInstance();
+		} catch (ClassNotFoundException e) {
+			log.info(errorMsg, e);
+		} catch (SecurityException e) {
+			log.info(errorMsg, e);
+		} catch (NoSuchMethodException e) {
+			log.info(errorMsg, e);
+		} catch (IllegalArgumentException e) {
+			log.info(errorMsg, e);
+		} catch (InstantiationException e) {
+			log.info(errorMsg, e);
+		} catch (IllegalAccessException e) {
+			log.info(errorMsg, e);
+		} catch (InvocationTargetException e) {
+			log.info(errorMsg, e);
+		} catch (NoClassDefFoundError e) {
+			log.info("Geoprocess are not installed." + errorMsg, e);
+		}
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox/ToolboxRasterToolsLoader.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/toolbox
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/SystemGCExtension.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/SystemGCExtension.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/SystemGCExtension.java	(revision 8183)
@@ -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.tools.app.basic;
+
+import org.gvsig.andami.plugins.Extension;
+
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SystemGCExtension extends Extension {
+
+	public void execute(String actionCommand) {
+		System.gc();
+	}
+
+	public void initialize() {
+
+	}
+
+	public boolean isEnabled() {
+		return true;
+	}
+
+	public boolean isVisible() {
+		return true;
+	}
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/SystemGCExtension.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/MainWindow.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/MainWindow.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/MainWindow.java	(revision 8183)
@@ -0,0 +1,102 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2011-2012 Prodevelop S.L
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.app.basic;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JComponent;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.andami.ui.mdiManager.WindowInfo;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.defaultbuttonspanel.DefaultButtonsPanel;
+
+
+/**
+ * Basic frame for a gvSIG <code>IWindow</code> object. This frame adds buttons 
+ * of Cancel, Accept and others.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class MainWindow extends DefaultButtonsPanel implements IWindow, ActionListener {
+    
+    private static final long  serialVersionUID = -4401123724140025094L;
+    private ActionListener     listener         = null;
+    private WindowInfo         info             = null;
+
+    private Object profile = WindowInfo.EDITOR_PROFILE;
+
+    public MainWindow(JComponent panel, JComponent preview, String title, int w, int h, ActionListener actionListener) {
+    	this.listener = actionListener;
+    	
+    	setLayout(new GridBagLayout());
+		GridBagConstraints gbc = new GridBagConstraints();
+		gbc.fill = GridBagConstraints.BOTH;
+		gbc.weightx = 1;
+		gbc.weighty = 1;
+		add(panel, gbc);
+		
+		if(preview != null) {
+			gbc.anchor = GridBagConstraints.NORTH;
+			gbc.fill = GridBagConstraints.NONE;
+			gbc.weightx = 0;
+			gbc.weighty = 0;
+			gbc.gridx = 1;
+			add(preview, gbc);
+		}
+
+        getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT).addActionListener(this);
+        getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY).addActionListener(this);
+        getButtonsPanel().getButton(ButtonsPanel.BUTTON_CANCEL).addActionListener(this);
+        
+        info = new WindowInfo(WindowInfo.PALETTE | WindowInfo.RESIZABLE);
+        info.setTitle(title);
+        info.setWidth(w);
+        info.setHeight(h);
+    }
+
+    public WindowInfo getWindowInfo() {
+        return info;
+    }
+
+    public Object getWindowProfile() {
+        return profile;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+    	if(e.getSource() == getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT)) {
+    		listener.actionPerformed(e);
+    		PluginServices.getMDIManager().closeWindow(this);
+    	}
+    	
+    	if(e.getSource() == getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY)) {
+    		listener.actionPerformed(e);
+    	}
+    	
+    	if(e.getSource() == getButtonsPanel().getButton(ButtonsPanel.BUTTON_CANCEL)) {
+    		PluginServices.getMDIManager().closeWindow(this);
+    	}
+    }
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/MainWindow.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/RasterExtension.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/RasterExtension.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/RasterExtension.java	(revision 8183)
@@ -0,0 +1,531 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+package org.gvsig.raster.tools.app.basic;
+
+import java.util.ArrayList;
+import java.util.prefs.Preferences;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.plugins.Extension;
+import org.gvsig.andami.plugins.IExtensionQueryByAction;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.ApplicationLocator;
+import org.gvsig.app.ApplicationManager;
+import org.gvsig.app.project.documents.view.ViewDocument;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.raster.algorithm.RasterBaseAlgorithmLibrary;
+import org.gvsig.raster.fmap.FmapRasterLibrary;
+import org.gvsig.raster.fmap.layers.DefaultFLyrRaster;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.mainplugin.config.Configuration;
+import org.gvsig.raster.mainplugin.config.ConfigurationEvent;
+import org.gvsig.raster.mainplugin.config.ConfigurationListener;
+import org.gvsig.raster.tools.app.basic.raster.gui.preference.RasterPreferences;
+import org.gvsig.raster.tools.app.basic.raster.gui.wizard.PrepareDataStoreParametersRaw;
+import org.gvsig.raster.tools.app.basic.raster.gui.wizard.PrepareDataStoreParametersVTR;
+import org.gvsig.raster.tools.app.basic.raster.gui.wizard.PrepareLayerAskWritableDirectory;
+import org.gvsig.raster.tools.app.basic.raster.process.ClippingProcess;
+import org.gvsig.raster.tools.app.basic.tool.analysisview.ViewRasterAnalysisTocMenuEntry;
+import org.gvsig.raster.tools.app.basic.tool.clip.ClippingTocMenuEntry;
+import org.gvsig.raster.tools.app.basic.tool.colortable.ColorTableTocMenuEntry;
+import org.gvsig.raster.tools.app.basic.tool.colortable.ui.library.RasterColorTablesFactory;
+import org.gvsig.raster.tools.app.basic.tool.enhanced.EnhancedTocMenuEntry;
+import org.gvsig.raster.tools.app.basic.tool.filter.FilterTocMenuEntry;
+import org.gvsig.raster.tools.app.basic.tool.geolocation.GeoLocationTocMenuEntry;
+import org.gvsig.raster.tools.app.basic.tool.histogram.HistogramTocMenuEntry;
+import org.gvsig.raster.tools.app.basic.tool.infobypoint.InfoByRasterPointTocMenuEntry;
+import org.gvsig.raster.tools.app.basic.tool.layerdatatype.LayerDatatypeTocMenuEntry;
+import org.gvsig.raster.tools.app.basic.tool.multiresolution.ZoomResolutionLevelTocMenuEntry;
+import org.gvsig.raster.tools.app.basic.tool.overview.OverviewsTocMenuEntry;
+import org.gvsig.raster.tools.app.basic.tool.properties.panel.EnhancedPanel;
+import org.gvsig.raster.tools.app.basic.tool.properties.panel.GeneralPanel;
+import org.gvsig.raster.tools.app.basic.tool.properties.panel.InfoPanel;
+import org.gvsig.raster.tools.app.basic.tool.properties.panel.TransparencyPanel;
+import org.gvsig.raster.tools.app.basic.tool.rasterresolution.ZoomPixelCursorTocMenuEntry;
+import org.gvsig.raster.tools.app.basic.tool.roi.ROIManagerTocMenuEntry;
+import org.gvsig.raster.tools.app.basic.tool.saveas.SaveAsTocMenuEntry;
+import org.gvsig.raster.tools.app.basic.tool.saveviewtoraster.SaveViewToRasterTocMenuEntry;
+import org.gvsig.raster.tools.app.basic.tool.selectrasterlayer.SelectLayerTocMenuEntry;
+import org.gvsig.raster.tools.app.basic.tool.setviewprojection.SetViewProjectionTocMenuEntry;
+import org.gvsig.raster.tools.app.basic.tool.viewexport.SaveViewToImageTocMenuEntry;
+import org.gvsig.raster.tools.app.basic.toolbox.ToolboxRasterToolsLoader;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionBuilder;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+
+
+/**
+ * Extensi�n que adapta a FMap y gvSIG la nueva implementaci�n de raster. Para
+ * el cuadro de Propiedades de visualizaci�n de raster contiene el contenedor
+ * base se registran la entrada del men� del TOC y los paneles en el cuadro.
+ * Para la parte de FMap contiene una nueva capa raster y los drivers
+ * necesarios.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RasterExtension extends Extension implements ConfigurationListener, IExtensionQueryByAction {
+	public static final String         CLIPPING_PROCESS_LABEL   = ClippingProcess.PROCESS_LABEL;
+
+	/**
+	 * Indica si en el panel de preferencias se refresca automaticamente la vista
+	 * para mostrar los cambios
+	 */
+	public static boolean       autoRefreshView = true;
+
+	private ExtensionPoint      genericToolBarMenuExtensionPoint  = null;
+
+	public void execute(String actionCommand) {
+		//Las entradas en GenericToolBarModule est�n registradas con la misma etiqueta que la del actionCommand
+		//De esta forma pueden recuperarse los TocMenuEntry del punto de extensi�n y ejecutar la acci�n a
+		//trav�s de este.
+		ExtensionBuilder ext = getGenericToolBarMenuExtensionPoint().get(actionCommand).getBuilder();
+		if(ext != null && ext instanceof AbstractTocContextMenuAction) {
+			IWindow w = PluginServices.getMDIManager().getActiveWindow();
+			if(w instanceof AbstractViewPanel) {
+				FLayers lyrs = ((AbstractViewPanel)w).getMapControl().getMapContext().getLayers();
+				FLayer[] actives = lyrs.getActives();
+				((AbstractTocContextMenuAction)ext).execute(null, actives);
+			}
+		}
+	}
+
+	public void initialize() {
+		// Asignamos la configuracion global a FlyrRasterSE
+		DefaultFLyrRaster.setConfiguration(Configuration.getSingleton());
+
+		Configuration.addValueChangedListener(this);
+		loadConfigurationValues();
+
+		registerIcons();
+
+		FmapRasterLibrary fmapRaster = new FmapRasterLibrary();
+		fmapRaster.initialize();
+
+		Preferences prefs = Preferences.userRoot().node("gvsig.foldering");
+		prefs.put("DataFolder", System.getProperty("user.home"));
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+
+		// Creaci�n del punto de extensi�n para registrar paneles en el cuadro de propiedades.
+		if (!extensionPoints.has("RasterSEPropertiesDialog")) {
+			ExtensionPoint point = extensionPoints.add("RasterSEPropertiesDialog");
+			point.setDescription("Raster Properties registrable panels (register instances of javax.swing.JPanel)");
+		}
+
+		// A�adimos la configuracion de Raster a gvSIG
+
+		ExtensionPoint point = extensionPoints.get("AplicationPreferences");
+		point.append("RasterPreferences", "", RasterPreferences.class);
+
+		// A�adimos paneles al cuadro de propiedades.
+		point = extensionPoints.get("RasterSEPropertiesDialog");
+		point.append("info", "", InfoPanel.class);
+		point.append("general_panel", "", GeneralPanel.class);
+		point.append("transparencia", "", TransparencyPanel.class);
+		point.append("realce", "", EnhancedPanel.class);
+
+
+		// A�adimos las entradas del men�  del toc de raster
+		point = extensionPoints.get("View_TocActions");
+		//point.append("RasterSEProperties", "Raster Properties", RasterPropertiesTocMenuEntry.getSingleton());
+		point.append("SaveAs", "Save as raster layer", SaveAsTocMenuEntry.getSingleton());
+		point.append("ZoomPixelCursor", "zoom to pixel resolution", ZoomPixelCursorTocMenuEntry.getSingleton());
+		point.append("ROI", "ROIs for a raster layer", ROIManagerTocMenuEntry.getSingleton());
+		point.append("Color table", "Color table for a raster layer", ColorTableTocMenuEntry.getSingleton());
+		point.append("Histogram", "Histogram of a raster layer", HistogramTocMenuEntry.getSingleton());
+		point.append("Overviews", "Build overviews", OverviewsTocMenuEntry.getSingleton());
+
+		ApplicationManager appGvSigMan = ApplicationLocator.getManager();
+
+		appGvSigMan.registerPrepareOpenDataStoreParameters(new PrepareLayerAskWritableDirectory());
+		appGvSigMan.registerPrepareOpenDataStoreParameters(new PrepareDataStoreParametersRaw());
+		appGvSigMan.registerPrepareOpenDataStoreParameters(new PrepareDataStoreParametersVTR());
+
+		appGvSigMan.registerColorTablesFactory(new RasterColorTablesFactory());
+
+		registerMenuElements();
+		registerProcesses();
+	}
+
+	private void registerProcesses() {
+    	RasterBaseAlgorithmLibrary.register(CLIPPING_PROCESS_LABEL, ClippingProcess.class);
+    	ClippingProcess.registerParameters();
+	}
+
+	/**
+	 * Registra los iconos a utilizar en andami.
+	 */
+	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-raster-export", this);
+
+		IconThemeHelper.registerIcon("action", "layer-modify-roi", this);
+		IconThemeHelper.registerIcon("action", "layer-histogram", this);
+		IconThemeHelper.registerIcon("action", "layer-color-table", this);
+		IconThemeHelper.registerIcon("action", "layer-modify-overviews", this);
+		IconThemeHelper.registerIcon("action", "layer-properties-raster", this);
+		IconThemeHelper.registerIcon("action", "layer-filter-raster", this);
+		IconThemeHelper.registerIcon("action", "layer-enhanced", this);
+		IconThemeHelper.registerIcon("action", "view-raster-analysis", this);
+		IconThemeHelper.registerIcon("action", "view-select-raster-layer", this);
+		IconThemeHelper.registerIcon("action", "layer-geolocalization", this);
+		IconThemeHelper.registerIcon("action", "tools-raster-reproject", this);
+		IconThemeHelper.registerIcon("action", "view-export-georeferenced-raster", this);
+		IconThemeHelper.registerIcon("action", "layer-saveas", this);
+		IconThemeHelper.registerIcon("action", "layer-clip-raster", this);
+		IconThemeHelper.registerIcon("action", "layer-zoom-res-level", this);
+		IconThemeHelper.registerIcon("action", "layer-info-by-pixel", this);
+		IconThemeHelper.registerIcon("action", "layer-vectorization", this);
+		IconThemeHelper.registerIcon("action", "view-export-image", this);
+
+		//Cursor
+		IconThemeHelper.registerIcon("cursor", "zoom-pixel-cursor", this);
+		IconThemeHelper.registerIcon("cursor", "hor-arrow-cursor", this);
+		IconThemeHelper.registerIcon("cursor", "ver-arrow-cursor", this);
+		IconThemeHelper.registerIcon("cursor", "inclder-arrow-cursor", this);
+		IconThemeHelper.registerIcon("cursor", "inclizq-arrow-cursor", this);
+		IconThemeHelper.registerIcon("cursor", "shear-y-cursor", this);
+		IconThemeHelper.registerIcon("cursor", "shear-x-cursor", this);
+		IconThemeHelper.registerIcon("cursor", "rotate-cursor", this);
+		IconThemeHelper.registerIcon("cursor", "rot-inf-der-cursor", this);
+		IconThemeHelper.registerIcon("cursor", "rot-inf-izq-cursor", this);
+		IconThemeHelper.registerIcon("cursor", "rot-sup-der-cursor", this);
+		IconThemeHelper.registerIcon("cursor", "rot-sup-izq-cursor", this);
+		IconThemeHelper.registerIcon("cursor", "point-select-cursor", this);
+		IconThemeHelper.registerIcon("cursor", "hand-cursor", this);
+		IconThemeHelper.registerIcon("cursor", "rectangle-select-cursor", this);
+		IconThemeHelper.registerIcon("cursor", "not-valid-cursor", this);
+		IconThemeHelper.registerIcon("cursor", "line-cursor", this);
+		IconThemeHelper.registerIcon("cursor", "polygon-cursor", this);
+		IconThemeHelper.registerIcon("cursor", "point-cursor", this);
+
+		//Other
+		IconThemeHelper.registerIcon(null, "forward-icon", this);
+		IconThemeHelper.registerIcon(null, "backward-icon", this);
+		IconThemeHelper.registerIcon(null, "blank-icon", this);
+		IconThemeHelper.registerIcon(null, "addlayer-icon", this);
+		IconThemeHelper.registerIcon(null, "delall-icon", this);
+		IconThemeHelper.registerIcon(null, "back-icon", this);
+		IconThemeHelper.registerIcon(null, "next-icon", this);
+		IconThemeHelper.registerIcon(null, "undo-icon", this);
+		IconThemeHelper.registerIcon(null, "pixel-increase", this);
+		IconThemeHelper.registerIcon(null, "pref-raster-icon", this);
+		IconThemeHelper.registerIcon(null, "back-icon", this);
+		IconThemeHelper.registerIcon(null, "next-icon", this);
+		IconThemeHelper.registerIcon(null, "undo-icon", this);
+		//IconThemeHelper.registerIcon(null, "save-raster", this);
+		IconThemeHelper.registerIcon(null, "pixel-increase", this);
+		//IconThemeHelper.registerIcon(null, "select-raster", this);
+		IconThemeHelper.registerIcon(null, "pref-raster-icon", this);
+		IconThemeHelper.registerIcon(null, "reset-icon", this);
+		IconThemeHelper.registerIcon(null, "tfwload-icon", this);
+		IconThemeHelper.registerIcon(null, "centerraster-icon", this);
+		IconThemeHelper.registerIcon(null, "increase-icon", this);
+		IconThemeHelper.registerIcon(null, "decrease-icon", this);
+		IconThemeHelper.registerIcon(null, "selectzoomarea-icon", this);
+		IconThemeHelper.registerIcon(null, "prevzoom-icon", this);
+		IconThemeHelper.registerIcon(null, "fullview-icon", this);
+		IconThemeHelper.registerIcon(null, "exporttoascii-icon", this);
+		IconThemeHelper.registerIcon(null, "exporttocsv-icon", this);
+		IconThemeHelper.registerIcon(null, "importfromcsv-icon", this);
+		IconThemeHelper.registerIcon(null, "exit-icon", this);
+		IconThemeHelper.registerIcon(null, "options-icon", this);
+		IconThemeHelper.registerIcon(null, "add-icon", this);
+		IconThemeHelper.registerIcon(null, "centerpoint-icon", this);
+		IconThemeHelper.registerIcon(null, "selectrgb-icon", this);
+		IconThemeHelper.registerIcon(null, "focus-icon", this);
+		IconThemeHelper.registerIcon(null, "point-icon", this);
+		IconThemeHelper.registerIcon(null, "line-icon", this);
+		IconThemeHelper.registerIcon(null, "polygon-icon", this);
+		IconThemeHelper.registerIcon(null, "import-icon", this);
+		IconThemeHelper.registerIcon(null, "round-icon", this);
+		//IconThemeHelper.registerIcon(null, "rois-icon", this);
+		IconThemeHelper.registerIcon(null, "fullextent-icon", this);
+		IconThemeHelper.registerIcon(null, "selecttool-icon", this);
+		IconThemeHelper.registerIcon(null, "forward-icon", this);
+		IconThemeHelper.registerIcon(null, "backward-icon", this);
+		IconThemeHelper.registerIcon(null, "datatype-icon", this);
+		IconThemeHelper.registerIcon(null, "setviewprojection-raster-icon", this);
+		IconThemeHelper.registerIcon(null, "gvsig-icon", this);
+		IconThemeHelper.registerIcon(null, "gvsig-icon16x16", this);
+	}
+
+	public void registerMenuElements() {
+		// Creaci�n del punto de extensi�n para registrar paneles en el cuadro de propiedades.
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get("GenericToolBarGroup");
+		point.setDescription("Punto de extension para los grupos de menus del GenericToolBarPanel");
+
+		point = extensionPoints.get("GenericToolBarMenu");
+		point.setDescription("Punto de extension para los submenus del GenericToolBarPanel");
+		//point.append("RasterProperties", "", RasterPropertiesTocMenuEntry.getSingleton());
+		point.append("SelectLayer", "", SelectLayerTocMenuEntry.getSingleton());
+		point.append("HistogramPanel", "", HistogramTocMenuEntry.getSingleton());
+		point.append("ViewColorTable", "",ColorTableTocMenuEntry.getSingleton());
+		if(RasterLocator.getManager().isOverviewBuilderSupported())
+			point.append("Overviews", "", OverviewsTocMenuEntry.getSingleton());
+		point.append("RoisManager", "", ROIManagerTocMenuEntry.getSingleton());
+		point.append("ViewRasterAnalysis", "", ViewRasterAnalysisTocMenuEntry.getSingleton());
+		point.append("ZoomResolutionLevel", "", ZoomResolutionLevelTocMenuEntry.getSingleton());
+
+		//point.append("SaveRaster", "", SaveViewToRasterTocMenuEntry.getSingleton());
+		point.append("SaveAs", "", SaveAsTocMenuEntry.getSingleton());
+		point.append("ClippingPanel", "", ClippingTocMenuEntry.getSingleton());
+		point.append("SaveViewToRaster", "", SaveViewToRasterTocMenuEntry.getSingleton());
+		point.append("SaveViewToImageRaster", "", SaveViewToImageTocMenuEntry.getSingleton());
+
+		point.append("FilterPanel", "", FilterTocMenuEntry.getSingleton());
+		point.append("EnhancedPanel", "", EnhancedTocMenuEntry.getSingleton());
+		point.append("InfoByPoint", "", InfoByRasterPointTocMenuEntry.getSingleton());
+		point.append("LayerDatatype", "", LayerDatatypeTocMenuEntry.getSingleton());
+
+		point.append("GeoLocation", "", GeoLocationTocMenuEntry.getSingleton());
+		point.append("SetProjection", "", SetViewProjectionTocMenuEntry.getSingleton());
+
+	}
+
+	public boolean isEnabled() {
+		org.gvsig.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager().getActiveWindow();
+		if (f == null)
+			return false;
+		if (f instanceof AbstractViewPanel) {
+			FLayers lyrs = ((AbstractViewPanel)f).getMapControl().getMapContext().getLayers();
+			for (int i = 0; i < lyrs.getLayersCount(); i++)
+				if (lyrs.getLayer(i) instanceof FLyrRaster)
+					return true;
+		}
+		return false;
+	}
+
+	/**
+	 * Mostramos el control si hay alguna capa cargada.
+	 */
+	public boolean isVisible() {
+		org.gvsig.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager().getActiveWindow();
+		if (f == null)
+			return false;
+
+		if (f instanceof AbstractViewPanel) {
+			FLayers lyrs = ((AbstractViewPanel)f).getMapControl().getMapContext().getLayers();
+			if (lyrs.getLayersCount() > 0)
+				return true;
+		}
+
+		return false;
+	}
+
+	/**
+	 * Carga los valores de configuracion iniciales
+	 */
+	private void loadConfigurationValues() {
+		autoRefreshView = Configuration.getValue("general_auto_preview", Boolean.TRUE).booleanValue();
+		RasterLibrary.defaultNumberOfClasses = Configuration.getValue("general_defaultNumberOfClasses", Integer.valueOf(RasterLibrary.defaultNumberOfClasses)).intValue();
+		RasterLibrary.cacheSize = Configuration.getValue("cache_size", Long.valueOf(RasterLibrary.cacheSize)).longValue();
+		RasterLibrary.pageSize = Configuration.getValue("cache_pagesize", Double.valueOf(RasterLibrary.pageSize)).doubleValue();
+		RasterLibrary.pagsPerGroup = Configuration.getValue("cache_pagspergroup", Integer.valueOf(RasterLibrary.pagsPerGroup)).intValue();
+		RasterLibrary.blockHeight = Configuration.getValue("cache_blockheight", Integer.valueOf(RasterLibrary.blockHeight)).intValue();
+		//RasterLibrary.defaultNoDataValue = Configuration.getValue("nodata_value", Double.valueOf(RasterLibrary.defaultNoDataValue)).doubleValue();
+	}
+
+	@SuppressWarnings("deprecation")
+	public void actionConfigurationChanged(ConfigurationEvent e) {
+		if (e.getKey().equals("nodata_transparency_enabled")) {
+			boolean noDataTransparent = ((Boolean) e.getValue()).booleanValue();
+			IWindow[] f = PluginServices.getMDIManager().getAllWindows();
+			if (f == null)
+				return;
+			for (int i = 0; i < f.length; i++)
+				if (f[i] instanceof AbstractViewPanel) {
+					AbstractViewPanel vista = (AbstractViewPanel) f[i];
+					ViewDocument model = vista.getModel();
+					MapContext map = model.getMapContext();
+					FLayers lyrs = map.getLayers();
+
+					ArrayList<FLayer> list = RasterToolsUtil.getRasterLayerList(lyrs, null);
+					for (int j = 0; j < list.size(); j++)
+						if(list.get(j) instanceof FLyrRaster)
+							((RasterDataStore)((FLyrRaster)list.get(j)).getDataStore()).getNoDataValue().setNoDataTransparent(noDataTransparent);
+				}
+
+			return;
+		}
+
+		if (e.getKey().equals("general_auto_preview")) {
+			if(e.getValue() instanceof String)
+				autoRefreshView = new Boolean((String) e.getValue()).booleanValue();
+			if(e.getValue() instanceof Boolean)
+				autoRefreshView = ((Boolean) e.getValue()).booleanValue();
+			return;
+		}
+
+		if (e.getKey().equals("general_defaultNumberOfClasses")) {
+			if(e.getValue() instanceof String)
+				try {
+					RasterLibrary.defaultNumberOfClasses = new Integer(
+							(String) e.getValue()).intValue();
+				} catch (NumberFormatException exc) {
+					//Valor por defecto en el n�mero de clases
+				}
+
+			if(e.getValue() instanceof Integer)
+				RasterLibrary.defaultNumberOfClasses = ((Integer) e.getValue()).intValue();
+			return;
+		}
+
+		if (e.getKey().equals("cache_size")) {
+			if(e.getValue() instanceof String)
+				try {
+					RasterLibrary.cacheSize = new Long((String) e.getValue()).longValue();
+				} catch (NumberFormatException exc) {
+					//Valor por defecto en la cache
+				}
+			if(e.getValue() instanceof Long)
+				RasterLibrary.cacheSize = ((Long) e.getValue()).longValue();
+			return;
+		}
+
+		if (e.getKey().equals("cache_pagesize")) {
+			if(e.getValue() instanceof String)
+				try {
+					RasterLibrary.pageSize = new Double((String) e.getValue())
+							.doubleValue();
+				} catch (NumberFormatException exc) {
+					//Valor por defecto en la cache
+				}
+
+			if(e.getValue() instanceof Double)
+				RasterLibrary.pageSize = ((Double) e.getValue()).doubleValue();
+			return;
+		}
+
+		if (e.getKey().equals("cache_pagspergroup")) {
+			if(e.getValue() instanceof String)
+				try {
+					RasterLibrary.pagsPerGroup = new Integer((String) e
+							.getValue()).intValue();
+				} catch (NumberFormatException exc) {
+					//Valor por defecto en la cache
+				}
+
+			if(e.getValue() instanceof Integer)
+				RasterLibrary.pagsPerGroup = ((Integer) e.getValue()).intValue();
+			return;
+		}
+
+		if (e.getKey().equals("cache_blockheight")) {
+			if(e.getValue() instanceof String)
+				try {
+					RasterLibrary.blockHeight = new Integer((String) e
+							.getValue()).intValue();
+				} catch (NumberFormatException exc) {
+					//Valor por defecto en la cache
+				}
+			if(e.getValue() instanceof Integer)
+				RasterLibrary.blockHeight = ((Integer) e.getValue()).intValue();
+			return;
+		}
+
+		/*if (e.getKey().equals("nodata_value")) {
+			if(e.getValue() instanceof String)
+				try {
+					RasterLibrary.defaultNoDataValue = new Double((String) e
+							.getValue()).doubleValue();
+				} catch (NumberFormatException exc) {
+					//Valor por defecto en valor nodata
+				}
+
+			if(e.getValue() instanceof Double)
+				RasterLibrary.defaultNoDataValue = ((Double) e.getValue()).doubleValue();
+			return;
+		}*/
+
+	}
+
+	public void execute(ITocItem item, FLayer[] selectedItems) {
+		this.execute("SELECTIMAGE");
+	}
+
+	public void postInitialize() {
+		super.postInitialize();
+		new ToolboxRasterToolsLoader().registerTool();
+	}
+
+	public boolean canQueryByAction() {
+		return true;
+	}
+
+	public boolean isEnabled(String action) {
+		//Las entradas en GenericToolBarModule est�n registradas con la misma etiqueta que el actionCommand
+		//De esta forma pueden recuperarse los TocMenuEntry del punto de extensi�n y ejecutar isEnable a
+		//trav�s de este.
+		if(getGenericToolBarMenuExtensionPoint() != null && getGenericToolBarMenuExtensionPoint().get(action) != null) {
+			ExtensionBuilder ext = getGenericToolBarMenuExtensionPoint().get(action).getBuilder();
+			if(ext != null && ext instanceof AbstractTocContextMenuAction) {
+				IWindow w = PluginServices.getMDIManager().getActiveWindow();
+				if(w instanceof AbstractViewPanel) {
+					FLayers lyrs = ((AbstractViewPanel)w).getMapControl().getMapContext().getLayers();
+					FLayer[] actives = lyrs.getActives();
+					return ((AbstractTocContextMenuAction)ext).isEnabled(null, actives);
+				}
+			}
+		}
+		return false;
+	}
+
+	public boolean isVisible(String action) {
+		//Las entradas en GenericToolBarModule est�n registradas con la misma etiqueta que el actionCommand
+		//De esta forma pueden recuperarse los TocMenuEntry del punto de extensi�n y ejecutar isVisible a
+		//trav�s de este.
+		if(getGenericToolBarMenuExtensionPoint() != null && getGenericToolBarMenuExtensionPoint().get(action) != null) {
+			ExtensionBuilder ext = getGenericToolBarMenuExtensionPoint().get(action).getBuilder();
+			if(ext != null && ext instanceof AbstractTocContextMenuAction) {
+				IWindow w = PluginServices.getMDIManager().getActiveWindow();
+				if(w instanceof AbstractViewPanel) {
+					FLayers lyrs = ((AbstractViewPanel)w).getMapControl().getMapContext().getLayers();
+					FLayer[] actives = lyrs.getActives();
+					return ((AbstractTocContextMenuAction)ext).isVisible(null, actives);
+				}
+			}
+		}
+		return false;
+	}
+
+	public ExtensionPoint getGenericToolBarMenuExtensionPoint() {
+		if(genericToolBarMenuExtensionPoint == null) {
+			ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+			genericToolBarMenuExtensionPoint = extensionPoints.get("GenericToolBarMenu");
+		}
+		return genericToolBarMenuExtensionPoint;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/RasterExtension.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/InfoByRasterPointExtension.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/InfoByRasterPointExtension.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/InfoByRasterPointExtension.java	(revision 8183)
@@ -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.tools.app.basic.tool.infobypoint;
+
+import java.awt.Component;
+import java.awt.Cursor;
+import java.util.Observable;
+import java.util.Observer;
+
+import javax.swing.JOptionPane;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.PluginsLocator;
+import org.gvsig.andami.actioninfo.ActionInfoManager;
+import org.gvsig.andami.plugins.Extension;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.project.documents.view.ViewDocument;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.app.project.documents.view.toolListeners.StatusBarListener;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.CompoundBehavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseMovementBehavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.PointBehavior;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.infobypoint.InfoByPointDataModel;
+import org.gvsig.raster.tools.app.basic.tool.infobypoint.viewtool.InfoByPixelPointViewTool;
+import org.gvsig.raster.tools.app.basic.tool.infobypoint.viewtool.PixelInspectorViewTool;
+
+/**
+ * Plugin for the information by point of a raster layer
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class InfoByRasterPointExtension extends Extension {
+	private InfoByPixelPointViewTool     lastTool      = null;
+	public static Behavior               oldBehavior   = null;
+	
+	public void execute(String actionCommand) {
+		if(actionCommand.compareTo("INFO_BY_PIXEL") == 0) {
+			MapControl mapCtrl = getMapControl();
+			String oldTool = mapCtrl.getCurrentTool();
+			StatusBarListener sbl = new StatusBarListener(mapCtrl);
+			
+			IWindow[] wList = PluginServices.getMDIManager().getAllWindows();
+			for (int i = 0; i < wList.length; i++) {
+				if(wList[i] instanceof MainInfoByPointDialog) {
+					JOptionPane.showMessageDialog(
+							(Component)wList[i], 
+							Messages.getText("open_window"), 
+							Messages.getText("Information"), 
+							JOptionPane.INFORMATION_MESSAGE);
+					mapCtrl.addBehavior("infoByRasterPoint", 
+							new Behavior[]{new PointBehavior(lastTool),
+							new MouseMovementBehavior(sbl)});
+					mapCtrl.setTool("infoByRasterPoint");
+					return;
+				}
+			}
+			MainInfoByPointDialog dialog = new MainInfoByPointDialog(mapCtrl, oldTool);
+			InfoByPointDataModel model = dialog.getInfoByPointDataModel();
+			((Observable)model).addObserver((Observer)dialog.getMainPanel());
+			
+			lastTool = new InfoByPixelPointViewTool(mapCtrl, model);
+			mapCtrl.addBehavior("infoByRasterPoint", 
+					new Behavior[]{new PointBehavior(lastTool),
+					new MouseMovementBehavior(sbl)});
+			mapCtrl.setTool("infoByRasterPoint");
+			oldBehavior = CompoundBehavior.getAllControlsBehavior();
+			CompoundBehavior.setAllControlsBehavior(new PixelInspectorViewTool(mapCtrl, model, dialog.getPixelInspector()));
+			
+			model.notifyObservers();
+			PluginServices.getMDIManager().addWindow(dialog);
+		}
+	}
+	
+	private MapControl getMapControl() {
+		IWindow theView = PluginServices.getMDIManager().getActiveWindow();
+		if(!(theView instanceof AbstractViewPanel)) {
+			JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), PluginServices.getText(this.getClass(), "window_not_valid"));
+			return null;
+		}
+		return ((AbstractViewPanel)theView).getMapControl();
+	}
+	
+	@SuppressWarnings("deprecation")
+	public boolean isEnabled() {
+		org.gvsig.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager().getActiveWindow();
+		if (f == null)
+			return false;
+		if (f instanceof AbstractViewPanel) {
+			AbstractViewPanel vista = (AbstractViewPanel) f;
+			ViewDocument model = vista.getModel();
+			MapContext mapa = model.getMapContext();
+			FLayers layers = mapa.getLayers();
+			for (int i = 0; i < layers.getLayersCount(); i++)
+				if (layers.getLayer(i) instanceof FLyrRaster) {
+					FLyrRaster lyr = (FLyrRaster)layers.getLayer(i);
+					if(lyr.isActive())
+						return true;
+				}
+		}
+		return false;
+	}
+	
+	public boolean isVisible() {
+		return isEnabled();
+	}
+
+	public void initialize() {
+	}
+	
+	@Override
+	public void postInitialize() {
+		super.postInitialize();
+		ActionInfoManager manager = PluginsLocator.getActionInfoManager();
+		manager.redirect("layer-info-by-point", "layer-info-by-raster-point");
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/InfoByRasterPointExtension.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/InfoByRasterPointTocMenuEntry.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/InfoByRasterPointTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/InfoByRasterPointTocMenuEntry.java	(revision 8183)
@@ -0,0 +1,117 @@
+/* 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.tools.app.basic.tool.infobypoint;
+
+import javax.swing.Icon;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.plugins.Extension;
+import org.gvsig.app.project.documents.view.ViewDocument;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+
+/**
+ * Entry point to the InfoByRasterPoint tool
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class InfoByRasterPointTocMenuEntry extends AbstractTocContextMenuAction implements IGenericToolBarMenuItem {
+	static private InfoByRasterPointTocMenuEntry singleton  = null;
+	private Extension                            extension  = null;
+	
+	/**
+	 * Nadie puede crear una instancia a esta clase �nica, hay que usar el
+	 * getSingleton()
+	 */
+	private InfoByRasterPointTocMenuEntry() {
+		extension = new InfoByRasterPointExtension();
+		extension.initialize();
+	}
+	
+	/**
+	 * Assigns the extension to be executed
+	 * @param ext
+	 */
+	public void setExtension(Extension ext) {
+		this.extension = ext;
+	}
+
+	/**
+	 * Devuelve un objeto unico a dicha clase
+	 * @return
+	 */
+	static public InfoByRasterPointTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new InfoByRasterPointTocMenuEntry();
+		return singleton;
+	}
+	
+	public String getGroup() {
+		return "RasterLayer";
+	}
+
+	public int getGroupOrder() {
+		return 10;
+	}
+
+	public int getOrder() {
+		return 50;
+	}
+
+	public String getText() {
+		return Messages.getText("infobypoint");
+	}
+
+	@SuppressWarnings("deprecation")
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		org.gvsig.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager().getActiveWindow();
+		if (f == null)
+			return false;
+		if (f instanceof AbstractViewPanel) {
+			AbstractViewPanel vista = (AbstractViewPanel) f;
+			ViewDocument model = vista.getModel();
+			MapContext mapa = model.getMapContext();
+			FLayers layers = mapa.getLayers();
+			for (int i = 0; i < layers.getLayersCount(); i++)
+				if (layers.getLayer(i) instanceof FLyrRaster && layers.getLayer(i).isActive())
+					return true;
+		}
+		return false;
+	}
+
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		return true;
+	}
+
+	public void execute(ITocItem item, FLayer[] selectedItems) {
+		extension.execute("INFO_BY_PIXEL");
+	}
+	
+	public Icon getIcon() {
+		return RasterToolsUtil.getIcon("layer-info-by-pixel");
+	}
+	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/InfoByRasterPointTocMenuEntry.java
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/gui/images
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/gui
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/MainInfoByPointDialog.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/MainInfoByPointDialog.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/MainInfoByPointDialog.java	(revision 8183)
@@ -0,0 +1,122 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.infobypoint;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.HashMap;
+
+import javax.swing.ImageIcon;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.andami.ui.mdiManager.IWindowListener;
+import org.gvsig.andami.ui.mdiManager.WindowInfo;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.CompoundBehavior;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.swing.RasterSwingLocator;
+import org.gvsig.raster.swing.infobypoint.InfoByPointDataModel;
+import org.gvsig.raster.swing.infobypoint.MainInfoByPointPanel;
+import org.gvsig.raster.swing.pixelinspector.PixelInspector;
+
+/**
+ * Dialog for the information by point of a raster layer
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class MainInfoByPointDialog extends JPanel implements IWindow, ActionListener, IWindowListener {
+	private static final long               serialVersionUID   = 1L;
+	private MainInfoByPointPanel            mainPanel          = null;
+	private String                          toolToRestore    = null;
+	private MapControl                      mapCtrl            = null;
+	
+	public MainInfoByPointDialog(MapControl mapControl, String toolToRestore) {
+		setLayout(new BorderLayout());
+		add((Component)getMainPanel(), BorderLayout.CENTER);
+		this.toolToRestore = toolToRestore;
+		this.mapCtrl = mapControl;
+	}
+	
+	public MainInfoByPointPanel getMainPanel() {
+		if(mainPanel == null) { 
+			HashMap<String, String> translations = new HashMap<String, String>();
+			translations.put("info", Messages.getText("info"));
+			translations.put("view", Messages.getText("view"));
+			translations.put("layer_list", Messages.getText("layer_list"));
+			translations.put("band_values", Messages.getText("band_values"));
+			translations.put("pixel_point", Messages.getText("pixel_point"));
+			translations.put("view_point", Messages.getText("view_point"));
+			translations.put("world_point", Messages.getText("world_point"));
+			translations.put("bands", Messages.getText("bands"));
+			translations.put("colors", Messages.getText("colors"));
+			translations.put("coords", Messages.getText("coords"));
+			translations.put("lat", Messages.getText("lat"));
+			translations.put("long", Messages.getText("long"));
+			translations.put("red", Messages.getText("red"));
+			translations.put("green", Messages.getText("green"));
+			translations.put("blue", Messages.getText("blue"));
+			HashMap<String, ImageIcon> icons = new HashMap<String, ImageIcon>();
+			icons.put("forward-icon", IconThemeHelper.getImageIcon("forward-icon"));
+			icons.put("backward-icon", IconThemeHelper.getImageIcon("backward-icon"));
+			mainPanel = RasterSwingLocator.getSwingManager().createInfoByPointPanel(
+					translations, icons, null);
+			mainPanel.addListenerExtendedButton(this);
+		}
+		return mainPanel;
+	}
+
+	public WindowInfo getWindowInfo() {
+		WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODELESSDIALOG);
+		m_viewinfo.setTitle(Messages.getText("InfoByPoint"));
+		m_viewinfo.setHeight(380);
+		m_viewinfo.setWidth(250);
+		return m_viewinfo;
+	}
+	
+	public void windowClosed() {
+		CompoundBehavior.setAllControlsBehavior(InfoByRasterPointExtension.oldBehavior);
+		mapCtrl.setTool(toolToRestore);
+	}
+	
+	public Object getWindowProfile() {
+		return WindowInfo.PROPERTIES_PROFILE;
+	}
+
+	public InfoByPointDataModel getInfoByPointDataModel() {
+		return getMainPanel().getInfoByPointDataModel();
+	}
+	
+	public PixelInspector getPixelInspector() {
+		return getMainPanel().getPixelInspectorPanel();
+	}
+
+	public void actionPerformed(ActionEvent e) {
+	}
+
+	public void windowActivated() {
+		
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/MainInfoByPointDialog.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/viewtool/PixelInspectorViewTool.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/viewtool/PixelInspectorViewTool.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/viewtool/PixelInspectorViewTool.java	(revision 8183)
@@ -0,0 +1,138 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.infobypoint.viewtool;
+
+import java.awt.event.MouseEvent;
+import java.awt.geom.Point2D;
+import java.awt.image.BufferedImage;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.RasterManager;
+import org.gvsig.fmap.dal.coverage.util.ColorConversion;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.BehaviorException;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.infobypoint.InfoByPointDataModel;
+import org.gvsig.raster.swing.pixelinspector.PixelInspector;
+
+
+/**
+ * Behavior to be added to the MapControl. With this behavior will be
+ * possible to manage the mouse event on the view 
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class PixelInspectorViewTool extends Behavior {
+	private RasterManager            rManager            = RasterLocator.getManager();
+	private InfoByPointDataModel     model               = null;
+	private ColorConversion          conv                = null;
+	private ViewPort                 viewPort            = null;
+	private MapControl               mapCtrl             = null;
+	private PixelInspector           observer            = null;
+	
+	/**
+	 * Constructor. Asigna el dialogo
+	 * @param dialog
+	 */
+	public PixelInspectorViewTool(MapControl mapCtrl, InfoByPointDataModel model, PixelInspector observer) {
+		this.mapCtrl = mapCtrl;
+		this.model = model;
+		this.observer = observer;
+		conv = rManager.getColorConversion();
+		viewPort = mapCtrl.getViewPort();
+	}
+	
+	public FLyrRaster getLayer(Point2D p) {
+		FLyrRaster raster = null;
+		for (int i = mapCtrl.getMapContext().getLayers().getLayersCount() - 1; i >= 0; i--) {
+			FLayer lyr = mapCtrl.getMapContext().getLayers().getLayer(i);
+			if(lyr instanceof FLyrRaster) {
+				raster = (FLyrRaster)lyr;
+				if(raster.isInside(p))
+					return raster;
+			}
+		}
+		return null;
+	}
+	
+	public ToolListener getListener() {
+		return null;
+	}
+	
+	@SuppressWarnings("deprecation")
+	public void mouseMoved(MouseEvent e) throws BehaviorException {
+		Point2D point2D = new Point2D.Double(e.getX(), e.getY());
+		BufferedImage image = mapCtrl.getImage();
+		
+		//Actualiza los datos del panel
+		if(e.getX() >= image.getWidth() || e.getY() >= image.getHeight())
+			return;
+		int value = image.getRGB((int) point2D.getX(), (int) point2D.getY());
+		int r = (value >> 16) & 0xff;
+		int g = (value >> 8) & 0xff;
+		int b = value & 0xff;
+		
+		double[] cmyk = conv.RGBtoCMYK(r & 0xff, g & 0xff, b & 0xff, 1D);
+		
+		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);
+		
+		Point2D mapPoint = viewPort.toMapPoint(point2D);
+		
+		model.setARGB(r, g, b);
+		model.setCMYK(cmyk);
+		model.setHSL(hsl[0], hsl[1], hsl[2]);
+		model.setViewPoint(point2D.getX(), point2D.getY());
+		model.setWorldPoint(mapPoint.getX(), mapPoint.getY());
+		
+		//Raster dependent
+		FLyrRaster raster = getLayer(mapPoint);
+		if(raster != null && raster.getDataStore() != null) {
+			Point2D rasterPoint = raster.getDataStore().worldToRaster(mapPoint);
+			model.setNumberOfBands(raster.getDataStore().getBandCount());
+			model.setPixelPoint(rasterPoint.getX(), rasterPoint.getY());
+		} /*else {
+			model.setNumberOfBands(0);
+			model.setBandValues(new double[]{Double.NaN});
+			model.setPixelPoint(-1, -1);
+		}*/
+		
+		model.notifyObservers();
+		
+		//Actualiza el inspector
+		observer.setClear(false);
+		observer.setDataBuffer(image);
+		int pX = ((observer.getWidth() / observer.getScale()) >> 1) - e.getX();
+		int pY = ((observer.getHeight() / observer.getScale()) >> 1) - e.getY();
+		observer.setViewCoordinates((int)e.getPoint().getX(), (int)e.getPoint().getY());
+		observer.setPosX(pX);
+		observer.setPosY(pY);
+		observer.repaint();
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/viewtool/PixelInspectorViewTool.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/viewtool/InfoByPixelPointViewTool.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/viewtool/InfoByPixelPointViewTool.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/viewtool/InfoByPixelPointViewTool.java	(revision 8183)
@@ -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.tools.app.basic.tool.infobypoint.viewtool;
+
+import java.awt.geom.Point2D;
+import java.awt.image.BufferedImage;
+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.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.util.ColorConversion;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.Events.PointEvent;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.infobypoint.InfoByPointDataModel;
+import org.gvsig.raster.tools.app.basic.tool.selectrasterlayer.SelectImageListImpl;
+
+/**
+ * This tool writes in InfoByPointDataModel the information about the selected point.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class InfoByPixelPointViewTool extends SelectImageListImpl {
+	private RasterManager            rManager            = RasterLocator.getManager();
+	private InfoByPointDataModel     model               = null;
+	private ColorConversion          conv                = null;
+	private ViewPort                 viewPort            = null;
+	private FLayers                  layers              = null;
+	private List<String>             list                = null;
+	
+	/**
+	 * Contructor
+	 * @param mapCtrl
+	 */
+	public InfoByPixelPointViewTool(MapControl mapCtrl, InfoByPointDataModel model) {
+		super(mapCtrl);
+		this.model = model;
+		conv = rManager.getColorConversion();
+		viewPort = mapCtrl.getViewPort();
+		layers = mapCtrl.getMapContext().getLayers();
+		list = new ArrayList<String>();
+	}
+
+	@SuppressWarnings("deprecation")
+	public void point(PointEvent event) {
+		super.point(event);
+
+		Point2D point2D = event.getPoint();
+
+		BufferedImage image = mapCtrl.getImage();
+		int value = image.getRGB((int) point2D.getX(), (int) point2D.getY());
+		int r = (value >> 16) & 0xff;
+		int g = (value >> 8) & 0xff;
+		int b = value & 0xff;
+		
+		double[] cmyk = conv.RGBtoCMYK(r & 0xff, g & 0xff, b & 0xff, 1D);
+		
+		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);
+		
+		Point2D mapPoint = viewPort.toMapPoint(point2D);
+		
+		model.setARGB(r, g, b);
+		model.setCMYK(cmyk);
+		model.setHSL(hsl[0], hsl[1], hsl[2]);
+		model.setViewPoint(point2D.getX(), point2D.getY());
+		model.setWorldPoint(mapPoint.getX(), mapPoint.getY());
+		
+		//Raster dependent
+		
+		list.clear();
+		FLyrRaster selected = null;
+		for (int i = layers.getLayersCount() - 1; i >= 0; i--) {
+			FLayer lyr = layers.getLayer(i);
+			if(lyr instanceof FLyrRaster) {
+				FLyrRaster raster = (FLyrRaster)lyr;
+				Point2D tmpPoint = mapPoint;
+				
+				if(raster.getCoordTrans() != null){
+                    tmpPoint = raster.getCoordTrans().getInverted().convert(mapPoint, null);
+				}
+				
+				if(raster.isInside(tmpPoint)) {
+				    list.add(raster.getName());
+                    if(raster.isActive())
+                        selected = raster;
+				}
+			}
+		}
+		
+		if(selected != null) {
+		    
+		    if(selected.getCoordTrans() != null){
+		        mapPoint = selected.getCoordTrans().getInverted().convert(mapPoint, null);
+            }
+		    
+			Point2D rasterPoint = selected.getDataStore().worldToRaster(mapPoint);
+			model.setNumberOfBands(selected.getDataStore().getBandCount());
+			model.setBandValues(getBandValues(selected.getDataStore(), rasterPoint));
+			model.setPixelPoint(rasterPoint.getX(), rasterPoint.getY());
+		} else {
+			list.clear();
+			list.add("...");
+			model.setNumberOfBands(0);
+			model.setBandValues(new double[]{Double.NaN});
+			model.setPixelPoint(-1, -1);
+		}
+		model.setLayerList(list);
+		
+		model.notifyObservers();
+	}
+	
+	/**
+	 * Loads the values of a pixel point
+	 * @param dataStore
+	 * @param pxPoint
+	 * @return
+	 */
+	private double[] getBandValues(RasterDataStore dataStore, Point2D pxPoint) {
+		double[] res = new double[dataStore.getBandCount()];
+		int pos = 0;
+		try {
+			if(dataStore.getDataType()[0] >= 0 && dataStore.getDataType()[0] <= 3) {
+				for(int i = 0; i < dataStore.getBandCount(); i++) {
+					int val = ((Integer)dataStore.getData((int)pxPoint.getX(), (int)pxPoint.getY(), i)).intValue();
+					if(dataStore.getDataType()[0] == Buffer.TYPE_BYTE)
+						res[pos] = (val & 0x000000ff);
+					else
+						res[pos] = val;
+					pos ++;
+				}
+			}
+
+			if(dataStore.getDataType()[0] == 4) {
+				for(int i = 0; i < dataStore.getBandCount(); i++) {
+					res[pos] = ((Float)dataStore.getData((int)pxPoint.getX(), (int)pxPoint.getY(), i)).doubleValue() ;
+					pos ++;
+				}
+			}
+			if(dataStore.getDataType()[0] == 5) {
+				for(int i = 0; i < dataStore.getBandCount(); i++) {
+					res[pos] = ((Double)dataStore.getData((int)pxPoint.getX(), (int)pxPoint.getY(), i)).doubleValue();
+					pos ++;
+				}
+			}
+			return res;
+		} catch (Exception e) {
+			for (int i = 0; i < dataStore.getBandCount(); i++) {
+				res[i] = Double.NaN;
+			}
+		} 
+		return res;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/viewtool/InfoByPixelPointViewTool.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/viewtool
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/TransformationBehavior.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/TransformationBehavior.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/TransformationBehavior.java	(revision 8183)
@@ -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.tools.app.basic.tool.geolocation.behavior;
+
+import java.awt.Color;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.Toolkit;
+import java.awt.event.MouseEvent;
+
+import org.gvsig.fmap.mapcontrol.MapControlDrawer;
+import org.gvsig.fmap.mapcontrol.tools.BehaviorException;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+
+/**
+ * Clase base para los comportamientos de traslaci�n, escalado, rotaci�n y shearing de un raster.
+ * Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public abstract class TransformationBehavior {
+
+	private boolean                     activeTool = false;
+	protected Image                    	defaultImage = null;
+	protected GeoRasterBehavior         grBehavior = null;
+	protected FLyrRaster                lyr = null;
+	protected Color                     rectangleColor = Color.RED;
+	protected ITransformIO				trIO = null;
+
+	/**
+	 * Consulta si la tool est� activada o no
+	 * @return
+	 */
+	public boolean isActiveTool() {
+		return activeTool;
+	}
+
+	/**
+	 * ASigna el valor de activaci�n de la tool
+	 * @param activeTool
+	 */
+	public void setActiveTool(boolean activeTool) {
+		this.activeTool = activeTool;
+	}
+
+	/**
+	 * Cambia el cursor de la vista al que le pasemos por par�metro
+	 * @param c Image para el cursor
+	 */
+	protected void setCursor(Image c) {
+		if(grBehavior != null)
+			grBehavior.getMapControl().setCursor(Toolkit.getDefaultToolkit().createCustomCursor(c, new Point(16, 16), ""));
+	}
+
+	/**
+	 *  Cuando soltamos el bot�n del rat�n desplazamos la imagen a la posici�n
+	 * de destino calculando el extent nuevamente.
+	 */
+	public void mouseReleased(MouseEvent e) throws BehaviorException {
+		if(trIO != null)
+			trIO.applyTransformation();
+	}
+
+	/**
+	 * Asigna el objeto externo al que se le asigna la transformaci�n
+	 * @param io
+	 */
+	public void setITransformIO(ITransformIO io) {
+		this.trIO = io;
+	}
+
+	/**
+	 * M�todo utilizado para el repintado del gr�fico que sirve como apoyo para
+	 * las transformaciones. Cada tipo de transformaci�n (escalado, rotado, traslaci�n y shearing)
+	 * realiza sus acciones para redibujar este gr�fico.
+	 *
+	 * @param g Graphics
+	 */
+	public abstract void paintComponent(MapControlDrawer mapControlDrawer);
+
+	/**
+	 * Evento que se produce al pulsar el bot�n del rat�n sobre la vista cuando la herramienta
+	 * de geolocalizaci�n est� activa. Esto produce la activaci�n de una de las tranformaciones
+	 * dependiendo de la posici�n del cursor del rast�n relativa a la imagen.
+	 *
+	 * @param e Graphics
+	 */
+	public abstract void mousePressed(MouseEvent e) throws BehaviorException;
+
+	/**
+	 * Evento que se produce al mover el rat�n sobre la vista cuando la herramienta
+	 * de geolocalizaci�n est� activa. Esto produce la variaci�n del gr�fico de apoyo para
+	 * la transformaci�n.
+	 *
+	 * @param e Graphics
+	 */
+	public abstract boolean mouseMoved(MouseEvent ev) throws BehaviorException;
+
+	/**
+	 * Evento que se produce al arrastrar el rat�n sobre la vista cuando la herramienta
+	 * de geolocalizaci�n est� activa. Esto produce la variaci�n del gr�fico de apoyo para
+	 * la transformaci�n.
+	 *
+	 * @param e Graphics
+	 */
+	public abstract void mouseDragged(MouseEvent ev) throws BehaviorException;
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/TransformationBehavior.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/ScaleBehavior.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/ScaleBehavior.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/ScaleBehavior.java	(revision 8183)
@@ -0,0 +1,520 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.geolocation.behavior;
+
+import java.awt.AlphaComposite;
+import java.awt.Image;
+import java.awt.event.MouseEvent;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+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.Listeners.RectangleListener;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+
+
+/**
+ * Comportamiento que se aplica a la herramienta de scale. El cursor del rat�n cambiar� cuando
+ * se encuentre en los bordes del raster, permitiendo el escalar la imagen al pinchar y
+ * arrastrar.
+ *
+ * Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class ScaleBehavior extends TransformationBehavior {
+	//N�mero de pixeles de ancho del borde donde el cursor se activar�. Son pixeles del canvas de la vista.
+	//De esta forma da igual la escala a la que est� la imagen siempre tiene la misma precisi�n
+	private int 							PX_SELEC_BASE = 6;
+	private int 							LONG_CORNER_BASE = 12;
+	private int 							PX_SELEC = PX_SELEC_BASE;
+	private int 							LONG_CORNER = LONG_CORNER_BASE;
+
+	private RectangleListener               listener;
+
+	private final Image                     iconHoriz = IconThemeHelper.getImage("hor-arrow-cursor");
+	private final Image                     iconVert = IconThemeHelper.getImage("ver-arrow-cursor");
+	private final Image                     iconInclDer = IconThemeHelper.getImage("inclder-arrow-cursor");
+	private final Image                     iconInclIzq = IconThemeHelper.getImage("inclizq-arrow-cursor");
+
+	/**
+	 * Variable que si est� a true permite que se pinte el marco de la imagen. Se activa al
+	 * comenzar el redimensionado y se desactiva al terminar
+	 */
+	private boolean 						isResizable = false;
+	/**
+	 * Escala entre la imagen inicial y la final. Esta es la que sea aplicar� al raster visualizado al
+	 * terminar la operaci�n de reescalado. Esta podemos conocerla cuando levantamos el bot�n
+	 * del rat�n dividiendo el nuevo ancho por el inicial
+	 */
+	private double							escale = 1D;
+
+	/**
+	 * Lista de flags de redimensionado para cada lado del raster
+	 * [0]-arriba
+	 * [1]-abajo
+	 * [2]-derecha
+	 * [3]-izquierda
+	 * [4]-esquina superior derecha
+	 * [5]-esquina superior izquierda
+	 * [6]-esquina inferior derecha
+	 * [7]-esquina inferior izquierda
+	 */
+	private boolean[]						sideActive = {false, false, false, false, false, false, false, false};
+	private boolean 						init = false;
+	private Point2D                         tmpLr, tmpUl;
+	private double							initWidth, endWidth;
+
+	/**
+	 * Crea un nuevo RectangleBehavior.
+	 *
+	 * @param zili listener.
+	 */
+	public ScaleBehavior(GeoRasterBehavior grb, Image curImage, ITransformIO windowIO) {
+		grBehavior = grb;
+		defaultImage = curImage;
+		this.trIO = windowIO;
+	}
+
+	/**
+	 * Inicializaci�n. Calcula la longitud de la esquina y el ancho en p�xeles
+	 * de la zona de detecci�n del puntero de rat�n. Inicialmente esto est� calculado en
+	 * unidades pixel de la vista pero la detecci�n de puntero, debido a la rotaci�n posible
+	 * del raster ha de hacerse en unidades del raster en disco por ello ha de calcularse
+	 * una escala entre ambas unidades cuando se carga la aplicaci�n.
+	 *
+	 */
+	private void init() {
+		ViewPort vp = grBehavior.getMapControl().getMapContext().getViewPort();
+		lyr = grBehavior.getLayer();
+		if(lyr == null)
+			return ;
+
+		Extent ext = lyr.getDataStore().getExtent();
+		AffineTransform atImg = lyr.getAffineTransform();
+
+		//Establecer una escala entre las coordenadas de la vista y las coordenadas pixel
+		Point2D ul = new Point2D.Double(ext.getULX(), ext.getULY());
+		Point2D lr = new Point2D.Double(ext.getLRX(), ext.getLRY());
+		Point2D ulPx = new Point2D.Double();
+		Point2D lrPx = new Point2D.Double();
+		Point2D ulVp = new Point2D.Double();
+		Point2D lrVp = new Point2D.Double();
+		double esc = 1;
+		try {
+			atImg.inverseTransform(ul, ulPx);
+			atImg.inverseTransform(lr, lrPx);
+			ulVp = vp.fromMapPoint(ul);
+			lrVp = vp.fromMapPoint(lr);
+			esc = Math.abs(lrPx.getX() - ulPx.getX()) / Math.abs(lrVp.getX() - ulVp.getX());
+		} catch (NoninvertibleTransformException e1) {
+			return;
+		}
+
+		//Escalar PX_SELEC y LONG_CORNER para tenerlo en coordenadas pixel
+
+		PX_SELEC = (int)(PX_SELEC_BASE * esc);
+		LONG_CORNER = (int)(LONG_CORNER_BASE * esc);
+		init = true;
+	}
+
+	/**
+	 * <P>
+	 * Cuando se produce un evento de pintado dibujamos el marco de la imagen para
+	 * que el usuario pueda seleccionar y redimensionar. Pintamos un marco a la imagen para saber
+	 * donde la movemos.
+	 * </P>
+	 * <P>
+	 * Para dibujar el marco alrededor del raster hacemos lo mismo que para pintar el raster
+	 * rotado. En realidad dibujamos un cuadrado y luego le aplicamos las transformaciones necesarias
+	 * para que se vea con la misma forma del raster al que representa.
+	 * </P>
+	 */
+	public void paintComponent(MapControlDrawer mapControlDrawer) {
+		if(isResizable && lyr != null) {
+			try {
+				ViewPort vp = grBehavior.getMapControl().getMapContext().getViewPort();
+				Point2D ul = new Point2D.Double();
+				Point2D lr = new Point2D.Double();
+				AffineTransform tr = lyr.getAffineTransform();
+				tr.transform(tmpUl, ul);
+				tr.transform(tmpLr, lr);
+
+				AffineTransform at = new AffineTransform(tr.getScaleX(), tr.getShearY(),
+														 tr.getShearX(), tr.getScaleY(),
+														 ul.getX(), ul.getY());
+				at.preConcatenate(vp.getAffineTransform());
+
+				vp.getAffineTransform().transform(ul, ul);
+				at.inverseTransform(ul, ul);
+
+				vp.getAffineTransform().transform(lr, lr);
+				at.inverseTransform(lr, lr);
+
+				mapControlDrawer.transform(at);
+				mapControlDrawer.setColor(rectangleColor);
+				mapControlDrawer.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.1f));
+				mapControlDrawer.fillRect((int)ul.getX(), (int)ul.getY(), (int)lr.getX(), (int)lr.getY());
+				mapControlDrawer.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f));
+				mapControlDrawer.drawRect((int)ul.getX(), (int)ul.getY(), (int)lr.getX(), (int)lr.getY());
+				mapControlDrawer.transform(at.createInverse());
+			} catch (NoninvertibleTransformException e1) {
+				RasterSwingLibrary.messageBoxError("error_transformacion1", this, e1);
+			}
+		}
+	}
+
+	/**
+	 * Reimplementaci�n del m�todo mousePressed de Behavior. Cuando se pulsa
+	 * estando sobre el marco de la imagen activamos la posibilidad de arrastrar
+	 * para redimensionar la imagen.
+	 *
+	 * @param e MouseEvent
+	 */
+	public void mousePressed(MouseEvent e) {
+		if (e.getButton() == MouseEvent.BUTTON1) {
+			setActiveTool(true);
+			isResizable = true;;
+			ViewPort vp = grBehavior.getMapControl().getMapContext().getViewPort();
+			if(lyr == null)
+				lyr = grBehavior.getLayer();
+
+			if(vp != null && lyr != null) {
+				Extent ext = lyr.getFullRasterExtent();
+				tmpUl = new Point2D.Double(ext.getULX(), ext.getULY());
+				tmpLr = new Point2D.Double(ext.getLRX(), ext.getLRY());
+				try {
+					lyr.getAffineTransform().inverseTransform(tmpUl, tmpUl);
+					lyr.getAffineTransform().inverseTransform(tmpLr, tmpLr);
+				} catch (NoninvertibleTransformException e1) {
+					e1.printStackTrace();
+				}
+				initWidth = Math.abs(tmpUl.getX() - tmpLr.getX());
+			}
+		}
+	}
+
+	/**
+	 * Reimplementaci�n del m�todo mouseReleased de Behavior.
+	 *
+	 * @param e MouseEvent
+	 *
+	 * @throws BehaviorException Excepci�n lanzada cuando el Behavior.
+	 */
+	public void mouseReleased(MouseEvent e) throws BehaviorException {
+		resetBorderSelected();
+		if (e.getButton() == MouseEvent.BUTTON1 && isResizable && lyr != null) {
+			endWidth = Math.abs(tmpUl.getX() - tmpLr.getX());
+			escale = endWidth / initWidth;
+
+			AffineTransform tr = (AffineTransform)lyr.getAffineTransform().clone();
+			Point2D ul = new Point2D.Double();
+			Point2D lr = new Point2D.Double();
+			tr.transform(tmpUl, ul);
+			tr.transform(tmpLr, lr);
+
+			AffineTransform esc = new AffineTransform(escale, 0, 0, escale, 0, 0);
+			AffineTransform at = new AffineTransform(tr.getScaleX(), tr.getShearY(),
+													tr.getShearX(), tr.getScaleY(),
+													ul.getX(), ul.getY());
+			esc.preConcatenate(at);
+			lyr.setAffineTransform(esc);
+			grBehavior.getMapControl().getMapContext().invalidate();
+			isResizable = false;
+			super.mouseReleased(e);
+		}
+	}
+
+	/**
+	 * Al arrastrar cuando se ha pulsado sobre el marco de la imagen recalculamos
+	 * el marco de la imagen
+	 *
+	 * @param e MouseEvent
+	 */
+	@SuppressWarnings("deprecation")
+	public void mouseDragged(MouseEvent ev) {
+		if(isResizable) {
+			if(tmpLr == null || tmpUl == null || lyr == null)
+				return;
+
+			setActiveTool(true);
+
+			ViewPort vp = grBehavior.getMapControl().getMapContext().getViewPort();
+
+			//Pasamos el punto obtenido a coordenadas del raster
+			Point2D e = new Point2D.Double(ev.getX(), ev.getY());
+			e = vp.toMapPoint(e);
+			try {
+				lyr.getAffineTransform().inverseTransform(e, e);
+			} catch (NoninvertibleTransformException e1) {
+				e1.printStackTrace();
+			}
+
+			double longLadoX = Math.abs(tmpLr.getX() - tmpUl.getX());
+			double longLadoY = Math.abs(tmpLr.getY() - tmpUl.getY());
+			double coordCentroV = tmpUl.getY() + (Math.abs(tmpLr.getY() - tmpUl.getY()) / 2);
+			double coordCentroH = tmpUl.getX() + (Math.abs(tmpLr.getX() - tmpUl.getX()) / 2);
+			if(sideActive[2]) {//vertical derecha
+				double newLadoX = (e.getX() - tmpUl.getX());
+				double newLadoY = (newLadoX * longLadoY) / longLadoX;
+				tmpUl = new Point2D.Double(tmpUl.getX(), coordCentroV - (newLadoY / 2));
+				tmpLr = new Point2D.Double(e.getX(), coordCentroV + (newLadoY / 2));
+			} else if(sideActive[3]) {//vertical izquierda
+				double newLadoX = (e.getX() - tmpLr.getX());
+				double newLadoY = (newLadoX * longLadoY) / longLadoX;
+				tmpLr = new Point2D.Double(tmpLr.getX(), coordCentroV - (newLadoY / 2));
+				tmpUl = new Point2D.Double(e.getX(), coordCentroV + (newLadoY/2));
+			} else if(sideActive[1]) {//horizontal abajo
+				double newLadoY = (e.getY() - tmpUl.getY());
+				double newLadoX = (newLadoY * longLadoX) / longLadoY;
+				tmpLr = new Point2D.Double(coordCentroH + (newLadoX / 2), e.getY());
+				tmpUl = new Point2D.Double(coordCentroH - (newLadoX / 2), tmpUl.getY());
+			} else if(sideActive[0]) {//horizontal arriba
+				double newLadoY = (tmpLr.getY() - e.getY());
+				double newLadoX = (newLadoY * longLadoX) / longLadoY;
+				tmpUl = new Point2D.Double(coordCentroH - (newLadoX / 2), e.getY());
+				tmpLr = new Point2D.Double(coordCentroH + (newLadoX / 2), tmpLr.getY());
+			} else if(sideActive[6]) {//Esquina inferior derecha
+				 double rel = longLadoX / longLadoY;
+				 double difY = (e.getY() - tmpLr.getY());
+							 double difX = (e.getX() - tmpLr.getX());
+							 if(difX > difY){
+								 difY = difX / rel;
+							 }else
+								 difX = difY * rel;
+							 tmpUl = new Point2D.Double(tmpUl.getX(), tmpUl.getY());
+							 tmpLr = new Point2D.Double(tmpLr.getX() + difX, tmpLr.getY() + difY);
+			} else if(sideActive[5]) {//Esquina superior izquierda
+				 double rel = longLadoX / longLadoY;
+				 double difY = (tmpUl.getY() - e.getY());
+							 double difX = (tmpUl.getX() - e.getX());
+							 if(difX > difY){
+								 difY = difX / rel;
+							 }else
+								 difX = difY * rel;
+							 tmpUl = new Point2D.Double(tmpUl.getX() - difX, tmpUl.getY() - difY);
+							 tmpLr = new Point2D.Double(tmpLr.getX(), tmpLr.getY());
+				} else if(sideActive[4]) {//Esquina superior derecha
+				 double rel = longLadoX / longLadoY;
+				 double difY = (tmpUl.getY() - e.getY());
+							 double difX = (e.getX() - tmpLr.getX());
+							 if(difX > difY){
+								 difY = difX / rel;
+							 }else
+								 difX = difY * rel;
+							 tmpUl = new Point2D.Double(tmpUl.getX(), tmpUl.getY() - difY);
+							 tmpLr = new Point2D.Double(tmpLr.getX() + difX, tmpLr.getY());
+				} else if(sideActive[7]) {//Esquina inferior izquierda
+					double rel = longLadoX / longLadoY;
+				double difY = (e.getY() - tmpLr.getY());
+							double difX = (tmpUl.getX() - e.getX());
+							if(difX > difY)
+								difY = difX / rel;
+							else
+								difX = difY * rel;
+							tmpUl = new Point2D.Double(tmpUl.getX() - difX, tmpUl.getY());
+							tmpLr = new Point2D.Double(tmpLr.getX(), tmpLr.getY() + difY);
+				}
+
+			//Asignaci�n de las coordenadas temporales al dialogo
+			assignTransformToDialog();
+
+			grBehavior.getMapControl().repaint();
+		}
+	}
+
+	/**
+	 * Asigna las coordenadas temporales en el dialogo.
+	 */
+	public void assignTransformToDialog() {
+		Point2D ul = new Point2D.Double();
+		Point2D lr = new Point2D.Double();
+		AffineTransform tr = grBehavior.getLayer().getAffineTransform();
+		tr.transform(tmpUl, ul);
+		tr.transform(tmpLr, lr);
+		endWidth = Math.abs(tmpUl.getX() - tmpLr.getX());
+		escale = endWidth / initWidth;
+		AffineTransform esc = new AffineTransform(escale, 0, 0, escale, 0, 0);
+		AffineTransform at = new AffineTransform(tr.getScaleX(), tr.getShearY(),
+												tr.getShearX(), tr.getScaleY(),
+												ul.getX(), ul.getY());
+		esc.preConcatenate(at);
+		trIO.loadTransform(esc);
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#setListener(org.gvsig.georeferencing.fmap.tools.ToolListener)
+	 */
+	public void setListener(ToolListener listener) {
+		this.listener = (RectangleListener) listener;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#getListener()
+	 */
+	public ToolListener getListener() {
+		return listener;
+	}
+
+	/**
+	 * Cuando movemos el rat�n detecta si estamos en el marco de la
+	 * imagen y pone el icono del cursor del rat�n adecuado.
+	 */
+	@SuppressWarnings("deprecation")
+	public boolean mouseMoved(MouseEvent ev) throws BehaviorException {
+		if(!init)
+			init();
+
+		ViewPort vp = grBehavior.getMapControl().getMapContext().getViewPort();
+		resetBorderSelected();
+
+		lyr = grBehavior.getLayer();
+		if(lyr == null) {
+			setActiveTool(false);
+			return false;
+		}
+
+		AffineTransform atImg = lyr.getAffineTransform();
+
+		//Pasar coordenadas del punto a coordenadas reales y luego a coordenadas pixel
+		Point2D e = vp.toMapPoint(ev.getX(), ev.getY());
+		try {
+			atImg.inverseTransform(e, e);
+		} catch (NoninvertibleTransformException e1) {
+			return false;
+		}
+
+		//Comprobar si est� dentro del raster
+		Point2D p1 = new Point2D.Double(0, 0);
+		Point2D p2 = new Point2D.Double(lyr.getDataStore().getWidth(), lyr.getDataStore().getHeight());
+
+		//Fuera del raster
+		if(e.getX() < p1.getX() || e.getX() > p2.getX() || e.getY() < p1.getY() || e.getY() > p2.getY() ) {
+			setActiveTool(false);
+			grBehavior.getMapControl().repaint();
+			return false;
+		}
+
+		//Borde izquierdo
+		if(e.getX() > p1.getX() && e.getX() <= (p1.getX() + PX_SELEC) && e.getY() > (p1.getY() + LONG_CORNER) && e.getY() < (p2.getY() - LONG_CORNER)) {
+			grBehavior.setCursorImage(iconHoriz);
+			setActiveTool(true);
+			sideActive[3] = true;
+			return true;
+		}
+
+		//Borde derecho
+		if(e.getX() >= (p2.getX() - PX_SELEC) && e.getX() < p2.getX() && e.getY() > (p1.getY() + LONG_CORNER) && e.getY() < (p2.getY() - LONG_CORNER)) {
+			grBehavior.setCursorImage(iconHoriz);
+			setActiveTool(true);
+			sideActive[2] = true;
+			return true;
+		}
+
+		//Borde superior
+		if(e.getY() > p1.getY() && e.getY() <= (p1.getY() + PX_SELEC) && e.getX() > (p1.getX() + LONG_CORNER) && e.getX() < (p2.getX() - LONG_CORNER)) {
+			grBehavior.setCursorImage(iconVert);
+			setActiveTool(true);
+			sideActive[0] = true;
+			return true;
+		}
+
+		//Borde inferior
+		if(e.getY() >= (p2.getY() - PX_SELEC) && e.getY() < p2.getY() && e.getX() > (p1.getX() + LONG_CORNER) && e.getX() < (p2.getX() - LONG_CORNER)) {
+			grBehavior.setCursorImage(iconVert);
+			setActiveTool(true);
+			sideActive[1] = true;
+			return true;
+		}
+
+		//esquina superior izquierda
+		if ((e.getX() > p1.getX() && e.getX() <= (p1.getX() + LONG_CORNER) && e.getY() > p1.getY() && e.getY() < (p1.getY() + PX_SELEC)) ||
+			(e.getX() > p1.getX() && e.getX() <= (p1.getX() + PX_SELEC) && e.getY() > p1.getY() && e.getY() <= (p1.getY() + LONG_CORNER))) {
+			if((atImg.getScaleX() * atImg.getScaleY()) < 0) {
+				grBehavior.setCursorImage(iconInclIzq);
+			} else {
+				grBehavior.setCursorImage(iconInclDer);
+			}
+			setActiveTool(true);
+			sideActive[5] = true;
+			return true;
+		}
+
+		//esquina superior derecha
+		if ((e.getX() >= (p2.getX() - LONG_CORNER) && e.getX() < p2.getX() && e.getY() > p1.getY() && e.getY() < (p1.getY() + PX_SELEC)) ||
+			(e.getX() >= (p2.getX() - PX_SELEC) && e.getX() < p2.getX() && e.getY() > p1.getY() && e.getY() <= (p1.getY() + LONG_CORNER))) {
+			if((atImg.getScaleX() * atImg.getScaleY()) < 0) {
+				grBehavior.setCursorImage(iconInclDer);
+			} else {
+				grBehavior.setCursorImage(iconInclIzq);
+			}
+			setActiveTool(true);
+			sideActive[4] = true;
+			return true;
+		}
+
+		//esquina inferior izquierda
+		if ((e.getX() > p1.getX() && e.getX() <= (p1.getX() + LONG_CORNER) && e.getY() >= (p2.getY() - PX_SELEC) && e.getY() < p2.getY()) ||
+			(e.getX() > p1.getX() && e.getX() <= (p1.getX() + PX_SELEC) && e.getY() < p2.getY() && e.getY() >= (p2.getY() - LONG_CORNER))) {
+			if((atImg.getScaleX() * atImg.getScaleY()) < 0) {
+				grBehavior.setCursorImage(iconInclDer);
+			} else {
+				grBehavior.setCursorImage(iconInclIzq);
+			}
+			setActiveTool(true);
+			sideActive[7] = true;
+			return true;
+		}
+
+		//esquina inferior derecha
+		if ((e.getX() < p2.getX() && e.getX() >= (p2.getX() - LONG_CORNER) && e.getY() >= (p2.getY() - PX_SELEC) && e.getY() < p2.getY()) ||
+			(e.getX() < p2.getX() && e.getX() >= (p2.getX() - PX_SELEC) && e.getY() < p2.getY() && e.getY() >= (p2.getY() - LONG_CORNER))){
+			if((atImg.getScaleX() * atImg.getScaleY()) < 0) {
+				grBehavior.setCursorImage(iconInclIzq);
+			} else {
+				grBehavior.setCursorImage(iconInclDer);
+			}
+			setActiveTool(true);
+			sideActive[6] = true;
+			return true;
+		}
+
+		grBehavior.resetDefaultCursor();
+		grBehavior.getMapControl().repaint();
+		return false;
+	}
+
+	/**
+	 * Pone a false todos los elementos del array sideActive. Esto es equivalente
+	 * a eliminar cualquier selecci�n de borde.
+	 */
+	private void resetBorderSelected() {
+		for (int i = 0; i < sideActive.length; i++)
+			sideActive[i] = false;
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/ScaleBehavior.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/GeoRasterBehavior.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/GeoRasterBehavior.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/GeoRasterBehavior.java	(revision 8183)
@@ -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.tools.app.basic.tool.geolocation.behavior;
+
+import java.awt.Image;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseWheelEvent;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.project.documents.view.gui.IView;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.fmap.mapcontrol.MapControl;
+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.Listeners.PanListener;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+
+
+
+/**
+ * Behavior que espera un listener de tipo GeoMoveListener.
+ * Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class GeoRasterBehavior extends Behavior {
+	private Image                          	curImage = null;
+	private Image                           notValid = IconThemeHelper.getImage("not-valid-cursor");
+	private IView                           theView = null;
+	private TransformationBehavior[]		behavior = new TransformationBehavior[4];
+	private FLyrRaster                      lyr = null;
+
+	/**
+	 * Crea un nuevo GeoRasterBehavior.
+	 *
+	 * @param zili listener.
+	 * @param windowIO
+	 */
+	public GeoRasterBehavior(PanListener zili, ITransformIO windowIO) {
+		curImage = zili.getImageCursor();
+		behavior[0] = new TranslateBehavior(this, curImage, windowIO);
+		behavior[1] = new ScaleBehavior(this, curImage, windowIO);
+		behavior[2] = new RotationBehavior(this, curImage, windowIO);
+		behavior[3] = new ShearBehavior(this, curImage, windowIO);
+	}
+
+	/**
+	 * Crea un nuevo RectangleBehavior.
+	 *
+	 * @param zili listener.
+	 */
+	public GeoRasterBehavior(PanListener zili, ITransformIO windowIO, FLyrRaster lyr) {
+		this(zili, windowIO);
+		this.lyr = lyr;
+	}
+
+	/**
+	 * Asigna la capa raster
+	 * @param lyr
+	 */
+	public void setLayer(FLyrRaster lyr) {
+		this.lyr = lyr;
+	}
+
+	/**
+	 * Asigna el objeto externo para variar la transformaci�n
+	 * @param gld
+	 */
+	public void setITransformIO(ITransformIO gld) {
+		for (int i = 0; i < behavior.length; i++)
+			behavior[i].setITransformIO(gld);
+	}
+
+	/**
+	 * Funci�n que carga la capa si todav�a no lo est�.
+	 */
+	public FLyrRaster getLayer() {
+		//Cuando cargamos desde el men� contextual la capa es asignada de forma fija
+		if(lyr != null)
+			return lyr;
+
+		//Cuando cargamos desde la barra hay que buscar la capa activa.
+
+		IWindow w = PluginServices.getMDIManager().getActiveWindow();
+		if(w instanceof IView) {
+			theView = (IView)w;
+			FLayers lyrs = theView.getMapControl().getMapContext().getLayers();
+			for (int i = 0; i < lyrs.getActives().length; i++)
+				if(lyrs.getActives()[i] instanceof FLyrRaster)
+					return (FLyrRaster)lyrs.getActives()[i];
+		}
+		return null;
+	}
+
+	/**
+	 * Coloca el cursor del rat�n con el icono adecuado cuando entra dentro de la
+	 * imagen.
+	 */
+	public void mouseMoved(MouseEvent e) throws BehaviorException {
+		behavior[0].setActiveTool(false);
+		behavior[1].setActiveTool(false);
+		behavior[2].setActiveTool(false);
+		behavior[3].setActiveTool(false);
+		if(!behavior[1].mouseMoved(e))
+			if(!behavior[0].mouseMoved(e))
+				if(!behavior[2].mouseMoved(e))
+					if(!behavior[3].mouseMoved(e));
+	}
+
+	/**
+	 * Si no est� activo el cursor por defecto capturamos el punto
+	 * seleccionado en coordenadas del mundo real.
+	 */
+	public void mousePressed(MouseEvent e) throws BehaviorException {
+		if(behavior[1].isActiveTool())
+			behavior[1].mousePressed(e);
+		else if(behavior[0].isActiveTool())
+			behavior[0].mousePressed(e);
+		else if(behavior[2].isActiveTool())
+			behavior[2].mousePressed(e);
+		else if(behavior[3].isActiveTool())
+			behavior[3].mousePressed(e);
+	}
+
+	/**
+	 *  Cuando soltamos el bot�n del rat�n desplazamos la imagen a la posici�n
+	 * de destino calculando el extent nuevamente.
+	 */
+	public void mouseReleased(MouseEvent e) throws BehaviorException {
+		if(behavior[1].isActiveTool())
+			behavior[1].mouseReleased(e);
+		else if(behavior[0].isActiveTool())
+			behavior[0].mouseReleased(e);
+		else if(behavior[2].isActiveTool())
+			behavior[2].mouseReleased(e);
+		else if(behavior[3].isActiveTool())
+			behavior[3].mouseReleased(e);
+	}
+
+	/**
+	 * Funci�n de pintado del canvas.Pintamos un marco a la imagen para saber
+	 * donde la movemos.
+	 */
+	public void paintComponent(MapControlDrawer mapControlDrawer) {
+		super.paintComponent(mapControlDrawer);
+		if(behavior[1].isActiveTool())
+			behavior[1].paintComponent(mapControlDrawer);
+		else if(behavior[0].isActiveTool())
+			behavior[0].paintComponent(mapControlDrawer);
+		else if(behavior[2].isActiveTool())
+			behavior[2].paintComponent(mapControlDrawer);
+		else if(behavior[3].isActiveTool())
+			behavior[3].paintComponent(mapControlDrawer);
+	}
+
+	/**
+	 * Esta funci�n repinta el canvas si se est� arrasrtando la imagen para
+	 * poder ver el marco de arrastre.
+	 */
+	public void mouseDragged(MouseEvent e) throws BehaviorException {
+		if(behavior[1].isActiveTool())
+			behavior[1].mouseDragged(e);
+		else if(behavior[0].isActiveTool())
+			behavior[0].mouseDragged(e);
+		else if(behavior[2].isActiveTool())
+			behavior[2].mouseDragged(e);
+		else if(behavior[3].isActiveTool())
+			behavior[3].mouseDragged(e);
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#getListener()
+	 */
+	public ToolListener getListener() {
+		return null;
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#getMapControl()
+	 */
+	public MapControl getMapControl() {
+		return super.getMapControl();
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#mouseClicked(java.awt.event.MouseEvent)
+	 */
+	public void mouseClicked(MouseEvent e) throws BehaviorException {
+		super.mouseClicked(e);
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#mouseEntered(java.awt.event.MouseEvent)
+	 */
+	public void mouseEntered(MouseEvent e) throws BehaviorException {
+		super.mouseEntered(e);
+	}
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#mouseExited(java.awt.event.MouseEvent)
+	 */
+	public void mouseExited(MouseEvent e) throws BehaviorException {
+		super.mouseExited(e);
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#mouseWheelMoved(java.awt.event.MouseWheelEvent)
+	 */
+	public void mouseWheelMoved(MouseWheelEvent e) throws BehaviorException {
+		super.mouseWheelMoved(e);
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#setMapControl(com.iver.cit.gvsig.fmap.MapControl)
+	 */
+	public void setMapControl(MapControl mc) {
+		super.setMapControl(mc);
+	}
+	
+	public void setCursorImage(Image cursor) {
+		this.curImage = cursor;
+	}
+
+	public Image getImageCursor() {
+		return this.curImage;
+	}
+
+	public void resetDefaultCursor() {
+		this.curImage = notValid;
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/GeoRasterBehavior.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/ITransformIO.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/ITransformIO.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/ITransformIO.java	(revision 8183)
@@ -0,0 +1,42 @@
+/* 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.tools.app.basic.tool.geolocation.behavior;
+
+import java.awt.geom.AffineTransform;
+
+/**
+ * Interfaz para entrada y salida de datos que tienen que ver con transformaciones
+ * de georreferenciaci�n. 
+ * 
+ * @version 30/07/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface ITransformIO {
+	/**
+	 * Carga los par�metros de una transformaci�n af�n
+	 * @param transform
+	 */
+	public void loadTransform(AffineTransform transform);
+	
+	/**
+	 * M�todo llamado cuando se realiza la acci�n de aplicar una transformaci�n
+	 */
+	public void applyTransformation();
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/ITransformIO.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/TranslateBehavior.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/TranslateBehavior.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/TranslateBehavior.java	(revision 8183)
@@ -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.tools.app.basic.tool.geolocation.behavior;
+
+import java.awt.AlphaComposite;
+import java.awt.HeadlessException;
+import java.awt.Image;
+import java.awt.event.MouseEvent;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+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.Listeners.ToolListener;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+
+/**
+ * Comportamiento que se aplica a la herramienta de translate. El cursor del rat�n cambiar� cuando
+ * se encuentre en la zona interior al raster, permitiendo el deformar la imagen al pinchar y
+ * arrastrar.
+ *
+ * Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TranslateBehavior extends TransformationBehavior {
+
+	private final Image handCursor = IconThemeHelper.getImage("hand-cursor");
+
+//	private Cursor                         cur = null;
+	private boolean                        isMoveable = false;
+
+	/**
+	 * Variable booleana que est� a true si el cursor por defecto est�
+	 * activo y a false si hay otro.
+	 */
+	private boolean 						defaultCursorActive = true;
+
+	/**
+	 * Puntos de inicio y final para el arrastre de la imagen.
+	 */
+	private Point2D 						ptoIni = null;
+	private Point2D 						ptoFin = null;
+
+	/**
+	 * Crea un nuevo RectangleBehavior.
+	 *
+	 * @param zili listener.
+	 */
+	public TranslateBehavior(GeoRasterBehavior grb, Image curImage, ITransformIO windowIO) {
+		grBehavior = grb;
+		defaultImage = curImage;
+		this.trIO = windowIO;
+	}
+
+	/**
+	 * Coloca el cursor del rat�n con el icono adecuado cuando entra dentro de la
+	 * imagen.
+	 */
+	public boolean mouseMoved(MouseEvent e) throws BehaviorException {
+
+		ViewPort vp = grBehavior.getMapControl().getMapContext().getViewPort();
+
+		try {
+			lyr = grBehavior.getLayer();
+			if (lyr == null) {
+				setActiveTool(false);
+				return false;
+			}
+
+			Point2D pto = vp.toMapPoint(e.getX(), e.getY());
+
+			try {
+				if (lyr.isInside(pto)) {
+					grBehavior.setCursorImage(handCursor);
+					//grBehavior.getMapControl().setCursor(Toolkit.getDefaultToolkit().createCustomCursor(handCursor, new Point(16, 16), ""));
+					defaultCursorActive = false;
+					setActiveTool(true);
+					return true;
+				} else {
+					if (!defaultCursorActive) {
+						grBehavior.resetDefaultCursor();
+						defaultCursorActive = true;
+						setActiveTool(false);
+						return false;
+					}
+				}
+			} catch (HeadlessException e1) {
+				e1.printStackTrace();
+			} catch (IndexOutOfBoundsException e1) {
+				e1.printStackTrace();
+			}
+		} catch(ClassCastException exc){
+			RasterSwingLibrary.messageBoxError("error_capa_puntos", this, exc);
+		}
+		setActiveTool(false);
+		return false;
+	}
+
+	/**
+	 * Si no est� activo el cursor por defecto capturamos el punto
+	 * seleccionado en coordenadas del mundo real.
+	 */
+	public void mousePressed(MouseEvent e) throws BehaviorException {
+		if (e.getButton() == MouseEvent.BUTTON1 && !defaultCursorActive) {
+			setActiveTool(true);
+			lyr = grBehavior.getLayer();
+
+			if (lyr == null)
+				return;
+
+			ViewPort vp = grBehavior.getMapControl().getMapContext().getViewPort();
+			ptoIni = vp.toMapPoint(e.getPoint());
+
+			isMoveable = true;
+		}
+	}
+
+	/**
+	 *  Cuando soltamos el bot�n del rat�n desplazamos la imagen a la posici�n
+	 * de destino calculando el extent nuevamente.
+	 */
+	public void mouseReleased(MouseEvent e) throws BehaviorException {
+		if (!isActiveTool())
+			return;
+		if (e.getButton() == MouseEvent.BUTTON1 && isMoveable){
+			FLyrRaster lyr = grBehavior.getLayer();
+			if (lyr == null)
+				return;
+
+			ViewPort vp = grBehavior.getMapControl().getMapContext().getViewPort();
+			ptoFin = vp.toMapPoint(e.getPoint());
+
+			//Asignamos la nueva matriz de transformaci�n a la capa
+			AffineTransform atOld = lyr.getAffineTransform();
+			AffineTransform atNew = null;
+
+			double distX = ptoFin.getX() - ptoIni.getX();
+			double distY = ptoFin.getY() - ptoIni.getY();
+
+			//La nueva matriz de transformaci�n es la vieja m�s la distancia desplazada
+			atNew = new AffineTransform(atOld.getScaleX(), atOld.getShearY(),
+										atOld.getShearX(), atOld.getScaleY(),
+										atOld.getTranslateX() + distX,
+										atOld.getTranslateY() + distY);
+			lyr.setAffineTransform(atNew);
+
+			grBehavior.getMapControl().getMapContext().invalidate();
+			isMoveable = false;
+			super.mouseReleased(e);
+		}
+
+	}
+
+	/**
+	 * <P>
+	 * Funci�n de pintado del canvas. Pintamos un marco a la imagen para saber
+	 * donde la movemos.
+	 * </P>
+	 * <P>
+	 * Para dibujar el marco alrededor del raster hacemos lo mismo que para pintar el raster
+	 * rotado. En realidad dibujamos un cuadrado y luego le aplicamos las transformaciones necesarias
+	 * para que se vea con la misma forma del raster al que representa.
+	 * </P>
+	 */
+	public void paintComponent(MapControlDrawer mapControlDrawer) {
+		if (isMoveable && lyr != null && ptoFin != null && ptoIni != null) {
+			try {
+				ViewPort vp = grBehavior.getMapControl().getMapContext().getViewPort();
+				AffineTransform at = (AffineTransform)lyr.getAffineTransform().clone();
+				at.preConcatenate(vp.getAffineTransform());
+				Extent ext = lyr.getFullRasterExtent();
+
+				Point2D pt = new Point2D.Double(ext.getULX(), ext.getULY());
+				vp.getAffineTransform().transform(pt, pt);
+				at.inverseTransform(pt, pt);
+
+				Point2D size = new Point2D.Double(ext.getLRX(), ext.getLRY());
+				vp.getAffineTransform().transform(size, size);
+				at.inverseTransform(size, size);
+
+				double distX = ptoFin.getX() - ptoIni.getX();
+				double distY = ptoFin.getY() - ptoIni.getY();
+				Point2D d = new Point2D.Double(ext.getULX() + distX, ext.getULY() + distY);
+				vp.getAffineTransform().transform(d, d);
+				at.inverseTransform(d, d);
+
+				//Giramos el graphics se dibuja y se vuelve a dejar como estaba
+				mapControlDrawer.transform(at);
+				mapControlDrawer.setColor(rectangleColor);
+				AlphaComposite alpha = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.1f);
+				mapControlDrawer.setComposite(alpha);
+				mapControlDrawer.fillRect((int)pt.getX() + (int)d.getX(), (int)pt.getY() + (int)d.getY(), (int)size.getX(), (int)size.getY());
+				mapControlDrawer.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f));
+				mapControlDrawer.drawRect((int)pt.getX() + (int)d.getX(), (int)pt.getY() + (int)d.getY(), (int)size.getX(), (int)size.getY());
+				mapControlDrawer.transform(at.createInverse());
+			} catch (NoninvertibleTransformException e1) {
+				RasterSwingLibrary.messageBoxError("error_transformacion1", this, e1);
+			}
+		}
+	}
+
+	/**
+	 * Esta funci�n repinta el canvas si se est� arrasrtando la imagen para
+	 * poder ver el marco de arrastre.
+	 */
+	public void mouseDragged(MouseEvent e) throws BehaviorException {
+		if (!isActiveTool())
+			return;
+		if (isMoveable) {
+			ViewPort vp = grBehavior.getMapControl().getMapContext().getViewPort();
+			ptoFin = vp.toMapPoint(e.getPoint());
+
+			//Asignaci�n de las coordenadas temporales al dialogo
+			assignTransformToDialog();
+
+			grBehavior.getMapControl().repaint();
+		}
+	}
+
+	/**
+	 * Asigna las coordenadas temporales en el dialogo.
+	 */
+	public void assignTransformToDialog() {
+		AffineTransform atNew = null;
+		double distX = ptoFin.getX() - ptoIni.getX();
+		double distY = ptoFin.getY() - ptoIni.getY();
+		AffineTransform atOld = grBehavior.getLayer().getAffineTransform();
+		//La nueva matriz de transformaci�n es la vieja m�s la distancia desplazada
+		atNew = new AffineTransform(atOld.getScaleX(), atOld.getShearY(),
+									atOld.getShearX(), atOld.getScaleY(),
+									atOld.getTranslateX() + distX,
+									atOld.getTranslateY() + distY);
+		trIO.loadTransform(atNew);
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#getListener()
+	 */
+	public ToolListener getListener() {
+		return null;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/TranslateBehavior.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/RotationBehavior.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/RotationBehavior.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/RotationBehavior.java	(revision 8183)
@@ -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.tools.app.basic.tool.geolocation.behavior;
+
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Image;
+import java.awt.event.MouseEvent;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+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.Listeners.RectangleListener;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+
+
+/**
+ * Comportamiento que se aplica a la herramienta de rotation. El cursor del rat�n cambiar� cuando
+ * se encuentre en las esquinas y en la zona exterior al raster, permitiendo el rotar la imagen al pinchar y
+ * arrastrar.
+ *
+ * Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+@SuppressWarnings("deprecation")
+public class RotationBehavior extends TransformationBehavior {
+	//N�mero de pixeles de ancho del borde donde el cursor se activar�. Son pixeles del canvas de la vista.
+	//De esta forma da igual la escala a la que est� la imagen siempre tiene la misma precisi�n
+	private int 							PX_SELEC_BASE     = 12;
+	private int 							LONG_CORNER_BASE  = 18;
+	private int 							PX_SELEC          = PX_SELEC_BASE;
+	private int 							LONG_CORNER       = LONG_CORNER_BASE;
+
+	private Color							rectangleColor    = Color.RED;
+
+	private RectangleListener               listener;
+	private Image                           rotImg            = IconThemeHelper.getImage("rotate-cursor");
+		
+	/**
+	 * Puntos de inicio y final para el arrastre de la imagen.
+	 */
+	private Point2D 						beforePoint       = null;
+	private Point2D 						nextPoint         = null;
+
+	/**
+	 * Variable que si est� a true permite que se pinte el marco de la imagen. Se activa al
+	 * comenzar el redimensionado y se desactiva al terminar
+	 */
+	private boolean 						isRotable        = false;
+	private AffineTransform                 boxRot           = null;
+	/**
+	 * Valor de la rotaci�n.
+	 */
+	private double                          rotation         = 0;
+
+	/**
+	 * Lista de flags de redimensionado para cada lado del raster
+	 * [0]-esquina superior derecha
+	 * [1]-esquina superior izquierda
+	 * [2]-esquina inferior derecha
+	 * [3]-esquina inferior izquierda
+	 */
+	private boolean[]						cornerActive    = {false, false, false, false};
+	private boolean 						init            = false;
+	/**
+	 * Indica cual ser� la velocidad de rotaci�n
+	 */
+	private double							incrRot         = 0.005;
+
+	/**
+	 * Crea un nuevo RectangleBehavior.
+	 *
+	 * @param zili listener.
+	 */
+	public RotationBehavior(GeoRasterBehavior grb, Image curImage, ITransformIO windowIO) {
+		grBehavior = grb;
+		defaultImage = curImage;
+		this.trIO = windowIO;
+	}
+
+	/**
+	 * Inicializaci�n. Calcula la longitud de la esquina y el ancho en p�xeles
+	 * de la zona de detecci�n del puntero de rat�n. Inicialmente esto est� calculado en
+	 * unidades pixel de la vista pero la detecci�n de puntero, debido a la rotaci�n posible
+	 * del raster ha de hacerse en unidades del raster en disco por ello ha de calcularse
+	 * una escala entre ambas unidades cuando se carga la aplicaci�n.
+	 *
+	 */
+	private void init() {
+		ViewPort vp = grBehavior.getMapControl().getMapContext().getViewPort();
+		lyr = grBehavior.getLayer();
+		if(lyr == null)
+			return ;
+
+		Extent ext = lyr.getDataStore().getExtent();
+		AffineTransform atImg = lyr.getDataStore().getAffineTransform();
+
+		//Establecer una escala entre las coordenadas de la vista y las coordenadas pixel
+		Point2D ul = new Point2D.Double(ext.getULX(), ext.getULY());
+		Point2D lr = new Point2D.Double(ext.getLRX(), ext.getLRY());
+		Point2D ulPx = new Point2D.Double();
+		Point2D lrPx = new Point2D.Double();
+		Point2D ulVp = new Point2D.Double();
+		Point2D lrVp = new Point2D.Double();
+		double esc = 1;
+		try {
+			atImg.inverseTransform(ul, ulPx);
+			atImg.inverseTransform(lr, lrPx);
+			ulVp = vp.fromMapPoint(ul);
+			lrVp = vp.fromMapPoint(lr);
+			esc = Math.abs(lrPx.getX() - ulPx.getX()) / Math.abs(lrVp.getX() - ulVp.getX());
+		} catch (NoninvertibleTransformException e1) {
+			return;
+		}
+
+		//Escalar PX_SELEC y LONG_CORNER para tenerlo en coordenadas pixel
+
+		PX_SELEC = (int)(PX_SELEC_BASE * esc);
+		LONG_CORNER = (int)(LONG_CORNER_BASE * esc);
+		
+		init = true;
+	}
+
+	/**
+	 * Cuando se produce un evento de pintado dibujamos el marco de la imagen para
+	 * que el usuario pueda seleccionar y redimensionar.
+	 */
+	public void paintComponent(MapControlDrawer mapcontrolDrawer) {
+		if(lyr == null)
+			lyr = grBehavior.getLayer();
+
+		if(isRotable && lyr != null) {
+			try {
+				ViewPort vp = grBehavior.getMapControl().getMapContext().getViewPort();
+				AffineTransform at = new AffineTransform(lyr.getAffineTransform());
+				Extent ext = lyr.getFullRasterExtent();
+				Point2D center = new Point2D.Double(lyr.getDataStore().getWidth() / 2, lyr.getDataStore().getHeight()/ 2);
+				at.transform(center, center);
+
+				Point2D ul = new Point2D.Double(ext.getULX(), ext.getULY());
+				Point2D lr = new Point2D.Double(ext.getLRX(), ext.getLRY());
+
+				AffineTransform T1 = new AffineTransform(1, 0, 0, 1, -center.getX(), -center.getY());
+				AffineTransform R1 = new AffineTransform();
+				R1.setToRotation(rotation);
+				AffineTransform T2 = new AffineTransform(1, 0, 0, 1, center.getX(), center.getY());
+				T2.concatenate(R1);
+				T2.concatenate(T1);
+
+				T2.transform(ul, ul);
+				T2.transform(lr, lr);
+
+				at.preConcatenate(T2);
+				boxRot = new AffineTransform(at);
+				at.preConcatenate(vp.getAffineTransform());
+
+				vp.getAffineTransform().transform(ul, ul);
+				at.inverseTransform(ul, ul);
+
+				vp.getAffineTransform().transform(lr, lr);
+				at.inverseTransform(lr, lr);
+
+				mapcontrolDrawer.transform(at);
+				mapcontrolDrawer.setColor(rectangleColor);
+				mapcontrolDrawer.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.1f));
+				mapcontrolDrawer.fillRect((int)ul.getX(), (int)ul.getY(), (int)lr.getX(), (int)lr.getY());
+				mapcontrolDrawer.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f));
+				mapcontrolDrawer.drawRect((int)ul.getX(), (int)ul.getY(), (int)lr.getX(), (int)lr.getY());
+				mapcontrolDrawer.transform(at.createInverse());
+			} catch (NoninvertibleTransformException e1) {
+				RasterSwingLibrary.messageBoxError("error_transformacion1", this, e1);
+			}
+		}
+	}
+
+	/**
+	 * Reimplementaci�n del m�todo mousePressed de Behavior. Si no est�
+	 * activo el cursor por defecto capturamos el punto seleccionado en
+	 * coordenadas del mundo real.
+	 *
+	 * @param e MouseEvent
+	 */
+	public void mousePressed(MouseEvent e) {
+		if (e.getButton() == MouseEvent.BUTTON1) {
+			ViewPort vp = grBehavior.getMapControl().getMapContext().getViewPort();
+			beforePoint = vp.toMapPoint(e.getPoint());
+			if(lyr == null)
+				lyr = grBehavior.getLayer();
+			isRotable = true;
+		}
+	}
+
+	/**
+	 * Reimplementaci�n del m�todo mouseReleased de Behavior. Desactivamos
+	 * los flags de redimensionado y a partir de la selecci�n del usuario
+	 * creamos un nuevo extent para la imagen. Con este extent creamos una nueva
+	 * capa que sustituir� a la anterior.
+	 *
+	 * @param e MouseEvent
+	 *
+	 * @throws BehaviorException Excepci�n lanzada cuando el Behavior.
+	 */
+	public void mouseReleased(MouseEvent e) throws BehaviorException {
+		if(e.getButton() == MouseEvent.BUTTON1) {
+			if(boxRot != null)
+				lyr.setAffineTransform(boxRot);
+			rotation = 0;
+			grBehavior.getMapControl().getMapContext().invalidate();
+			isRotable = false;
+			super.mouseReleased(e);
+		}
+	}
+
+	/**
+	 * Cuando arrastramos con el rat�n pulsado significa que estamos rotando la imagen. Para realizar la rotaci�n
+	 * medimos la distancia al punto inicial (desde el pto que estamos al pto donde se picho la primera vez). Esta distancia
+	 * nos da la velocidad de giro ya que si es grande es que lo habremos movido deprisa y si es peque�a habremos arrastrado
+	 * el rat�n despacio. Creamos una matriz de transformaci�n con la identidad y la rotaci�n que hemos medido aplicada. Al
+	 * final repintamos para que se pueda usar esta rotaci�n calculada en el repintado.
+	 */
+	public void mouseDragged(MouseEvent e) {
+		ViewPort vp = grBehavior.getMapControl().getMapContext().getViewPort();
+		nextPoint = vp.toMapPoint(e.getPoint());
+
+		//Para la esquinas derechas cuando subimos el puntero giramos a izquierdas
+		//Para la esquinas izquierdas cuando subimos el puntero giramos a derechas
+		if( ((cornerActive[0] || cornerActive[2]) && (beforePoint.getY() < nextPoint.getY())) ||
+			((cornerActive[1] || cornerActive[3]) && (beforePoint.getY() >= nextPoint.getY())))
+			rotation += incrRot;
+		else
+			rotation -= incrRot;
+
+		beforePoint = vp.toMapPoint(e.getPoint());
+		if(boxRot != null)
+			trIO.loadTransform(boxRot);
+		grBehavior.getMapControl().repaint();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#setListener(org.gvsig.georeferencing.fmap.tools.ToolListener)
+	 */
+	public void setListener(ToolListener listener) {
+		this.listener = (RectangleListener) listener;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#getListener()
+	 */
+	public ToolListener getListener() {
+		return listener;
+	}
+
+	/**
+	 * Cuando movemos el rat�n detecta si estamos en el marco de la
+	 * imagen y pone el icono del cursor del rat�n adecuado.
+	 */
+	public boolean mouseMoved(MouseEvent ev) throws BehaviorException {
+		if(!init)
+			init();
+
+		ViewPort vp = grBehavior.getMapControl().getMapContext().getViewPort();
+		resetBorderSelected();
+
+		lyr = grBehavior.getLayer();
+		if(lyr == null) {
+			setActiveTool(false);
+			return false;
+		}
+
+		AffineTransform atImg = lyr.getAffineTransform();
+
+		//Pasar coordenadas del punto a coordenadas reales y luego a coordenadas pixel
+		Point2D e = vp.toMapPoint(ev.getX(), ev.getY());
+		try {
+			atImg.inverseTransform(e, e);
+		} catch (NoninvertibleTransformException e1) {
+			return false;
+		}
+
+		//Comprobar si est� dentro del raster
+		Point2D p1 = new Point2D.Double(0, 0);
+		Point2D p2 = new Point2D.Double(lyr.getDataStore().getWidth(), lyr.getDataStore().getHeight());
+
+		//esquina superior izquierda
+		if ((e.getX() > (p1.getX() - PX_SELEC) && e.getX() <= (p1.getX() + LONG_CORNER) && e.getY() <= p1.getY() && e.getY() > (p1.getY() - PX_SELEC)) ||
+			(e.getX() <= p1.getX() && e.getX() > (p1.getX() - PX_SELEC) && e.getY() > p1.getY() && e.getY() <= (p1.getY() + LONG_CORNER))) {
+			grBehavior.setCursorImage(rotImg);
+			setActiveTool(true);
+			cornerActive[1] = true;
+			return true;
+		}
+
+		//esquina superior derecha
+		if ((e.getX() >= (p2.getX() - LONG_CORNER) && e.getX() < (p2.getX() + PX_SELEC) && e.getY() <= p1.getY() && e.getY() > (p1.getY() - PX_SELEC)) ||
+			(e.getX() >= p2.getX() && e.getX() < (p2.getX() + PX_SELEC) && e.getY() > p1.getY() && e.getY() <= (p1.getY() + LONG_CORNER))) {
+			grBehavior.setCursorImage(rotImg);
+			setActiveTool(true);
+			cornerActive[0] = true;
+			return true;
+		}
+
+		//esquina inferior izquierda
+		if ((e.getX() > (p1.getX() - PX_SELEC) && e.getX() <= (p1.getX() + LONG_CORNER) && e.getY() >= p2.getY() && e.getY() < (p2.getY() + PX_SELEC)) ||
+			(e.getX() <= p1.getX() && e.getX() > (p1.getX() - PX_SELEC) && e.getY() < p2.getY() && e.getY() >= (p2.getY() - LONG_CORNER))) {
+			grBehavior.setCursorImage(rotImg);
+			setActiveTool(true);
+			cornerActive[3] = true;
+			return true;
+		}
+
+		//esquina inferior derecha
+		if ((e.getX() < (p2.getX() + PX_SELEC) && e.getX() >= (p2.getX() - LONG_CORNER) && e.getY() >= p2.getY() && e.getY() < (p2.getY() + PX_SELEC)) ||
+			(e.getX() >= p2.getX() && e.getX() <= (p2.getX() + PX_SELEC) && e.getY() < p2.getY() && e.getY() >= (p2.getY() - LONG_CORNER))){
+			grBehavior.setCursorImage(rotImg);
+			setActiveTool(true);
+			cornerActive[2] = true;
+			return true;
+		}
+
+		grBehavior.resetDefaultCursor();
+		grBehavior.getMapControl().repaint();
+		return false;
+	}
+
+	/**
+	 * Pone a false todos los elementos del array sideActive. Esto es equivalente
+	 * a eliminar cualquier selecci�n de borde.
+	 */
+	private void resetBorderSelected() {
+		for (int i = 0; i < cornerActive.length; i++)
+			cornerActive[i] = false;
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/RotationBehavior.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/ShearBehavior.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/ShearBehavior.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/ShearBehavior.java	(revision 8183)
@@ -0,0 +1,361 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.geolocation.behavior;
+
+import java.awt.AlphaComposite;
+import java.awt.Image;
+import java.awt.event.MouseEvent;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+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.Listeners.RectangleListener;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+
+
+/**
+ * Comportamiento que se aplica a la herramienta de shear. El cursor del rat�n cambiar� cuando
+ * se encuentre en la zona exterior al raster, permitiendo el deformar la imagen al pinchar y
+ * arrastrar en los ejes X e Y.
+ *
+ * Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+@SuppressWarnings("deprecation")
+public class ShearBehavior extends TransformationBehavior {
+	//N�mero de pixeles de ancho del borde donde el cursor se activar�. Son pixeles del canvas de la vista.
+	//De esta forma da igual la escala a la que est� la imagen siempre tiene la misma precisi�n
+	private int 							PX_SELEC_BASE = 12;
+	private int 							PX_SELEC = PX_SELEC_BASE;
+
+	private RectangleListener               listener;
+
+	private final Image                     shearXImg = IconThemeHelper.getImage("shear-x-cursor");
+	private final Image                     shearYImg = IconThemeHelper.getImage("shear-y-cursor");
+	
+	/**
+	 * Puntos de inicio y final para el arrastre de la imagen.
+	 */
+	private Point2D 						beforePoint = null;
+	private Point2D 						nextPoint = null;
+
+	private AffineTransform                 boxShear = null;
+
+	/**
+	 * Lista de flags de redimensionado para cada lado del raster
+	 * [0]-esquina superior derecha
+	 * [1]-esquina superior izquierda
+	 * [2]-esquina inferior derecha
+	 * [3]-esquina inferior izquierda
+	 */
+	private boolean[]						cornerActive = {false, false, false, false};
+	private boolean 						init = false;
+	/**
+	 * Controla si se ha activado el shear o no
+	 */
+	private boolean                         isShearing = false;
+	/**
+	 * Contiene el valor del incremento
+	 */
+	private double							incrShear = 0.01;
+	/**
+	 * Control del valor del shearing en X
+	 */
+	private double                          shearX = 0;
+	/**
+	 * Control del valor del shearing en Y
+	 */
+	private double                          shearY = 0;
+
+
+	/**
+	 * Crea un nuevo RectangleBehavior.
+	 *
+	 * @param zili listener.
+	 */
+	public ShearBehavior(GeoRasterBehavior grb, Image curImage, ITransformIO windowIO) {
+		grBehavior = grb;
+		defaultImage = curImage;
+		this.trIO = windowIO;
+	}
+
+	/**
+	 * Inicializaci�n. Calcula la longitud de la esquina y el ancho en p�xeles
+	 * de la zona de detecci�n del puntero de rat�n. Inicialmente esto est� calculado en
+	 * unidades pixel de la vista pero la detecci�n de puntero, debido a la rotaci�n posible
+	 * del raster ha de hacerse en unidades del raster en disco por ello ha de calcularse
+	 * una escala entre ambas unidades cuando se carga la aplicaci�n.
+	 *
+	 */
+	private void init() {
+		ViewPort vp = grBehavior.getMapControl().getMapContext().getViewPort();
+		lyr = grBehavior.getLayer();
+		if(lyr == null)
+			return ;
+
+		Extent ext = lyr.getDataStore().getExtent();
+		AffineTransform atImg = lyr.getAffineTransform();
+
+		//Establecer una escala entre las coordenadas de la vista y las coordenadas pixel
+		Point2D ul = new Point2D.Double(ext.getULX(), ext.getULY());
+		Point2D lr = new Point2D.Double(ext.getLRX(), ext.getLRY());
+		Point2D ulPx = new Point2D.Double();
+		Point2D lrPx = new Point2D.Double();
+		Point2D ulVp = new Point2D.Double();
+		Point2D lrVp = new Point2D.Double();
+		double esc = 1;
+		try {
+			atImg.inverseTransform(ul, ulPx);
+			atImg.inverseTransform(lr, lrPx);
+			ulVp = vp.fromMapPoint(ul);
+			lrVp = vp.fromMapPoint(lr);
+			esc = Math.abs(lrPx.getX() - ulPx.getX()) / Math.abs(lrVp.getX() - ulVp.getX());
+		} catch (NoninvertibleTransformException e1) {
+			RasterSwingLibrary.messageBoxError("error_transformacion1", this, e1);
+			return;
+		}
+
+		//Escalar PX_SELEC y LONG_CORNER para tenerlo en coordenadas pixel
+
+		PX_SELEC = (int)(PX_SELEC_BASE * esc);
+		init = true;
+	}
+
+	/**
+	 * Cuando se produce un evento de pintado dibujamos el marco de la imagen para
+	 * que el usuario pueda seleccionar y redimensionar.
+	 */
+	public void paintComponent(MapControlDrawer mapControlDrawer) {
+		if(lyr == null)
+			lyr = grBehavior.getLayer();
+
+		if(isShearing && lyr != null) {
+			try {
+				ViewPort vp = grBehavior.getMapControl().getMapContext().getViewPort();
+				AffineTransform at = new AffineTransform(lyr.getAffineTransform());
+				Extent ext = lyr.getFullRasterExtent();
+				Point2D center = new Point2D.Double(lyr.getDataStore().getWidth() / 2, lyr.getDataStore().getHeight()/ 2);
+				at.transform(center, center);
+
+				Point2D ul = new Point2D.Double(ext.getULX(), ext.getULY());
+				Point2D lr = new Point2D.Double(ext.getLRX(), ext.getLRY());
+
+				AffineTransform T1 = new AffineTransform(1, 0, 0, 1, -center.getX(), -center.getY());
+				AffineTransform R1 = new AffineTransform();
+				R1.setToShear(shearX, shearY);
+				AffineTransform T2 = new AffineTransform(1, 0, 0, 1, center.getX(), center.getY());
+				T2.concatenate(R1);
+				T2.concatenate(T1);
+
+				T2.transform(ul, ul);
+				T2.transform(lr, lr);
+
+				at.preConcatenate(T2);
+				boxShear = new AffineTransform(at);
+				at.preConcatenate(vp.getAffineTransform());
+
+				vp.getAffineTransform().transform(ul, ul);
+				at.inverseTransform(ul, ul);
+
+				vp.getAffineTransform().transform(lr, lr);
+				at.inverseTransform(lr, lr);
+
+				mapControlDrawer.transform(at);
+				mapControlDrawer.setColor(rectangleColor);
+				mapControlDrawer.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.1f));
+				mapControlDrawer.fillRect((int)ul.getX(), (int)ul.getY(), (int)lr.getX(), (int)lr.getY());
+				mapControlDrawer.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f));
+				mapControlDrawer.drawRect((int)ul.getX(), (int)ul.getY(), (int)lr.getX(), (int)lr.getY());
+				mapControlDrawer.transform(at.createInverse());
+			} catch (NoninvertibleTransformException e1) {
+				RasterSwingLibrary.messageBoxError("error_transformacion1", this, e1);
+			}
+		}
+	}
+
+	/**
+	 * Reimplementaci�n del m�todo mousePressed de Behavior. Si no est�
+	 * activo el cursor por defecto capturamos el punto seleccionado en
+	 * coordenadas del mundo real.
+	 *
+	 * @param e MouseEvent
+	 */
+	public void mousePressed(MouseEvent e) {
+		if (e.getButton() == MouseEvent.BUTTON1) {
+			ViewPort vp = grBehavior.getMapControl().getMapContext().getViewPort();
+			beforePoint = vp.toMapPoint(e.getPoint());
+			if(lyr == null)
+				lyr = grBehavior.getLayer();
+			isShearing = true;
+		}
+	}
+
+	/**
+	 * Reimplementaci�n del m�todo mouseReleased de Behavior. Desactivamos
+	 * los flags de redimensionado y a partir de la selecci�n del usuario
+	 * creamos un nuevo extent para la imagen. Con este extent creamos una nueva
+	 * capa que sustituir� a la anterior.
+	 *
+	 * @param e MouseEvent
+	 *
+	 * @throws BehaviorException Excepci�n lanzada cuando el Behavior.
+	 */
+	public void mouseReleased(MouseEvent e) throws BehaviorException {
+		if(e.getButton() == MouseEvent.BUTTON1) {
+			lyr.setAffineTransform(boxShear);
+			shearX = shearY = 0;
+			grBehavior.getMapControl().getMapContext().invalidate();
+			isShearing = false;
+			super.mouseReleased(e);
+		}
+	}
+
+	/**
+	 * Cuando arrastramos con el rat�n pulsado significa que estamos rotando la imagen. Para realizar la rotaci�n
+	 * medimos la distancia al punto inicial (desde el pto que estamos al pto donde se picho la primera vez). Esta distancia
+	 * nos da la velocidad de giro ya que si es grande es que lo habremos movido deprisa y si es peque�a habremos arrastrado
+	 * el rat�n despacio. Creamos una matriz de transformaci�n con la identidad y la rotaci�n que hemos medido aplicada. Al
+	 * final repintamos para que se pueda usar esta rotaci�n calculada en el repintado.
+	 */
+	public void mouseDragged(MouseEvent e) {
+		ViewPort vp = grBehavior.getMapControl().getMapContext().getViewPort();
+		nextPoint = vp.toMapPoint(e.getPoint());
+
+		if( (cornerActive[0] && (beforePoint.getY() >= nextPoint.getY())) ||
+			(cornerActive[1] && (beforePoint.getY() < nextPoint.getY())) )
+			shearY += incrShear;
+		if( (cornerActive[0] && (beforePoint.getY() < nextPoint.getY())) ||
+			(cornerActive[1] && (beforePoint.getY() >= nextPoint.getY())) )
+				shearY -= incrShear;
+		if( (cornerActive[2] && (beforePoint.getX() >= nextPoint.getX())) ||
+			(cornerActive[3] && (beforePoint.getX() < nextPoint.getX())) )
+				shearX += incrShear;
+		if( (cornerActive[2] && (beforePoint.getX() < nextPoint.getX())) ||
+			(cornerActive[3] && (beforePoint.getX() >= nextPoint.getX())) )
+				shearX -= incrShear;
+
+		beforePoint = vp.toMapPoint(e.getPoint());
+		if(boxShear != null)
+			trIO.loadTransform(boxShear);
+		grBehavior.getMapControl().repaint();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#setListener(org.gvsig.georeferencing.fmap.tools.ToolListener)
+	 */
+	public void setListener(ToolListener listener) {
+		this.listener = (RectangleListener) listener;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#getListener()
+	 */
+	public ToolListener getListener() {
+		return listener;
+	}
+
+	/**
+	 * Cuando movemos el rat�n detecta si estamos en el marco de la
+	 * imagen y pone el icono del cursor del rat�n adecuado.
+	 */
+	public boolean mouseMoved(MouseEvent ev) throws BehaviorException {
+		if(!init)
+			init();
+
+		ViewPort vp = grBehavior.getMapControl().getMapContext().getViewPort();
+		resetBorderSelected();
+
+		lyr = grBehavior.getLayer();
+		if(lyr == null) {
+			setActiveTool(false);
+			return false;
+		}
+
+		AffineTransform atImg = lyr.getAffineTransform();
+
+		//Pasar coordenadas del punto a coordenadas reales y luego a coordenadas pixel
+		Point2D e = vp.toMapPoint(ev.getX(), ev.getY());
+		try {
+			atImg.inverseTransform(e, e);
+		} catch (NoninvertibleTransformException e1) {
+			return false;
+		}
+
+		//Comprobar si est� dentro del raster
+		Point2D p1 = new Point2D.Double(0, 0);
+		Point2D p2 = new Point2D.Double(lyr.getDataStore().getWidth(), lyr.getDataStore().getHeight());
+
+		//System.out.println("--->" + e.getX() + " , " + e.getY());
+
+		//lateral derecho
+		if (e.getY() > p1.getY() && e.getY() < p2.getY() && e.getX() > p2.getX() && e.getX() < (p2.getX() + PX_SELEC)) {
+			grBehavior.setCursorImage(shearYImg);
+			setActiveTool(true);
+			cornerActive[1] = true;
+			return true;
+		}
+
+		//lateral izquierdo
+		if (e.getY() > p1.getY() && e.getY() < p2.getY() && e.getX() < p1.getX() && e.getX() > (p1.getX() - PX_SELEC)) {
+			grBehavior.setCursorImage(shearYImg);
+			setActiveTool(true);
+			cornerActive[0] = true;
+			return true;
+		}
+
+		//lateral superior
+		if (e.getX() > p1.getX() && e.getX() < p2.getX() && e.getY() < p1.getY() && e.getY() > (p1.getX() - PX_SELEC)) {
+			grBehavior.setCursorImage(shearXImg);
+			setActiveTool(true);
+			cornerActive[3] = true;
+			return true;
+		}
+
+		//lateral inferior
+		if (e.getX() > p1.getX() && e.getX() < p2.getX() && e.getY() > p2.getY() && e.getY() < (p2.getY() + PX_SELEC)) {
+			grBehavior.setCursorImage(shearXImg);
+			setActiveTool(true);
+			cornerActive[2] = true;
+			return true;
+		}
+
+		grBehavior.resetDefaultCursor();
+		grBehavior.getMapControl().repaint();
+		return false;
+	}
+
+	/**
+	 * Pone a false todos los elementos del array sideActive. Esto es equivalente
+	 * a eliminar cualquier selecci�n de borde.
+	 */
+	private void resetBorderSelected() {
+		for (int i = 0; i < cornerActive.length; i++)
+			cornerActive[i] = false;
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior/ShearBehavior.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/behavior
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/GeoLocationTocMenuEntry.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/GeoLocationTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/GeoLocationTocMenuEntry.java	(revision 8183)
@@ -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.tools.app.basic.tool.geolocation;
+
+import java.awt.Point;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import javax.swing.Icon;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.app.project.documents.view.gui.IView;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.app.project.documents.view.toolListeners.StatusBarListener;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseMovementBehavior;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.layers.ILayerState;
+import org.gvsig.raster.fmap.layers.IRasterLayerActions;
+import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.tool.geolocation.behavior.GeoRasterBehavior;
+import org.gvsig.raster.tools.app.basic.tool.geolocation.listener.GeorefPanListener;
+import org.gvsig.raster.tools.app.basic.tool.geolocation.ui.GeoLocationDialog;
+
+
+/**
+ * Herramienta del men� contextual que carga el raster en el localizador para tener una visi�n general de
+ * esta y carga el zoom del cursor para tener una selecci�n de precisi�n.
+ *
+ * 16-jun-2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class GeoLocationTocMenuEntry extends AbstractTocContextMenuAction implements PropertyChangeListener, IGenericToolBarMenuItem {
+	static private GeoLocationTocMenuEntry singleton  = null;
+	private GeoRasterBehavior mb = null;
+
+	/**
+	 * Nadie puede crear una instancia a esta clase �nica, hay que usar el
+	 * getSingleton()
+	 */
+	private GeoLocationTocMenuEntry() {}
+
+	/**
+	 * Devuelve un objeto unico a dicha clase
+	 * @return
+	 */
+	static public GeoLocationTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new GeoLocationTocMenuEntry();
+		return singleton;
+	}
+	
+	public String getGroup() {
+		return "GeoRaster";
+	}
+
+	public int getGroupOrder() {
+		return 10;
+	}
+
+	public int getOrder() {
+		return 20;
+	}
+
+	public String getText() {
+		return RasterToolsUtil.getText(this, "geolocation");
+	}
+	
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof ILayerState))
+			return false;
+
+		if (!((ILayerState) selectedItems[0]).isOpen())
+			return false;
+		return true;
+	}
+
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof IRasterLayerActions))
+			return false;
+
+		return ((IRasterLayerActions) selectedItems[0]).isActionEnabled(IRasterLayerActions.GEOLOCATION);
+	}
+
+	public void execute(ITocItem item, FLayer[] selectedItems) {		
+		boolean isOpen = false;
+		
+		AbstractViewPanel theView = (AbstractViewPanel) PluginServices.getMDIManager().getActiveWindow();
+		MapControl mapCtrl = theView.getMapControl();
+
+		// Listener de eventos de movimiento que pone las coordenadas del rat�n en
+		// la barra de estado
+		StatusBarListener sbl = new StatusBarListener(mapCtrl);
+		
+		//Comprobamos si no hay capas activas. En este caso no lanzamos la ventana ni activamos la tool
+		
+		IWindow activeView = PluginServices.getMDIManager().getActiveWindow();
+		if (activeView instanceof IView) {
+			FLayers lyrs = ((IView) activeView).getMapControl().getMapContext().getLayers();
+			FLayer[] actives = lyrs.getActives();
+			if (actives == null || actives.length == 0)
+				return;
+		}
+		if (activeView instanceof GeoLocationDialog)
+			isOpen = true;
+
+		if (selectedItems == null || selectedItems.length != 1 || !(selectedItems[0] instanceof FLyrRaster))
+			return;
+		
+		FLyrRaster lyr = (FLyrRaster)selectedItems[0];
+		GeoLocationDialog gld = new GeoLocationDialog(lyr, mapCtrl.getViewPort(), theView);
+		if(!isOpen) {
+			Point posit = RasterToolsUtil.iwindowPosition((int)gld.getSizeWindow().getWidth(), (int)gld.getSizeWindow().getHeight());
+			gld.setPosition((int)posit.getX(), (int)posit.getY());
+			RasterToolsUtil.addWindow(gld);
+		}
+		
+		gld.init(mapCtrl);
+		loadGeoPanListener(mapCtrl, sbl, gld, lyr);
+		mapCtrl.setTool("geoPan");
+	}
+
+	/**
+	 * Carga el listener de selecci�n de raster en el MapControl.
+	 */
+	private void loadGeoPanListener(MapControl mapCtrl, StatusBarListener sbl, GeoLocationDialog gld, FLyrRaster lyr) {
+		if (mapCtrl.getNamesMapTools().get("geoPan") == null) {
+			GeorefPanListener pl = new GeorefPanListener(mapCtrl);
+			mb = new GeoRasterBehavior(pl, gld, lyr);
+			mapCtrl.addBehavior("geoPan", new Behavior[]{mb, new MouseMovementBehavior(sbl)});
+
+		}
+		
+		if(mb != null) {
+			mb.setLayer(lyr);
+			mb.setITransformIO(gld);
+		}
+	}
+	
+	public Icon getIcon() {
+		return RasterToolsUtil.getIcon("layer-geolocalization");
+	}
+
+	public void propertyChange(PropertyChangeEvent evt) {}
+	
+	public boolean isEnableEvents() {
+		return true;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/GeoLocationTocMenuEntry.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/listener/GeorefPanListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/listener/GeorefPanListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/listener/GeorefPanListener.java	(revision 8183)
@@ -0,0 +1,66 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.geolocation.listener;
+
+
+import java.awt.Image;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.Events.MoveEvent;
+import org.gvsig.raster.fmap.layers.GeorefPanListenerImpl;
+
+
+
+/**
+ * Extensi�n de la clase PanListenerImpl de FMap para poder llamar a m�todos de
+ * andami o de gvSIG.
+ * 
+ * @version 12/07/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class GeorefPanListener extends GeorefPanListenerImpl {
+	
+	/**
+	 * Constructor. 
+	 * Asigna el MapControl
+	 * @param mapCtrl
+	 */
+	public GeorefPanListener(MapControl mapCtrl) {
+		super(mapCtrl);
+	}
+
+	public void move(MoveEvent event) {
+		super.move(event);
+		PluginServices.getMainFrame().enableControls();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener#getImageCursor()
+	 */
+	public Image getImageCursor() {
+		return IconThemeHelper.getImage("hand-cursor");
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/listener/GeorefPanListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/listener/GeoLocationPanelListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/listener/GeoLocationPanelListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/listener/GeoLocationPanelListener.java	(revision 8183)
@@ -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.tools.app.basic.tool.geolocation.listener;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
+import java.io.BufferedReader;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.EventObject;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+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.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.util.Historical;
+import org.gvsig.fmap.geom.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.gui.beans.datainput.DataInputContainerListener;
+import org.gvsig.gui.beans.swing.JFileChooser;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.tool.geolocation.ui.GeoLocationDialog;
+import org.gvsig.raster.tools.app.basic.tool.geolocation.ui.GeoLocationOpeningRasterPanel;
+import org.gvsig.raster.tools.app.basic.tool.geolocation.ui.GeoLocationPanel;
+import org.gvsig.raster.tools.app.basic.tool.geolocation.ui.GeolocationBaseClassPanel;
+import org.gvsig.raster.util.ExtendedFileFilter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Listener para el panel de geolocalizaci�n.
+ * @version 31/07/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class GeoLocationPanelListener implements ActionListener, DataInputContainerListener, KeyListener {
+	private static final GeometryManager 	geomManager 			= GeometryLocator.getGeometryManager();
+	private static final Logger 			logger        			= LoggerFactory.getLogger(GeoLocationPanelListener.class);
+	private GeolocationBaseClassPanel		panel 					= null;
+	private boolean                     	enableValueChangeEvent 	= false;
+	private GeoLocationDialog               dialog                  = null;
+	private RasterManager                   rManager                = RasterLocator.getManager();
+
+	/**
+	 * Crea un nuevo <code>GeoLocationPanelListener</code>
+	 * @param panel
+	 */
+	public GeoLocationPanelListener(GeolocationBaseClassPanel panel, GeoLocationDialog dialog) {
+		this.dialog = dialog;
+		this.panel = panel;
+	}
+
+	/**
+	 * M�todo que se invoca cuando se disparan los eventos de los botones
+	 */
+	public void actionPerformed(ActionEvent e) {
+		if(e.getSource() == panel.getSaveButton()) {
+			if(RasterSwingLibrary.messageBoxYesOrNot(Messages.getText("aviso_write_transform"), panel)) {
+				try {
+					panel.getLayer().saveGeoToRmf();
+					panel.activeButtons();
+				} catch (RmfSerializerException e1) {
+					RasterSwingLibrary.messageBoxError(Messages.getText("error_salvando_rmf"), panel, e1);
+				}
+				panel.setModify(false);
+			}
+			return;
+		}
+
+		//Asignamos la georreferenciaci�n que hay en ese momento en el dialogo
+		if(e.getSource() == panel.getApplyButton())
+			try {
+				double ulx = Double.parseDouble(panel.getUlx().getValue());
+				double uly = Double.parseDouble(panel.getUly().getValue());
+				double psx = Double.parseDouble(panel.getPsx().getValue());
+				double psy = Double.parseDouble(panel.getPsy().getValue());
+				double rotx = Double.parseDouble(panel.getRotx().getValue());
+				double roty = Double.parseDouble(panel.getRoty().getValue());
+				if(psx == 0 || psy == 0)
+					return;
+				AffineTransform at = new AffineTransform(psx, roty, rotx, psy, ulx, uly);
+				panel.getLayer().setAffineTransform(at);
+				panel.setModify(true);
+				if(panel.getMapCtrl() != null)
+					panel.getMapCtrl().getMapContext().invalidate();
+				else if(panel instanceof GeoLocationOpeningRasterPanel)
+					PluginServices.getMDIManager().closeWindow(((GeoLocationOpeningRasterPanel)panel).getDialog());
+				panel.activeButtons();
+				return;
+			} catch(NumberFormatException ex) {
+				RasterSwingLibrary.messageBoxError(Messages.getText("error_transformacion"), panel);
+				return;
+			}
+
+		if(e.getSource() == panel.getCancelButton())
+			PluginServices.getMDIManager().closeWindow(((GeoLocationOpeningRasterPanel)panel).getDialog());
+
+		Historical hist = panel.getHistorical();
+		if(hist == null)
+			return;
+
+		AffineTransform at = null;
+
+		//Cargamos la primera transformaci�n
+		if(e.getSource() == panel.getFirstButton())
+			at = (AffineTransform)hist.getFirst();
+
+		//Cargamos la transformaci�n anterior
+		if(e.getSource() == panel.getBackButton())
+			at = (AffineTransform)hist.getBack();
+
+		////Cargamos la transformaci�n siguiente
+		if(e.getSource() == panel.getNextButton())
+			at = (AffineTransform)hist.getNext();
+
+		//Cargamos la georreferenciaci�n del raster
+		if(e.getSource() == panel.getResetButton())
+			at = panel.getLayer().getDataStore().getOwnAffineTransform();
+
+		//Cargar la georreferenciaci�n desde tfw
+		if(e.getSource() == panel.getTfwLoad()) {
+			JFileChooser chooser = new JFileChooser("GEO_LOCATION_PANEL_LISTENER", JFileChooser.getLastPath("GEO_LOCATION_PANEL_LISTENER", null));
+			chooser.setDialogTitle(PluginServices.getText(this, "seleccionar_fichero"));
+			chooser.addChoosableFileFilter(new ExtendedFileFilter("tfw"));
+			chooser.addChoosableFileFilter(new ExtendedFileFilter("wld"));
+
+			ExtendedFileFilter allFilters = new ExtendedFileFilter();
+			allFilters.addExtension("tfw");
+			allFilters.addExtension("wld");
+			allFilters.setDescription(PluginServices.getText(this, "todos_soportados"));
+			chooser.addChoosableFileFilter(allFilters);
+			chooser.setFileFilter(allFilters);
+
+			int returnVal = chooser.showOpenDialog(panel);
+			if (returnVal == JFileChooser.APPROVE_OPTION) {
+				String fName = chooser.getSelectedFile().toString();
+				at = readTfw(fName);
+			}
+			JFileChooser.setLastPath("GEO_LOCATION_PANEL_LISTENER", chooser.getSelectedFile());
+		}
+
+		//Centrar el raster en la vista
+		if(e.getSource() == panel.getCenterToView()) {
+			Extent extentView = calcCenterExtent(panel.getViewPort());
+			double x = extentView.minX();
+			double y = extentView.maxY();
+			double psX = extentView.width() / (panel.getLayer()).getDataStore().getWidth();
+			double psY = -(extentView.height() / (panel.getLayer()).getDataStore().getHeight());
+			at = new AffineTransform(psX, 0, 0, psY, x, y);
+			panel.setModify(true);
+		}
+		
+		//Recuperar el foco
+		if(e.getSource() == panel.getFocus()) {
+			if(dialog != null) {
+				AbstractViewPanel theView = dialog.getAssociateView();
+				MapControl mapCtrl = theView.getMapControl();
+				mapCtrl.setTool("geoPan");
+			}
+		}
+
+		//Entrar� en el caso de que se haya seleccionado alguna transformaci�n
+		if(at != null) {
+			panel.getLayer().setAffineTransformWithoutHistorical(at);
+			panel.loadTransform(at);
+			panel.activeButtons();
+			if(panel.getMapCtrl() != null)
+				panel.getMapCtrl().getMapContext().invalidate();
+		}
+	}
+	
+	/**
+	 * Control del cambio de valor dentro de las cajas de texto. Cuando esto ocurre tiene
+	 * el mismo efecto que el bot�n "Aplicar"
+	 * @param e EventObject
+	 */
+	public void actionValueChanged(EventObject e) {
+		if(isEnableValueChangeEvent() && panel instanceof GeoLocationPanel) {
+			ActionEvent ev = new ActionEvent(panel.getApplyButton(), 0, null);
+			actionPerformed(ev);
+		}
+	}
+
+	/**
+	 * Obtiene el valor de la variable que informa sobre la activaci�n y desactivaci�n del evento de cambio de valor
+	 * dentro de un campo de texto
+	 * @return enableValueChangeEvent
+	 */
+	public boolean isEnableValueChangeEvent() {
+		return enableValueChangeEvent;
+	}
+
+	/**
+	 * Asigna el valor para la activaci�n y desactivaci�n del evento de cambio de valor
+	 * dentro de un campo de texto
+	 * @param enableValueChangeEvent
+	 */
+	public void setEnableValueChangeEvent(boolean enableValueChangeEvent) {
+		this.enableValueChangeEvent = enableValueChangeEvent;
+	}
+
+	/**
+	 * Centra el raster asociado a la capa en al extent del viewport pasado
+	 * por par�metro.
+	 * @param vp ViewPort
+	 * @return	Extent para la imagen
+	 */
+	@SuppressWarnings("deprecation")
+	private Extent calcCenterExtent(ViewPort vp) {
+		Extent tempExtent = null;
+		double widthPxImg, heightPxImg;
+
+		widthPxImg = (panel.getLayer()).getDataStore().getWidth();
+		heightPxImg = (panel.getLayer()).getDataStore().getHeight();
+
+		if(vp == null || vp.getAdjustedExtent() == null) {
+			vp = new ViewPort(null);
+			Envelope r2d;
+			try {
+				r2d = geomManager.createEnvelope(0, 0, widthPxImg,
+						heightPxImg, SUBTYPES.GEOM2D);
+				vp.setEnvelope(r2d);
+			} catch (CreateEnvelopeException e) {
+				logger.error("Error creating the envelope", e);
+			}			
+			tempExtent = rManager.getDataStructFactory().createExtent(0, 0, widthPxImg, heightPxImg);
+		} else{
+			Envelope env=vp.getAdjustedExtent();
+			tempExtent = rManager.getDataStructFactory().createExtent(new Rectangle2D.Double(env.getMinimum(0),env.getMinimum(1),env.getLength(0),env.getLength(1)));
+		}
+
+		double ulX = 0D, ulY = 0D, lrX = 0D, lrY = 0D;
+		if(widthPxImg > heightPxImg) {
+			double widthView = tempExtent.maxX() - tempExtent.minX();
+			ulX = tempExtent.minX() + (widthView / 4);
+			lrX = ulX + (widthView / 2);
+			double newAlto = ((heightPxImg * (widthView / 2)) / widthPxImg);
+			double centroY = tempExtent.minY()+((tempExtent.maxY() - tempExtent.minY())/2);
+			ulY = centroY - (newAlto / 2);
+			lrY = centroY + (newAlto / 2);
+		} else {
+			double heightView = tempExtent.maxY() - tempExtent.minY();
+			ulY = tempExtent.minY() + (heightView / 4);
+			lrY = ulY + (heightView / 2);
+			double newAncho = ((widthPxImg * (heightView / 2)) / heightPxImg);
+			double centroX = tempExtent.minX()+((tempExtent.maxX() - tempExtent.minX())/2);
+			ulX = centroX - (newAncho / 2);
+			lrX = centroX + (newAncho / 2);
+		}
+		return rManager.getDataStructFactory().createExtent(ulX, ulY, lrX, lrY);
+	}
+
+	/**
+	 * Lee las coordenadas de un fichero de tfw con una transformaci�n y
+	 * devuelve la clase AffineTransform con dicha transformaci�n. Esta llamada gestiona los
+	 * errores producidos actuando en consecuencia. Muestra los mensajes al usuario y retorna
+	 * null en caso de tener problemas.
+	 * @param fName Nombre del fichero tfw
+	 * @return AffineTransform
+	 */
+	private AffineTransform readTfw(String fName) {
+		BufferedReader inGrf = null;
+		double[] result = new double[6];
+		try {
+			inGrf = new BufferedReader(new InputStreamReader(new FileInputStream(fName)));
+			String str = inGrf.readLine();
+			int count = 0;
+			while(str != null && count < 6) {
+				try {
+					Double value =  new Double(str);
+					result[count] = value.doubleValue();
+				} catch (NumberFormatException ex) {
+					RasterSwingLibrary.messageBoxError(Messages.getText("error_file_not_valid"), panel, ex);
+					inGrf.close();
+					return null;
+				}
+				str = inGrf.readLine();
+				count ++;
+			}
+			inGrf.close();
+		} catch (FileNotFoundException e) {
+			RasterSwingLibrary.messageBoxError(Messages.getText("error_file_not_found"), panel, e);
+			return null;
+		} catch (IOException ex) {
+			RasterSwingLibrary.messageBoxError(Messages.getText("error_lectura"), panel, ex);
+			return null;
+		}
+		return new AffineTransform(result[0], result[1], result[2], result[3], result[4], result[5]);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.KeyListener#keyPressed(java.awt.event.KeyEvent)
+	 */
+	public void keyPressed(KeyEvent e) {
+
+	}
+
+	/**
+	 * Capturamos el evento de pulsar la tecla Enter y cancel. Cuando pulsamos enter
+	 * ejecuta el evento del bot�n de aplicar y cuando pulsamos cancel cerramos el cuadro
+	 * y no hacemos nada.
+	 */
+	public void keyReleased(KeyEvent e) {
+		if(e.getKeyCode() == KeyEvent.VK_ENTER) {
+			ActionEvent ev = new ActionEvent(panel.getApplyButton(), 0, null);
+			actionPerformed(ev);
+		}
+
+		if(e.getKeyCode() == KeyEvent.VK_ESCAPE && panel.getCancelButton() != null) {
+			ActionEvent ev = new ActionEvent(panel.getCancelButton(), 0, null);
+			actionPerformed(ev);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.KeyListener#keyTyped(java.awt.event.KeyEvent)
+	 */
+	public void keyTyped(KeyEvent e) {
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/listener/GeoLocationPanelListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/listener
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationOpeningRasterCornersPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationOpeningRasterCornersPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationOpeningRasterCornersPanel.java	(revision 8183)
@@ -0,0 +1,300 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.geolocation.ui;
+
+import java.awt.BorderLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.GridLayout;
+import java.awt.geom.AffineTransform;
+
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.util.MathUtils;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.gui.beans.datainput.DataInputContainer;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.tools.app.basic.tool.geolocation.listener.GeoLocationPanelListener;
+
+
+/**
+ * Panel de geolocalizaci�n. Este muestra las esquinas superior derecha e 
+ * inferior izquierda.
+ * 
+ * @version 12/12/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class GeoLocationOpeningRasterCornersPanel extends GeolocationBaseClassPanel {
+	private static final long          serialVersionUID = -7797379892312214949L;
+	private DataInputContainer	       ulx = null;
+	private DataInputContainer	       uly = null;
+	private DataInputContainer	       lrx = null;
+	private DataInputContainer	       lry = null;
+		
+	private JPanel			           coordsULPanel = null;
+	private JPanel			           coordsLRPanel = null;
+	
+	private String                     pathToImages = "images/";
+
+	
+	/**
+	 * Constructor
+	 */
+	public GeoLocationOpeningRasterCornersPanel(GeoLocationPanelListener list) {
+		this.listener = list;
+		GridBagLayout gl = new GridBagLayout();
+		this.setLayout(gl);
+		setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this, "geolocation"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+		ulx = new DataInputContainer();
+		ulx.setLabelText(PluginServices.getText(this,"ux"));
+		ulx.addValueChangedListener(listener);
+		ulx.addKeyListener(listener);
+		
+		uly = new DataInputContainer();
+		uly.setLabelText(PluginServices.getText(this,"uy"));
+		uly.addValueChangedListener(listener);
+		uly.addKeyListener(listener);
+		
+		lrx = new DataInputContainer();
+		lrx.setLabelText(PluginServices.getText(this,"ux"));
+		lrx.addValueChangedListener(listener);
+		lrx.addKeyListener(listener);
+				
+		lry = new DataInputContainer();
+		lry.setLabelText(PluginServices.getText(this,"uy"));
+		lry.addValueChangedListener(listener);
+		lry.addKeyListener(listener);
+		
+		GridLayout l = new GridLayout(2, 1);
+		l.setVgap(2);
+		
+		coordsULPanel = new JPanel(l);
+		coordsLRPanel = new JPanel(l);
+		
+		init();
+	}
+	
+	/**
+	 * Inicializaci�n de los componentes gr�ficos del panel.
+	 */
+	private void init() {		
+		JPanel p1 = new JPanel(new BorderLayout());
+		p1.add(getIcoUL(), BorderLayout.WEST);
+		p1.add(ulx, BorderLayout.CENTER);
+		
+		JPanel p2 = new JPanel(new BorderLayout());
+		p2.add(getIcoUL(), BorderLayout.WEST);
+		p2.add(uly, BorderLayout.CENTER);
+		
+		coordsULPanel.add(p1);
+		coordsULPanel.add(p2);
+		
+		JPanel p3 = new JPanel(new BorderLayout());
+		p3.add(getIcoLR(), BorderLayout.WEST);
+		p3.add(lrx, BorderLayout.CENTER);
+		
+		JPanel p4 = new JPanel(new BorderLayout());
+		p4.add(getIcoLR(), BorderLayout.WEST);
+		p4.add(lry, BorderLayout.CENTER);
+		
+		coordsLRPanel.add(p3);
+		coordsLRPanel.add(p4);
+		
+		GridBagConstraints gbc = new GridBagConstraints();
+		
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.weightx = 1.0;
+		
+		gbc.gridx = 0;
+		gbc.gridy = 0;
+		gbc.insets = new java.awt.Insets(1, 1, 1, 1);
+		this.add(coordsULPanel, gbc);
+		
+		gbc.gridy = 1;
+		this.add(coordsLRPanel, gbc);		
+	}
+	
+	/**
+	 * Asigna la capa raster del raster seleccionado en el TOC en base 
+	 * al cual se asigna la georreferenciaci�n al dialogo.
+	 * @param lyr
+	 */
+	public void setParams(FLyrRaster lyr, ViewPort vp) {
+		setLayer(lyr);
+		setViewPort(vp);
+		loadTransform(lyr.getAffineTransform());
+	}
+	
+	/**
+	 * Obtiene el JLabel con el icono de la esquina superior
+	 * @return JLabel
+	 */
+	private JLabel getIcoUL() {
+		ImageIcon icon = null;
+		try {
+			icon = new ImageIcon(getClass().getResource(pathToImages + "upleft.png"));
+		} catch (NullPointerException e) {
+			
+		}
+		if(icon != null)
+			return new JLabel(icon);
+		else
+			return new JLabel("UL");
+	}
+
+	/**
+	 * Obtiene el JLabel con el icono de la esquina inferior
+	 * @return JLabel
+	 */
+	private JLabel getIcoLR() {
+		ImageIcon icon = null;
+		try {
+			icon = new ImageIcon(getClass().getResource(pathToImages + "downright.png"));
+		} catch (NullPointerException e) {
+			
+		}
+		if(icon != null)
+			return new JLabel(icon);
+		else
+			return new JLabel("LR");
+	}
+	
+	/**
+	 * Carga los par�metros en el dialogo a partir de la capa
+	 * @param lyr Capa raster
+	 */
+	public void loadTransform(AffineTransform at) {
+		listener.setEnableValueChangeEvent(false);
+		MathUtils math = RasterLocator.getManager().getMathUtils();
+		setUlx(String.valueOf(math.format(at.getTranslateX(), tailValue)));
+		setUly(String.valueOf(math.format(at.getTranslateY(), tailValue)));
+		setLrx(String.valueOf(math.format(at.getTranslateX() + (at.getScaleX() * getLayer().getDataStore().getWidth()), tailValue)));
+		setLry(String.valueOf(math.format(at.getTranslateY() + (at.getScaleY()  * getLayer().getDataStore().getHeight()), tailValue)));		
+		listener.setEnableValueChangeEvent(true);
+	}
+
+	/**
+	 * Asigna la coordenada superior izquierda
+	 * @param ulx 
+	 */
+	public void setUlx(String ulx) {
+		this.ulx.setValue(ulx);
+	}
+
+	/**
+	 * Asigna la coordenada superior derecha
+	 * @param ulx 
+	 */
+	public void setUly(String uly) {
+		this.uly.setValue(uly);
+	}
+	
+	/**
+	 * Asigna la coordenada inferior derecha
+	 * @param lrx
+	 */
+	public void setLrx(String lrx) {
+		this.lrx.setValue(lrx);
+	}
+
+	/**
+	 * Asigna la coordenada superior derecha
+	 * @param lrx 
+	 */
+	public void setLry(String lry) {
+		this.lry.setValue(lry);
+	}
+	
+	/**
+	 * Obtiene la X de la coordenada superior izquierda
+	 * @return
+	 */
+	public DataInputContainer getUlx() {
+		return ulx;
+	}
+
+	/**
+	 * Obtiene la Y de la coordenada superior izquierda
+	 * @return
+	 */
+	public DataInputContainer getUly() {
+		return uly;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.geolocation.ui.GeolocationBaseClassPanel#getPsx()
+	 */
+	public DataInputContainer getPsx() {
+		DataInputContainer d = new DataInputContainer();
+		try {
+			double dUlx = Double.valueOf(ulx.getValue()).doubleValue();
+			double dLrx = Double.valueOf(lrx.getValue()).doubleValue();
+			d.setValue(String.valueOf((dLrx - dUlx) / getLayer().getDataStore().getWidth()));
+		} catch (NumberFormatException e) {
+			d.setValue("1");
+		}
+		return d;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.geolocation.ui.GeolocationBaseClassPanel#getPsy()
+	 */
+	public DataInputContainer getPsy() {
+		DataInputContainer d = new DataInputContainer();
+		try {
+			double dUly = Double.valueOf(uly.getValue()).doubleValue();
+			double dLry = Double.valueOf(lry.getValue()).doubleValue();
+			d.setValue(String.valueOf((dLry - dUly) / getLayer().getDataStore().getHeight()));
+		} catch (NumberFormatException e) {
+			d.setValue("1");
+		}
+		return d;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.geolocation.ui.GeolocationBaseClassPanel#getRotx()
+	 */
+	public DataInputContainer getRotx() {
+		DataInputContainer d = new DataInputContainer();
+		d.setValue("0");
+		return d;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.geolocation.ui.GeolocationBaseClassPanel#getRoty()
+	 */
+	public DataInputContainer getRoty() {
+		DataInputContainer d = new DataInputContainer();
+		d.setValue("0");
+		return d;
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationOpeningRasterCornersPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationOpeningRasterTransfPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationOpeningRasterTransfPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationOpeningRasterTransfPanel.java	(revision 8183)
@@ -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.tools.app.basic.tool.geolocation.ui;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.GridLayout;
+import java.awt.geom.AffineTransform;
+
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.util.MathUtils;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.gui.beans.datainput.DataInputContainer;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.tools.app.basic.tool.geolocation.listener.GeoLocationPanelListener;
+
+
+/**
+ * Panel de geolocalizaci�n. Este muestra los par�metros de la matriz de transformaci�n
+ * que est� aplicandose en esos momentos al raster. 
+ * 
+ * @version 12/12/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class GeoLocationOpeningRasterTransfPanel extends GeolocationBaseClassPanel {
+	private static final long         serialVersionUID = -7797379892312214949L;
+	private DataInputContainer	       ulx = null;
+	private DataInputContainer	       uly = null;
+	private DataInputContainer	       psx = null;
+	private DataInputContainer	       psy = null;
+	private DataInputContainer	       rotx = null;
+	private DataInputContainer	       roty = null;
+	
+		
+	private JPanel			           coordsPanel = null;
+	private JPanel			           paramsPanel = null;
+	
+	/**
+     * N�mero de decimales a mostrar
+     */
+    private int                        tailValue = 2;
+	
+	/**
+	 * Constructor
+	 */
+	public GeoLocationOpeningRasterTransfPanel(GeoLocationPanelListener list) {
+		this.listener = list;
+		GridBagLayout gl = new GridBagLayout();
+		this.setLayout(gl);
+		setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this, "geolocation"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+		
+		ulx = new DataInputContainer();
+		ulx.setLabelText(PluginServices.getText(this,"ux"));
+		ulx.addValueChangedListener(listener);
+		ulx.addKeyListener(listener);
+		
+		uly = new DataInputContainer();
+		uly.setLabelText(PluginServices.getText(this,"uy"));
+		uly.addValueChangedListener(listener);
+		uly.addKeyListener(listener);
+		
+		psx = new DataInputContainer();
+		psx.setLabelText(PluginServices.getText(this,"px"));
+		psx.addValueChangedListener(listener);
+		psx.addKeyListener(listener);
+		
+		psy = new DataInputContainer();
+		psy.setLabelText(PluginServices.getText(this,"py"));
+		psy.addValueChangedListener(listener);
+		psy.addKeyListener(listener);
+		
+		rotx = new DataInputContainer();
+		rotx.setLabelText(PluginServices.getText(this,"rx"));
+		rotx.addValueChangedListener(listener);
+		rotx.addKeyListener(listener);
+		
+		roty = new DataInputContainer();
+		roty.setLabelText(PluginServices.getText(this,"ry"));
+		roty.addValueChangedListener(listener);
+		roty.addKeyListener(listener);
+				
+		coordsPanel = new JPanel();
+		GridLayout l = new GridLayout(2, 1);
+		l.setVgap(2);
+		coordsPanel.setLayout(l);
+		
+		paramsPanel = new JPanel();
+		GridLayout l1 = new GridLayout(2, 2);
+		l1.setVgap(2);
+		paramsPanel.setLayout(l1);
+
+		init();
+	}
+	
+	private void init() {
+		coordsPanel.add(ulx);
+		coordsPanel.add(uly);
+		paramsPanel.add(psx);
+		paramsPanel.add(psy);
+		paramsPanel.add(rotx);
+		paramsPanel.add(roty);
+				
+		GridBagConstraints gbc = new GridBagConstraints();
+				
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.gridx = 0;
+		gbc.gridy = 0;
+		gbc.insets = new java.awt.Insets(1, 1, 1, 1);
+		this.add(coordsPanel, gbc);
+		
+		gbc.gridy = 1;
+		gbc.weightx = 1.0;
+		this.add(paramsPanel, gbc);
+		
+	}
+	
+	/**
+	 * Activa o desactiva los botones de transformaci�n anterior y siguiente dependiendo
+	 * del estado de la lista de transformaciones.
+	 * @return
+	 */
+	public void activeButtons() {
+
+	}
+	
+	/**
+	 * Asigna la capa raster del raster seleccionado en el TOC en base 
+	 * al cual se asigna la georreferenciaci�n al dialogo.
+	 * @param lyr
+	 */
+	public void setParams(FLyrRaster lyr, ViewPort vp) {
+		setLayer(lyr);
+		setViewPort(vp);
+		loadTransform(lyr.getAffineTransform());
+	}
+
+	/**
+	 * Carga los par�metros en el dialogo a partir de la capa
+	 * @param lyr Capa raster
+	 */
+	public void loadTransform(AffineTransform at) {
+		listener.setEnableValueChangeEvent(false);
+		MathUtils math = RasterLocator.getManager().getMathUtils();
+		setUlx(String.valueOf(math.format(at.getTranslateX(), tailValue)));
+		setUly(String.valueOf(math.format(at.getTranslateY(), tailValue)));
+		setPsx(String.valueOf(math.format(at.getScaleX(), tailValue)));
+		setPsy(String.valueOf(math.format(at.getScaleY(), tailValue)));
+		setRotx(String.valueOf(math.format(at.getShearX(), tailValue)));
+		setRoty(String.valueOf(math.format(at.getShearY(), tailValue)));
+		listener.setEnableValueChangeEvent(true);
+	}
+	
+	/**
+	 * Asigna el tama�o de pixel en X
+	 * @param psx
+	 */
+	public void setPsx(String psx) {
+		this.psx.setValue(psx);
+	}
+
+	/**
+	 * Asigna el tama�o de pixel en Y
+	 * @param psy
+	 */
+	public void setPsy(String psy) {
+		this.psy.setValue(psy);
+	}
+
+	/**
+	 * Asigna la rotaci�n en X
+	 * @param rotx
+	 */
+	public void setRotx(String rotx) {
+		this.rotx.setValue(rotx);
+	}
+
+	/**
+	 * Asigna la rotaci�n en Y
+	 * @param roty
+	 */
+	public void setRoty(String roty) {
+		this.roty.setValue(roty);
+	}
+
+	/**
+	 * Asigna la coordenada superior izquierda
+	 * @param ulx 
+	 */
+	public void setUlx(String ulx) {
+		this.ulx.setValue(ulx);
+	}
+
+	/**
+	 * Asigna la coordenada superior derecha
+	 * @param ulx 
+	 */
+	public void setUly(String uly) {
+		this.uly.setValue(uly);
+	}
+	
+	/**
+	 * Obtiene el tama�o de pixel en X
+	 * @return
+	 */
+	public DataInputContainer getPsx() {
+		return psx;
+	}
+
+	/**
+	 * Obtiene el tama�o de pixel en Y
+	 * @return
+	 */
+	public DataInputContainer getPsy() {
+		return psy;
+	}
+
+	/**
+	 * Obtiene la rotaci�n en X
+	 * @return
+	 */
+	public DataInputContainer getRotx() {
+		return rotx;
+	}
+
+	/**
+	 * Obtiene la rotaci�n en Y
+	 * @return
+	 */
+	public DataInputContainer getRoty() {
+		return roty;
+	}
+
+	/**
+	 * Obtiene la X de la coordenada superior izquierda
+	 * @return
+	 */
+	public DataInputContainer getUlx() {
+		return ulx;
+	}
+
+	/**
+	 * Obtiene la Y de la coordenada superior izquierda
+	 * @return
+	 */
+	public DataInputContainer getUly() {
+		return uly;
+	}
+	
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationOpeningRasterTransfPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/image/upleft.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/image/upleft.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/image/downright.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/image/downright.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/image
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationDialog.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationDialog.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationDialog.java	(revision 8183)
@@ -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.tools.app.basic.tool.geolocation.ui;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.geom.AffineTransform;
+
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.andami.ui.mdiManager.IWindowListener;
+import org.gvsig.andami.ui.mdiManager.WindowInfo;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.tool.geolocation.behavior.ITransformIO;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+
+
+/**
+ * Dialogo de geolocalizaci�n de raster.
+ * 
+ * @version 30/07/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class GeoLocationDialog extends JPanel implements IWindow, IWindowListener, ITransformIO {
+	private static final long serialVersionUID = 7362459094802955247L;
+	private GeoLocationPanel  geolocationPanel = null;
+
+	/**
+	 * Posici�n de la ventana en X y en Y
+	 */
+	private int               posWindowX       = 0;
+	private int               posWindowY       = 0;
+
+	private int               widthWindow      = 272;
+	private int               heightWindow     = 155;
+
+	private String            lastTool         = null;
+	private AbstractViewPanel          view             = null;
+
+	/**
+	 * Constructor
+	 */
+	public GeoLocationDialog() {
+		BorderLayout bl = new BorderLayout(5, 5);
+		this.setLayout(bl);
+		
+		this.add(getGeoLocationPanel());
+	}
+	
+	/**
+	 * Constructor. Asigna la capa raster.
+	 *
+	 */
+	public GeoLocationDialog(FLyrRaster lyr, ViewPort vp, AbstractViewPanel view) {
+		this.view = view;
+		BorderLayout bl = new BorderLayout(5, 5);
+		this.setLayout(bl);
+
+		this.add(getGeoLocationPanel());
+		getGeoLocationPanel().setParams(lyr, vp);
+	}
+	
+	/**
+	 * Obtiene la vista asociada a este dialogo
+	 * @return BaseView
+	 */
+	public AbstractViewPanel getAssociateView() {
+		return view;
+	}
+	
+	/**
+	 * Asigna la posici�n de la ventana
+	 * @param x Posici�n en X
+	 * @param y Posici�n en Y
+	 */
+	public void setPosition(int x, int y) {
+		this.posWindowX = x;
+		this.posWindowY = y;
+	}
+	
+	/**
+	 * Obtiene el tama�o de la ventana
+	 * @return
+	 */
+	public Dimension getSizeWindow() {
+		return new Dimension(widthWindow, heightWindow);
+	}
+	
+	/**
+	 * Referencia la capa que est� seleccionada
+	 *
+	 */
+	private void loadLayer(ViewPort vp) {
+		if(getGeoLocationPanel().getLayer() != null)
+			return;
+		//Este c�digo es para poder lanzar la funcionalidad desde la barra de herramientas y no desde el TOC
+		FLayers flyrs = getGeoLocationPanel().getMapCtrl().getMapContext().getLayers();
+		FLayer[] actives = flyrs.getActives();
+		for (int i = 0; i < actives.length; i++) {
+			if(actives[i] instanceof FLyrRaster) {
+				getGeoLocationPanel().setParams(((FLyrRaster)actives[i]), vp);
+				break;
+			}
+		}
+	}
+	
+	/**
+	 * Acciones de inicializaci�n
+	 *
+	 */
+	public void init(MapControl mapCtrl) {
+		geolocationPanel.setMapCtrl(mapCtrl);
+		lastTool = mapCtrl.getCurrentTool();
+		loadLayer(mapCtrl.getViewPort());
+		FLyrRaster lyr = getGeoLocationPanel().getLayer();
+		if(lyr != null) {
+			lyr.getAffineTransformHistorical().clear();
+			lyr.getAffineTransformHistorical().add(lyr.getDataStore().getAffineTransform());
+			loadTransform(lyr.getDataStore().getAffineTransform());
+		}
+		activeButtons();
+	}
+	
+	/**
+	 * Carga los par�metros en el dialogo a partir de la capa
+	 * @param lyr Capa raster
+	 */
+	public void loadTransform(AffineTransform at) {
+		geolocationPanel.loadTransform(at);
+	}
+	
+	/**
+	 * Activa o desactiva los botones de transformaci�n anterior y siguiente dependiendo
+	 * del estado de la lista de transformaciones.
+	 * @return
+	 */
+	public void applyTransformation() {
+		geolocationPanel.setModify(true);
+		geolocationPanel.activeButtons();	
+	}
+	/**
+	 * Obtiene el panel con el histograma
+	 * @return HistogramPanel
+	 */
+	public GeoLocationPanel getGeoLocationPanel(){
+		if (geolocationPanel == null) 
+			geolocationPanel = new GeoLocationPanel(this);
+		
+		return geolocationPanel;
+	}
+
+	/**
+	 * Activa o desactiva los botones de transformaci�n anterior y siguiente dependiendo
+	 * del estado de la lista de transformaciones.
+	 * @return
+	 */
+	public void activeButtons() {
+		getGeoLocationPanel().activeButtons();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.andami.ui.mdiManager.IWindow#getWindowInfo()
+	 */
+	public WindowInfo getWindowInfo() {
+	    I18nManager i18n = ToolsLocator.getI18nManager();
+		WindowInfo m_viewinfo=new WindowInfo(WindowInfo.MODELESSDIALOG | WindowInfo.RESIZABLE);
+		m_viewinfo.setHeight(heightWindow);
+		m_viewinfo.setWidth(widthWindow);
+		m_viewinfo.setX(posWindowX);
+		m_viewinfo.setY(posWindowY);
+		m_viewinfo.setTitle(i18n.getTranslation("geolocation"));
+		return m_viewinfo;
+	}
+
+	/**
+	 * Asigna el �ltimo tool seleccionado antes de abrir el di�logo para 
+	 * restaurarlo cuando se cierre este.
+	 * @param tool
+	 */
+	public void setLastTool(String tool) {
+		this.lastTool = tool;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.andami.ui.mdiManager.IWindowListener#windowActivated()
+	 */
+	public void windowActivated() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.andami.ui.mdiManager.IWindowListener#windowClosed()
+	 */
+	public void windowClosed() {
+		//Se consulta si se desean salvar los cambios
+		if(geolocationPanel.getModify()) {
+			if(RasterSwingLibrary.messageBoxYesOrNot(PluginServices.getText(this,"aviso_salir_salvando"), geolocationPanel)) {
+				try {
+					geolocationPanel.getLayer().saveGeoToRmf();
+				} catch (RmfSerializerException e1) {
+					RasterSwingLibrary.messageBoxError(PluginServices.getText(this,"error_salvando_rmf"), geolocationPanel, e1);
+				}
+			}
+			geolocationPanel.setModify(false);
+		}
+		
+		//Restauramos la tool que hab�a antes de de activar la actual
+		if(lastTool != null)
+			getGeoLocationPanel().getMapCtrl().setTool(lastTool);
+		
+		//TODO: Si queremos usar la funcionalidad de geolocalizaci�n desde la barra de herramientas deberemos 
+		//, al cerrar la ventana, asignar la capa raster de GeoRasterBehevior a null ya que sino se aplicar�n las
+		//transformaciones sobre la �ltima capa que se abri� desde el men� del TOC
+	}
+
+	public Object getWindowProfile() {
+		return WindowInfo.PROPERTIES_PROFILE;
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationDialog.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationPanel.java	(revision 8183)
@@ -0,0 +1,483 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.geolocation.ui;
+
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.GridLayout;
+import java.awt.geom.AffineTransform;
+
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.util.Historical;
+import org.gvsig.fmap.dal.coverage.util.MathUtils;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.gui.beans.datainput.DataInputContainer;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.tools.app.basic.tool.geolocation.listener.GeoLocationPanelListener;
+
+
+/**
+ * Panel de geolocalizaci�n. Este muestra los par�metros de la matriz de transformaci�n
+ * que est� aplicandose en esos momentos al raster. Los par�metros son variados en 
+ * tiempo real a medida que modificamos la georreferenciaci�n con las herramientas.
+ * 
+ * @version 30/07/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class GeoLocationPanel extends GeolocationBaseClassPanel {
+	private static final long         serialVersionUID = -7797379892312214949L;
+	private DataInputContainer	       ulx             = null;
+	private DataInputContainer	       uly             = null;
+	private DataInputContainer	       psx             = null;
+	private DataInputContainer	       psy             = null;
+	private DataInputContainer	       rotx            = null;
+	private DataInputContainer	       roty            = null;
+	private JButton                    first           = null;
+	private JButton                    save            = null;
+	private JButton                    back            = null;
+	private JButton                    next            = null;
+	private JButton                    apply           = null;
+	private JButton                    reset           = null;
+	private JButton                    tfwload         = null;
+	private JButton                    center          = null;
+	private JButton                    focus           = null;
+	
+	private JPanel			           coordsPanel     = null;
+	private JPanel			           paramsPanel     = null;
+	private JPanel			           buttonsPanel    = null;
+		
+	/**
+	 * Constructor
+	 */
+	public GeoLocationPanel(GeoLocationDialog dialog) {
+		ImageIcon backIcon = null;
+		ImageIcon nextIcon = null;
+		ImageIcon saveIcon = null;
+		ImageIcon firstIcon = null;
+		ImageIcon resetIcon = null;
+		ImageIcon tfwLoadIcon = null;
+		ImageIcon centerRasterIcon = null;
+		ImageIcon focusIcon = null;
+		try {
+			backIcon = IconThemeHelper.getImageIcon("back-icon");
+			nextIcon = IconThemeHelper.getImageIcon("next-icon");
+			saveIcon = IconThemeHelper.getImageIcon("layer-saveas"); 
+			firstIcon = IconThemeHelper.getImageIcon("undo-icon");
+			resetIcon = IconThemeHelper.getImageIcon("reset-icon");
+			centerRasterIcon = IconThemeHelper.getImageIcon("centerraster-icon");
+			tfwLoadIcon = IconThemeHelper.getImageIcon("tfwload-icon");
+			focusIcon = IconThemeHelper.getImageIcon("focus-icon");
+		} catch(NullPointerException e) {
+			
+		}
+		
+		listener = new GeoLocationPanelListener(this, dialog);
+		
+		GridBagLayout gl = new GridBagLayout();
+		this.setLayout(gl);
+		ulx = new DataInputContainer();
+		ulx.setLabelText(PluginServices.getText(this,"ux"));
+		ulx.addValueChangedListener(listener);
+		
+		uly = new DataInputContainer();
+		uly.setLabelText(PluginServices.getText(this,"uy"));
+		uly.addValueChangedListener(listener);
+		
+		psx = new DataInputContainer();
+		psx.setLabelText(PluginServices.getText(this,"px"));
+		psx.addValueChangedListener(listener);
+		
+		psy = new DataInputContainer();
+		psy.setLabelText(PluginServices.getText(this,"py"));
+		psy.addValueChangedListener(listener);
+		
+		rotx = new DataInputContainer();
+		rotx.setLabelText(PluginServices.getText(this,"rx"));
+		rotx.addValueChangedListener(listener);
+		
+		roty = new DataInputContainer();
+		roty.setLabelText(PluginServices.getText(this,"ry"));
+		roty.addValueChangedListener(listener);
+		
+		first = new JButton(firstIcon);
+		save = new JButton(saveIcon);
+		back = new JButton(backIcon);
+		next = new JButton(nextIcon);
+		apply = new JButton(PluginServices.getText(this,"apply"));
+		reset = new JButton(resetIcon);
+		tfwload = new JButton(tfwLoadIcon);
+		center = new JButton(centerRasterIcon);
+		focus = new JButton(focusIcon);
+		
+		save.setToolTipText(PluginServices.getText(this,"salvar_transf"));
+		back.setToolTipText(PluginServices.getText(this,"back_transf"));
+		next.setToolTipText(PluginServices.getText(this,"next_transf"));
+		apply.setToolTipText(PluginServices.getText(this,"aplicar_transf"));
+		first.setToolTipText(PluginServices.getText(this,"first_transf"));
+		reset.setToolTipText(PluginServices.getText(this,"reset_transf"));
+		center.setToolTipText(PluginServices.getText(this,"center_raster"));
+		tfwload.setToolTipText(PluginServices.getText(this,"tfw_load"));
+		focus.setToolTipText(PluginServices.getText(this,"get_tool_focus"));
+		
+		save.setPreferredSize(new Dimension(28, 24));
+		first.setPreferredSize(new Dimension(28, 24));
+		back.setPreferredSize(new Dimension(28, 24));
+		next.setPreferredSize(new Dimension(28, 24));
+		apply.setPreferredSize(new Dimension(64,24));
+		reset.setPreferredSize(new Dimension(28,24));
+		center.setPreferredSize(new Dimension(28,24));
+		tfwload.setPreferredSize(new Dimension(28,24));
+		focus.setPreferredSize(new Dimension(28,24));
+		
+		first.addActionListener(listener);
+		save.addActionListener(listener);
+		back.addActionListener(listener);
+		next.addActionListener(listener);
+		apply.addActionListener(listener);
+		reset.addActionListener(listener);
+		tfwload.addActionListener(listener);
+		center.addActionListener(listener);
+		focus.addActionListener(listener);
+		
+		save.setEnabled(false);
+		back.setEnabled(false);
+		next.setEnabled(false);
+		first.setEnabled(false);
+		reset.setEnabled(true);
+		center.setEnabled(true);
+		tfwload.setEnabled(true);
+		focus.setEnabled(true);
+		
+		coordsPanel = new JPanel();
+		GridLayout l = new GridLayout(2, 1);
+		l.setVgap(2);
+		coordsPanel.setLayout(l);
+		
+		paramsPanel = new JPanel();
+		GridLayout l1 = new GridLayout(2, 2);
+		l1.setVgap(2);
+		paramsPanel.setLayout(l1);
+
+		getButtonsPanel();
+		
+		init();
+	}
+	
+	private void init() {
+		coordsPanel.add(ulx);
+		coordsPanel.add(uly);
+		paramsPanel.add(psx);
+		paramsPanel.add(psy);
+		paramsPanel.add(rotx);
+		paramsPanel.add(roty);
+		
+		JPanel smallButtons = new JPanel();
+		smallButtons.setLayout(new GridBagLayout());
+		JPanel applyButton = new JPanel();
+		applyButton.setLayout(new GridBagLayout());
+		
+		GridBagConstraints gbc = new GridBagConstraints();
+				
+		gbc.gridx = 0;
+		gbc.gridy = 0;
+		gbc.insets = new java.awt.Insets(1, 0, 0, 2);
+		smallButtons.add(focus, gbc);
+		gbc.gridx = 1;
+		smallButtons.add(center, gbc);
+		gbc.gridx = 2;
+		smallButtons.add(reset, gbc);
+		gbc.gridx = 3;
+		smallButtons.add(first, gbc);
+		gbc.gridx = 4;
+		smallButtons.add(back, gbc);
+		gbc.gridx = 5;
+		smallButtons.add(next, gbc);
+		gbc.gridx = 6;
+		smallButtons.add(tfwload, gbc);
+		gbc.gridx = 7;
+		smallButtons.add(save, gbc);
+		
+		gbc.gridx = 0;
+		gbc.gridy = 0;
+		gbc.anchor = GridBagConstraints.EAST;
+		applyButton.add(apply, gbc);
+		
+		buttonsPanel.add(smallButtons, gbc);
+		gbc.gridy = 1;
+		gbc.weightx = 1.0;
+		buttonsPanel.add(applyButton, gbc);
+		
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.gridx = 0;
+		gbc.gridy = 0;
+		gbc.insets = new java.awt.Insets(1, 1, 1, 1);
+		this.add(coordsPanel, gbc);
+		
+		gbc.gridy = 1;
+		this.add(paramsPanel, gbc);
+		gbc.weightx = 1.0;
+		gbc.gridy = 2;
+		this.add(buttonsPanel, gbc);
+	}
+	
+	/**
+	 * Obtiene el panel con los botones
+	 * @return JPanel
+	 */
+	public JPanel getButtonsPanel() {
+		if(buttonsPanel == null) {
+			buttonsPanel = new JPanel();
+			buttonsPanel.setLayout(new GridBagLayout());
+			//buttonsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+		}
+		return buttonsPanel;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.geolocation.ui.GeolocationBaseClassPanel#activeButtons()
+	 */
+	public void activeButtons() {
+		Historical affineTransformHist = getLayer().getAffineTransformHistorical();
+		if(!affineTransformHist.existNext())
+			next.setEnabled(false);
+		else
+			next.setEnabled(true);
+		if(!affineTransformHist.existBack())
+			back.setEnabled(false);
+		else
+			back.setEnabled(true);
+		if(affineTransformHist.getElementsCount() <= 1)
+			first.setEnabled(false);
+		else
+			first.setEnabled(true);
+		if(affineTransformHist.getElementsCount() == 0)
+			save.setEnabled(false);
+		else
+			save.setEnabled(true);
+	}
+	
+	/**
+	 * Asigna la capa raster del raster seleccionado en el TOC en base 
+	 * al cual se asigna la georreferenciaci�n al dialogo.
+	 * @param lyr
+	 */
+	public void setParams(FLyrRaster lyr, ViewPort vp) {
+		setLayer(lyr);
+		setViewPort(vp);
+		loadTransform(lyr.getDataStore().getAffineTransform());
+	}
+	
+	
+
+	/**
+	 * Carga los par�metros en el dialogo a partir de la capa
+	 * @param lyr Capa raster
+	 */
+	public void loadTransform(AffineTransform at) {
+		listener.setEnableValueChangeEvent(false);
+		MathUtils math = RasterLocator.getManager().getMathUtils();
+		setUlx(String.valueOf(math.format(at.getTranslateX(), tailValue)));
+		setUly(String.valueOf(math.format(at.getTranslateY(), tailValue)));
+		setPsx(String.valueOf(math.format(at.getScaleX(), tailValue)));
+		setPsy(String.valueOf(math.format(at.getScaleY(), tailValue)));
+		setRotx(String.valueOf(math.format(at.getShearX(), tailValue)));
+		setRoty(String.valueOf(math.format(at.getShearY(), tailValue)));
+		listener.setEnableValueChangeEvent(true);
+	}
+	
+	/**
+	 * Asigna el tama�o de pixel en X
+	 * @param psx
+	 */
+	public void setPsx(String psx) {
+		this.psx.setValue(psx);
+	}
+
+	/**
+	 * Asigna el tama�o de pixel en Y
+	 * @param psy
+	 */
+	public void setPsy(String psy) {
+		this.psy.setValue(psy);
+	}
+
+	/**
+	 * Asigna la rotaci�n en X
+	 * @param rotx
+	 */
+	public void setRotx(String rotx) {
+		this.rotx.setValue(rotx);
+	}
+
+	/**
+	 * Asigna la rotaci�n en Y
+	 * @param roty
+	 */
+	public void setRoty(String roty) {
+		this.roty.setValue(roty);
+	}
+
+	/**
+	 * Asigna la coordenada superior izquierda
+	 * @param ulx 
+	 */
+	public void setUlx(String ulx) {
+		this.ulx.setValue(ulx);
+	}
+
+	/**
+	 * Asigna la coordenada superior derecha
+	 * @param ulx 
+	 */
+	public void setUly(String uly) {
+		this.uly.setValue(uly);
+	}
+
+	/**
+	 * Obtiene el bot�n de aplicar
+	 * @return JButton
+	 */
+	public JButton getApplyButton() {
+		return apply;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.geolocation.ui.GeolocationBaseClassPanel#getBackButton()
+	 */
+	public JButton getBackButton() {
+		return back;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.geolocation.ui.GeolocationBaseClassPanel#getFirstButton()
+	 */
+	public JButton getFirstButton() {
+		return first;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.geolocation.ui.GeolocationBaseClassPanel#getSaveButton()
+	 */
+	public JButton getSaveButton() {
+		return save;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.geolocation.ui.GeolocationBaseClassPanel#getResetButton()
+	 */
+	public JButton getResetButton() {
+		return reset;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.geolocation.ui.GeolocationBaseClassPanel#getNextButton()
+	 */
+	public JButton getNextButton() {
+		return next;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.geolocation.ui.GeolocationBaseClassPanel#getTfwLoad()
+	 */
+	public JButton getTfwLoad() {
+		return tfwload;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.geolocation.ui.GeolocationBaseClassPanel#getCenterToView()
+	 */
+	public JButton getCenterToView() {
+		return center;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.geolocation.ui.GeolocationBaseClassPanel#getFocus()
+	 */
+	public JButton getFocus() {
+		return focus;
+	}
+	
+	/**
+	 * Obtiene el tama�o de pixel en X
+	 * @return
+	 */
+	public DataInputContainer getPsx() {
+		return psx;
+	}
+
+	/**
+	 * Obtiene el tama�o de pixel en Y
+	 * @return
+	 */
+	public DataInputContainer getPsy() {
+		return psy;
+	}
+
+	/**
+	 * Obtiene la rotaci�n en X
+	 * @return
+	 */
+	public DataInputContainer getRotx() {
+		return rotx;
+	}
+
+	/**
+	 * Obtiene la rotaci�n en Y
+	 * @return
+	 */
+	public DataInputContainer getRoty() {
+		return roty;
+	}
+
+	/**
+	 * Obtiene la X de la coordenada superior izquierda
+	 * @return
+	 */
+	public DataInputContainer getUlx() {
+		return ulx;
+	}
+
+	/**
+	 * Obtiene la Y de la coordenada superior izquierda
+	 * @return
+	 */
+	public DataInputContainer getUly() {
+		return uly;
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationOpeningRasterDialog.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationOpeningRasterDialog.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationOpeningRasterDialog.java	(revision 8183)
@@ -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.tools.app.basic.tool.geolocation.ui;
+
+import java.awt.BorderLayout;
+import java.awt.geom.AffineTransform;
+
+import javax.swing.JPanel;
+
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.andami.ui.mdiManager.IWindowListener;
+import org.gvsig.andami.ui.mdiManager.WindowInfo;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.tool.geolocation.behavior.ITransformIO;
+
+
+/**
+ * Dialogo de geolocalizaci�n de raster. Este es el que se usa para georreferenciar cuando 
+ * se abre una imagen que no tiene georreferenciaci�n asociada, si el usuario as� lo solicita.
+ * 
+ * @version 12/12/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class GeoLocationOpeningRasterDialog extends JPanel implements IWindow, IWindowListener, ITransformIO {
+	private static final long              serialVersionUID = 7362459094802955247L;
+	private GeoLocationOpeningRasterPanel  geolocationPanel = null;
+
+	private int                            widthWindow      = 260;
+	private int                            heightWindow     = 165;
+
+	/**
+	 * Constructor
+	 */
+	public GeoLocationOpeningRasterDialog() {
+		BorderLayout bl = new BorderLayout(5, 5);
+		this.setLayout(bl);
+		
+		this.add(getGeoLocationPanel());
+	}
+	
+	/**
+	 * Constructor. Asigna la capa raster.
+	 *
+	 */
+	public GeoLocationOpeningRasterDialog(FLyrRaster lyr) {
+		BorderLayout bl = new BorderLayout(5, 5);
+		this.setLayout(bl);
+
+		this.add(getGeoLocationPanel());
+		getGeoLocationPanel().setParams(lyr);
+	}
+		
+	/**
+	 * Acciones de inicializaci�n
+	 *
+	 */
+	public void init(MapControl mapCtrl) {
+		geolocationPanel.setMapCtrl(mapCtrl);
+		FLyrRaster lyr = getGeoLocationPanel().getLayer();
+		if(lyr != null) {
+			lyr.getAffineTransformHistorical().clear();
+			lyr.getAffineTransformHistorical().add(lyr.getDataStore().getAffineTransform());
+			loadTransform(lyr.getDataStore().getAffineTransform());
+		}
+		activeButtons();
+	}
+	
+	/**
+	 * Carga los par�metros en el dialogo a partir de la capa
+	 * @param lyr Capa raster
+	 */
+	public void loadTransform(AffineTransform at) {
+		geolocationPanel.loadTransform(at);
+	}
+	
+	/**
+	 * Activa o desactiva los botones de transformaci�n anterior y siguiente dependiendo
+	 * del estado de la lista de transformaciones.
+	 * @return
+	 */
+	public void applyTransformation() {
+		geolocationPanel.setModify(true);
+		geolocationPanel.activeButtons();	
+	}
+	/**
+	 * Obtiene el panel con el histograma
+	 * @return HistogramPanel
+	 */
+	public GeoLocationOpeningRasterPanel getGeoLocationPanel(){
+		if (geolocationPanel == null) 
+			geolocationPanel = new GeoLocationOpeningRasterPanel(this);
+		
+		return geolocationPanel;
+	}
+
+	/**
+	 * Activa o desactiva los botones de transformaci�n anterior y siguiente dependiendo
+	 * del estado de la lista de transformaciones.
+	 * @return
+	 */
+	public void activeButtons() {
+		getGeoLocationPanel().activeButtons();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.andami.ui.mdiManager.IWindow#getWindowInfo()
+	 */
+	public WindowInfo getWindowInfo() {
+		WindowInfo m_viewinfo=new WindowInfo(WindowInfo.MODALDIALOG);
+		m_viewinfo.setHeight(heightWindow);
+		m_viewinfo.setWidth(widthWindow);
+		/*m_viewinfo.setX(posWindowX);
+		m_viewinfo.setY(posWindowY);*/
+		return m_viewinfo;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.andami.ui.mdiManager.IWindowListener#windowActivated()
+	 */
+	public void windowActivated() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.andami.ui.mdiManager.IWindowListener#windowClosed()
+	 */
+	public void windowClosed() {
+		//Se consulta si se desean salvar los cambios
+		if(geolocationPanel.getModify()) {
+			if(RasterSwingLibrary.messageBoxYesOrNot(Messages.getText("aviso_salir_salvando"), geolocationPanel)) {
+				try {
+					geolocationPanel.getLayer().saveGeoToRmf();
+				} catch (RmfSerializerException e1) {
+					RasterSwingLibrary.messageBoxError(Messages.getText("error_salvando_rmf"), geolocationPanel, e1);
+				}
+			}
+			geolocationPanel.setModify(false);
+		}
+	}
+
+	public Object getWindowProfile() {
+		return WindowInfo.DIALOG_PROFILE;
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationOpeningRasterDialog.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationOpeningRasterPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationOpeningRasterPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationOpeningRasterPanel.java	(revision 8183)
@@ -0,0 +1,271 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.geolocation.ui;
+
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.GridLayout;
+import java.awt.geom.AffineTransform;
+
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JTabbedPane;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.gui.beans.datainput.DataInputContainer;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.tools.app.basic.tool.geolocation.listener.GeoLocationPanelListener;
+
+
+/**
+ * Panel de geolocalizaci�n. Este muestra los par�metros de la matriz de transformaci�n
+ * que est� aplicandose en esos momentos al raster. Tenemos tambi�n la posibilidad de introducir
+ * los par�metros con las esquinas superior derecha e inferior izquierda.
+ * 
+ * @version 12/12/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class GeoLocationOpeningRasterPanel extends GeolocationBaseClassPanel {
+	private static final long                       serialVersionUID = -7797379892312214949L;
+	
+	private JButton                                 apply = null;
+	private JButton                                 cancel = null;
+		 
+	private JTabbedPane			                    coordsPanel = null;
+	private JPanel			                        paramsPanel = null;
+	private JPanel			                        buttonsPanel = null;
+
+	private GeoLocationOpeningRasterCornersPanel    cornersPanel = null;
+	private GeoLocationOpeningRasterTransfPanel     transfPanel = null;
+	private GeoLocationOpeningRasterDialog          parent = null;
+   
+	/**
+	 * Constructor
+	 */
+	public GeoLocationOpeningRasterPanel(GeoLocationOpeningRasterDialog parent) {
+		this.parent = parent;
+		listener = new GeoLocationPanelListener(this, null);
+		transfPanel = new GeoLocationOpeningRasterTransfPanel(listener);
+		cornersPanel = new GeoLocationOpeningRasterCornersPanel(listener);
+		
+		GridBagLayout gl = new GridBagLayout();
+		this.setLayout(gl);
+				
+		apply = new JButton(PluginServices.getText(this,"apply"));
+		apply.setPreferredSize(new Dimension(64,24));
+		apply.addActionListener(listener);
+				
+		cancel = new JButton(PluginServices.getText(this,"cancel"));
+		cancel.setPreferredSize(new Dimension(64,24));
+		cancel.addActionListener(listener);
+						
+		getJTabbedPane();
+		
+		paramsPanel = new JPanel();
+		GridLayout l1 = new GridLayout(2, 2);
+		l1.setVgap(2);
+		paramsPanel.setLayout(l1);
+
+		getButtonsPanel();
+		
+		init();
+	}
+
+	/**
+	 * Obtiene el dialogo que contiene al panel.
+	 * @return GeoLocationOpeningRasterDialog
+	 */
+	public GeoLocationOpeningRasterDialog getDialog() {
+		return parent;
+	}
+	
+	/**
+	 * Obtiene el panel con los Tabs
+	 * @return
+	 */
+	private JTabbedPane getJTabbedPane() {
+		if(coordsPanel == null) {
+			coordsPanel = new JTabbedPane();
+			coordsPanel.addTab(PluginServices.getText(this,"transf"), transfPanel);
+			coordsPanel.addTab(PluginServices.getText(this, "corners"), cornersPanel);
+		}
+		return coordsPanel;
+	}
+
+	private void init() {
+		JPanel applyButton = new JPanel();
+		applyButton.setLayout(new GridBagLayout());
+		
+		GridBagConstraints gbc = new GridBagConstraints();
+		gbc.insets = new java.awt.Insets(1, 0, 0, 2);
+				
+		gbc.gridx = 0;
+		gbc.gridy = 0;
+		gbc.anchor = GridBagConstraints.EAST;
+		applyButton.add(apply, gbc);
+		gbc.gridx = 1;
+		applyButton.add(cancel, gbc);
+		
+		gbc.gridy = 1;
+		gbc.weightx = 1.0;
+		buttonsPanel.add(applyButton, gbc);
+		
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.gridx = 0;
+		gbc.gridy = 0;
+		gbc.insets = new java.awt.Insets(1, 1, 1, 1);
+		this.add(coordsPanel, gbc);
+		
+		gbc.gridy = 1;
+		this.add(paramsPanel, gbc);
+		gbc.weightx = 1.0;
+		gbc.gridy = 2;
+		this.add(buttonsPanel, gbc);
+	}
+	
+	/**
+	 * Obtiene el panel con los botones
+	 * @return JPanel
+	 */
+	public JPanel getButtonsPanel() {
+		if(buttonsPanel == null) {
+			buttonsPanel = new JPanel();
+			buttonsPanel.setLayout(new GridBagLayout());
+			//buttonsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+		}
+		return buttonsPanel;
+	}
+	
+	/**
+	 * Asigna la capa raster del raster seleccionado en el TOC en base 
+	 * al cual se asigna la georreferenciaci�n al dialogo.
+	 * @param lyr
+	 */
+	public void setParams(FLyrRaster lyr) {
+		setLayer(lyr);
+		if(transfPanel != null)
+			transfPanel.setLayer(lyr);
+		if(cornersPanel != null)
+			cornersPanel.setLayer(lyr);
+		loadTransform(lyr.getDataStore().getAffineTransform());
+	}
+	
+	/**
+	 * Carga los par�metros en el dialogo a partir de la capa
+	 * @param lyr Capa raster
+	 */
+	public void loadTransform(AffineTransform at) {
+		transfPanel.loadTransform(at);
+		cornersPanel.loadTransform(at);
+	}
+	
+	/**
+	 * Obtiene el bot�n de aplicar
+	 * @return JButton
+	 */
+	public JButton getApplyButton() {
+		return apply;
+	}
+	
+	/**
+	 * Obtiene el bot�n de cancelar
+	 * @return JButton
+	 */
+	public JButton getCancelButton() {
+		return cancel;
+	}
+	
+	/**
+	 * Obtiene el tama�o de pixel en X
+	 * @return
+	 */
+	public DataInputContainer getPsx() {
+		if(coordsPanel.getSelectedComponent() == transfPanel)
+			return transfPanel.getPsx();
+		if(coordsPanel.getSelectedComponent() == cornersPanel)
+			return cornersPanel.getPsx();
+		return null;
+	}
+
+	/**
+	 * Obtiene el tama�o de pixel en Y
+	 * @return
+	 */
+	public DataInputContainer getPsy() {
+		if(coordsPanel.getSelectedComponent() == transfPanel)
+			return transfPanel.getPsy();
+		if(coordsPanel.getSelectedComponent() == cornersPanel)
+			return cornersPanel.getPsy();
+		return null;
+	}
+
+	/**
+	 * Obtiene la rotaci�n en X
+	 * @return
+	 */
+	public DataInputContainer getRotx() {
+		if(coordsPanel.getSelectedComponent() == transfPanel)
+			return transfPanel.getRotx();
+		if(coordsPanel.getSelectedComponent() == cornersPanel)
+			return cornersPanel.getRotx();
+		return null;
+	}
+
+	/**
+	 * Obtiene la rotaci�n en Y
+	 * @return
+	 */
+	public DataInputContainer getRoty() {
+		if(coordsPanel.getSelectedComponent() == transfPanel)
+			return transfPanel.getRoty();
+		if(coordsPanel.getSelectedComponent() == cornersPanel)
+			return cornersPanel.getRoty();
+		return null;
+	}
+
+	/**
+	 * Obtiene la X de la coordenada superior izquierda
+	 * @return
+	 */
+	public DataInputContainer getUlx() {
+		if(coordsPanel.getSelectedComponent() == transfPanel)
+			return transfPanel.getUlx();
+		if(coordsPanel.getSelectedComponent() == cornersPanel)
+			return cornersPanel.getUlx();
+		return null;
+	}
+
+	/**
+	 * Obtiene la Y de la coordenada superior izquierda
+	 * @return
+	 */
+	public DataInputContainer getUly() {
+		if(coordsPanel.getSelectedComponent() == transfPanel)
+			return transfPanel.getUly();
+		if(coordsPanel.getSelectedComponent() == cornersPanel)
+			return cornersPanel.getUly();
+		return null;
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeoLocationOpeningRasterPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeolocationBaseClassPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeolocationBaseClassPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeolocationBaseClassPanel.java	(revision 8183)
@@ -0,0 +1,257 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.geolocation.ui;
+
+import java.awt.geom.AffineTransform;
+
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+import org.gvsig.fmap.dal.coverage.util.Historical;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.gui.beans.datainput.DataInputContainer;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.tools.app.basic.tool.geolocation.listener.GeoLocationPanelListener;
+/**
+ * Clase base para los paneles que tienen la geolocalizaci�n. Tiene los m�todos necesarios
+ * para que el listener que gestiona sus acciones sea com�n.
+ * 
+ * 13/12/2007
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public abstract class GeolocationBaseClassPanel extends JPanel {
+	private static final long          serialVersionUID = 1055900686557565837L;
+	private FLyrRaster                 lyr              = null;
+	private boolean                    geolocModify     = false;
+	private MapControl                 mapCtrl          = null;
+	private ViewPort                   vp               = null;
+	protected GeoLocationPanelListener listener         = null;
+
+	/**
+	 * N�mero de decimales a mostrar
+	 */
+	protected int                      tailValue    = 2;
+	
+	/**
+	 * Obtiene la capa raster asociada
+	 * @return
+	 */
+	public FLyrRaster getLayer() {
+		return this.lyr;
+	}
+	
+	/**
+	 * Asigna la capa raster asociada
+	 * @return
+	 */
+	public void setLayer(FLyrRaster lyr) {
+		this.lyr = lyr;
+	}
+	
+	/**
+	 * Obtiene el viewport de la vista en el momento de lanzar el interfaz
+	 * @return
+	 */
+	public ViewPort getViewPort() {
+		return this.vp;
+	}
+	
+	/**
+	 * Asigna el viewport de la vista en el momento de lanzar el interfaz
+	 * @return
+	 */
+	public void setViewPort(ViewPort vp) {
+		this.vp = vp;
+	}
+	
+	/**
+	 * Obtiene el MapControl
+	 * @return MapControl
+	 */
+	public MapControl getMapCtrl() {
+		return mapCtrl;
+	}
+	
+	/**
+	 * Asigna el MapControl
+	 * @param mapCtrl
+	 */
+	public void setMapCtrl(MapControl mapCtrl) {
+		this.mapCtrl = mapCtrl;
+	}
+	
+	/**
+	 * Carga los par�metros en el dialogo a partir de la capa
+	 * @param lyr Capa raster
+	 */
+	public abstract void loadTransform(AffineTransform at);
+	
+	/**
+	 * Activa o desactiva los botones de transformaci�n anterior y siguiente dependiendo
+	 * del estado de la lista de transformaciones.
+	 * @return
+	 */
+	public void activeButtons() {}
+	
+	/**
+	 * Asigna el flag que dice si se ha modificado la georreferenciaci�n
+	 * y a�n no se ha salvado
+	 * @return true si se ha modificado y false si no se ha hecho
+	 */
+	public void setModify(boolean modif) {
+		geolocModify = modif;
+	}
+	
+	/**
+	 * Obtiene el flag que dice si se ha modificado la georreferenciaci�n
+	 * y a�n no se ha salvado
+	 * @return true si se ha modificado y false si no se ha hecho
+	 */
+	public boolean getModify() {
+		return geolocModify;
+	}
+	
+	/**
+	 * Obtiene el bot�n de aplicar
+	 * @return JButton
+	 */
+	public JButton getApplyButton() {
+		return null;
+	}
+	
+	/**
+	 * Obtiene el bot�n de cancelar
+	 * @return JButton
+	 */
+	public JButton getCancelButton() {
+		return null;
+	}
+
+	/**
+	 * Obtiene el bot�n de atr�s
+	 * @return JButton
+	 */
+	public JButton getBackButton() {
+		return null;
+	}
+
+	/**
+	 * Obtiene el bot�n de ir a la primera transformaci�n
+	 * @return JButton
+	 */
+	public JButton getFirstButton() {
+		return null;
+	}
+
+	/**
+		 * Obtiene el bot�n de salvar
+	 * @return JButton
+	 */
+	public JButton getSaveButton() {
+		return null;
+	}
+	
+	/**
+		 * Obtiene el bot�n de reset
+	 * @return JButton
+	 */
+	public JButton getResetButton() {
+		return null;
+	}
+	
+	/**
+	 * Obtiene el bot�n de siguiente transformaci�n
+	 * @return JButton
+	 */
+	public JButton getNextButton() {
+		return null;
+	}
+	
+	/**
+	 * Obtiene el bot�n de carga de georreferenciaci�n desde tfw
+	 * @return JButton
+	 */
+	public JButton getTfwLoad() {
+		return null;
+	}
+
+	/**
+	 * Obtiene el bot�n de centrado de raster en la vista
+	 * @return JButton
+	 */
+	public JButton getCenterToView() {
+		return null;
+	}
+	
+	/**
+	 * Obtiene el bot�n de recuperaci�n del foco de la tool
+	 * @return JButton
+	 */
+	public JButton getFocus() {
+		return null;
+	}
+	
+	/**
+	 * Obtiene el tama�o de pixel en X
+	 * @return
+	 */
+	public abstract DataInputContainer getPsx();
+
+	/**
+	 * Obtiene el tama�o de pixel en Y
+	 * @return
+	 */
+	public abstract DataInputContainer getPsy();
+
+	/**
+	 * Obtiene la rotaci�n en X
+	 * @return
+	 */
+	public abstract DataInputContainer getRotx();
+
+	/**
+	 * Obtiene la rotaci�n en Y
+	 * @return
+	 */
+	public abstract DataInputContainer getRoty();
+
+	/**
+	 * Obtiene la X de la coordenada superior izquierda
+	 * @return
+	 */
+	public abstract DataInputContainer getUlx();
+
+	/**
+	 * Obtiene la Y de la coordenada superior izquierda
+	 * @return
+	 */
+	public abstract DataInputContainer getUly();
+		
+	/**
+	 * Obtiene el historico de transformaciones
+	 * @return Historical
+	 */
+	public Historical getHistorical() {
+		return lyr.getAffineTransformHistorical();
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui/GeolocationBaseClassPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation/ui
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/geolocation
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/EnhancedHistogramController.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/EnhancedHistogramController.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/EnhancedHistogramController.java	(revision 8183)
@@ -0,0 +1,209 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.app.basic.tool.enhanced.ui;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.raster.swing.gcanvas.StraightLine;
+import org.gvsig.raster.tools.app.basic.tool.enhanced.graphics.HistogramGraphicBase;
+import org.gvsig.raster.tools.app.basic.tool.enhanced.graphics.InputHistogram;
+import org.gvsig.raster.tools.app.basic.tool.enhanced.graphics.OutputHistogram;
+import org.gvsig.raster.tools.app.basic.tool.enhanced.graphics.HistogramGraphicBase.HistogramStatus;
+/**
+ * Manager para actualizar la vista previa y el histograma de salida del cuadro
+ * de realce
+ * 
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public class EnhancedHistogramController {
+	private InputHistogram  inputHistogram  = null;
+	private OutputHistogram outputHistogram = null;
+	private EnhancedDialog  enhancedDialog  = null;
+
+	public EnhancedHistogramController(InputHistogram inputHistogram, OutputHistogram outputHistogram, EnhancedDialog enhancedDialog) {
+		this.inputHistogram = inputHistogram;
+		this.outputHistogram = outputHistogram;
+		this.enhancedDialog = enhancedDialog;
+	}
+	
+	private void renderingAsGray(HistogramStatus histogram, Params params) {
+		if (histogram.getBaseFunction() instanceof StraightLine) {
+			StraightLine line = (StraightLine) histogram.getBaseFunction();
+			double[] valuesIn;
+			if (enhancedDialog.getGraphicsPanel().getRGB().isSelected())
+				valuesIn = line.getInValues(0, 255);
+			else
+				valuesIn = line.getInValues(histogram.getMin(), histogram.getMax());
+			int[] valuesOut = line.getOutValues();
+			params.setParam("StretchInRed", valuesIn, -1, null);
+			params.setParam("StretchOutRed", valuesOut, -1, null);
+			params.setParam("StretchRedFunctionType", Integer.valueOf(line.getFunctionType()), -1, null);
+			params.setParam("StretchRedValueFunction", Double.valueOf(line.getValueFunction()), -1, null);
+			params.setParam("StretchInGreen", valuesIn, -1, null);
+			params.setParam("StretchOutGreen", valuesOut, -1, null);
+			params.setParam("StretchGreenFunctionType", Integer.valueOf(line.getFunctionType()), -1, null);
+			params.setParam("StretchGreenValueFunction", Double.valueOf(line.getValueFunction()), -1, null);
+			params.setParam("StretchInBlue", valuesIn, -1, null);
+			params.setParam("StretchOutBlue", valuesOut, -1, null);
+			params.setParam("StretchBlueFunctionType", Integer.valueOf(line.getFunctionType()), -1, null);
+			params.setParam("StretchBlueValueFunction", Double.valueOf(line.getValueFunction()), -1, null);
+		}
+	}
+	
+	private void renderingAsColor(HistogramStatus histogram, 
+			Params params, 
+			String inColorLabel, 
+			String outColorLabel, 
+			String functionTypeLabel, 
+			String valueFunctionLabel) {
+		if (histogram != null) {
+			if (histogram.getBaseFunction() instanceof StraightLine) {
+				StraightLine line = (StraightLine) histogram.getBaseFunction();
+				double[] valuesIn;
+				if (enhancedDialog.getGraphicsPanel().getRGB().isSelected())
+					valuesIn = line.getInValues(0, 255);
+				else
+					valuesIn = line.getInValues(histogram.getMin(), histogram.getMax());
+				int[] valuesOut = line.getOutValues();
+
+				params.setParam(inColorLabel, valuesIn, -1, null);
+				params.setParam(outColorLabel, valuesOut, -1, null);
+				params.setParam(functionTypeLabel, Integer.valueOf(line.getFunctionType()), -1, null);
+				params.setParam(valueFunctionLabel, Double.valueOf(line.getValueFunction()), -1, null);
+			}
+		}
+	}
+	
+	public void updatePreview() {
+		Params params = RasterLocator.getManager().createParams("", 0, 0, null);
+		HistogramStatus histogram = null;
+		
+		if (enhancedDialog.getLayer().getRender().isRenderingAsGray()) {
+			histogram = inputHistogram.getHistogramStatus(HistogramGraphicBase.GRAY);
+			renderingAsGray(histogram, params);
+		} else {
+			histogram = inputHistogram.getHistogramStatus(HistogramGraphicBase.RED);
+			if (histogram != null) {
+				renderingAsColor(
+						histogram, 
+						params, 
+						"StretchInRed", 
+						"StretchOutRed", 
+						"StretchRedFunctionType", 
+						"StretchRedValueFunction");
+			}
+			histogram = inputHistogram.getHistogramStatus(HistogramGraphicBase.GREEN);
+			if (histogram != null) {
+				renderingAsColor(
+						histogram, 
+						params, 
+						"StretchInGreen", 
+						"StretchOutGreen", 
+						"StretchGreenFunctionType", 
+						"StretchGreenValueFunction");
+			}
+			histogram = inputHistogram.getHistogramStatus(HistogramGraphicBase.BLUE);
+			if (histogram != null) {
+				renderingAsColor(
+						histogram, 
+						params, 
+						"StretchInBlue", 
+						"StretchOutBlue", 
+						"StretchBlueFunctionType", 
+						"StretchBlueValueFunction");
+			}
+		}
+		
+		params.setParam("TailTrimRedMin",   Double.valueOf(0.0D), -1, null);
+		params.setParam("TailTrimRedMax",   Double.valueOf(0.0D), -1, null);
+		params.setParam("TailTrimGreenMin", Double.valueOf(0.0D), -1, null);
+		params.setParam("TailTrimGreenMax", Double.valueOf(0.0D), -1, null);
+		params.setParam("TailTrimBlueMin",  Double.valueOf(0.0D), -1, null);
+		params.setParam("TailTrimBlueMax",  Double.valueOf(0.0D), -1, null);
+		
+		boolean rgb = enhancedDialog.getGraphicsPanel().getRGB().isSelected();
+		
+		params.setParam("RGB", new Boolean(rgb), -1, null);
+		
+		int[] renderBands = enhancedDialog.getLayer().getRender().getRenderColorInterpretation().buildRenderBands();
+		String render = "";
+		for (int i = 0; i < renderBands.length; i++) {
+			if (render != "")
+				render += " ";
+			render = render + "" + renderBands[i];
+		}
+		params.setParam("RenderBands", render, -1, null);
+
+		enhancedDialog.getFilteredPreview().getParamsList().clear();
+		Class<?> filterClass = enhancedDialog.getLayer().getRender().getFilterList().getFilterClassByID("enhanced_stretch");
+		enhancedDialog.getFilteredPreview().addNewParam("enhanced_stretch", params, filterClass);
+		
+		enhancedDialog.getPreviewBasePanel().refreshPreview();
+	}
+
+	/**
+	 * Actualiza el histograma de salida del cuadro de realce
+	 */
+	public void updateHistogramOut() {
+		HistogramStatus histogram = inputHistogram.getHistogramStatus(HistogramGraphicBase.DRAWED);
+		if (histogram != null) {
+			if (histogram.getBaseFunction() instanceof StraightLine) {
+				StraightLine line = (StraightLine) histogram.getBaseFunction();
+				double[] valuesIn = line.getPercentInValues();
+				double[] valuesOut = line.getPercentOutValues();
+
+				double origenHistogram[] = inputHistogram.getHistogramStatus(HistogramGraphicBase.DRAWED).getHistogram();
+				double newHistogram[] = new double[origenHistogram.length];
+
+				for (int i = 0; i < newHistogram.length; i++)
+					newHistogram[i] = 0.0D;
+
+				int pos;
+				double p;
+				for (int i = 0; i < origenHistogram.length; i++) {
+					p = (((double) i) / (origenHistogram.length - 1.0D));
+					
+					for (int j = 0; j < (valuesIn.length - 1); j++) {
+						if (valuesIn[j] == valuesIn[j + 1]) continue;
+						if (p >= valuesIn[j] && p <= valuesIn[j + 1]) {
+							p = valuesOut[j] + ((valuesOut[j + 1] - valuesOut[j]) * ((p - valuesIn[j]) / (valuesIn[j + 1] - valuesIn[j])));
+							break;
+						}
+					}
+
+					pos = (int) Math.round(p * (origenHistogram.length - 1.0D));
+					if (pos < 0)
+						pos = 0;
+					if (pos > (origenHistogram.length - 1))
+						pos = (origenHistogram.length - 1);
+
+					newHistogram[pos] += origenHistogram[i];
+				}
+
+				HistogramStatus histogramOut = outputHistogram.getHistogramStatus(HistogramGraphicBase.DRAWED);
+				histogramOut.setHistogram(newHistogram);
+				histogramOut.setLimits(0.0D, 255.0D);
+				outputHistogram.repaint();
+			}
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/EnhancedHistogramController.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/EnhancedListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/EnhancedListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/EnhancedListener.java	(revision 8183)
@@ -0,0 +1,582 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.app.basic.tool.enhanced.ui;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.geom.Point2D;
+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.Stretch;
+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.filter.LinearStretchParams;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.swing.RasterSwingLocator;
+import org.gvsig.raster.swing.gcanvas.BaseFunction;
+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.LogaritmicExponentialLine;
+import org.gvsig.raster.swing.gcanvas.SquareRootPowLine;
+import org.gvsig.raster.swing.gcanvas.StraightLine;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.raster.bean.previewbase.ParamStruct;
+import org.gvsig.raster.tools.app.basic.raster.process.FilterProcess;
+import org.gvsig.raster.tools.app.basic.raster.process.IProcessActions;
+import org.gvsig.raster.tools.app.basic.tool.enhanced.graphics.HistogramGraphicBase;
+import org.gvsig.raster.tools.app.basic.tool.enhanced.graphics.HistogramGraphicBase.HistogramStatus;
+import org.gvsig.raster.util.LayerVisualStatusList;
+import org.gvsig.raster.util.RasterNotLoadException;
+
+/**
+ * Gestor de eventos de los paneles de gr�ficas y controles.
+ * 
+ * 21/02/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class EnhancedListener implements ActionListener, IGCanvasListener, ButtonsPanelListener, IProcessActions {
+	private SelectorsPanel               selectorsPanel  = null;
+	private GraphicsPanel                graphicsPanel   = null;
+	private EnhancedDialog               enhancedDialog  = null;
+	private PreviewFiltering             filteredPreview = null;
+	private EnhancedHistogramController  enhancedManager = null;
+	private LayerVisualStatusList        status          = new LayerVisualStatusList();
+	
+	/**
+	 * Constructor
+	 * @param selectorsPanel Panel con los selectores de opciones
+	 * @param graphicsPanel Panel con los gr�ficos
+	 * @param enhancedPanel Panel base con la previsualizaci�n
+	 * @param enhancedDialog Dialogo general
+	 * @param filteredPreview Preprocesado para la preview
+	 */
+	public EnhancedListener(SelectorsPanel selectorsPanel, 
+							GraphicsPanel graphicsPanel, 
+							EnhancedDialog enhancedDialog, 
+							PreviewFiltering filteredPreview) {
+		this.selectorsPanel = selectorsPanel;
+		this.graphicsPanel = graphicsPanel;
+		this.enhancedDialog = enhancedDialog;
+		this.filteredPreview = filteredPreview;
+		status.getVisualStatus(((FLyrRaster) enhancedDialog.getLayer()));
+		
+		
+		enhancedManager = new EnhancedHistogramController(graphicsPanel.getInputHistogram(), graphicsPanel.getOutputHistogram(), enhancedDialog);
+		
+		selectorsPanel.getHistogramType().addActionListener(this);
+		selectorsPanel.getDrawType().addActionListener(this);
+		selectorsPanel.getBand(null).addActionListener(this);
+		selectorsPanel.getEnhancedType().addActionListener(this);
+		graphicsPanel.getLevels().addActionListener(this);
+		graphicsPanel.getRGB().addActionListener(this);
+	}
+	
+	public void actionPerformed(ActionEvent e) {
+		//Cambio del tipo de de dibujado del histograma
+		if(e.getSource() == selectorsPanel.getDrawType()) {
+			if(((String)selectorsPanel.getDrawType().getSelectedItem()).equals(Messages.getText("fill"))) {
+				graphicsPanel.getInputHistogram().setType(GraphicHistogram.TYPE_FILL);
+				graphicsPanel.getOutputHistogram().setType(GraphicHistogram.TYPE_FILL);
+			}
+			
+			if(((String)selectorsPanel.getDrawType().getSelectedItem()).equals(Messages.getText("line"))) {
+				graphicsPanel.getInputHistogram().setType(GraphicHistogram.TYPE_LINE);
+				graphicsPanel.getOutputHistogram().setType(GraphicHistogram.TYPE_LINE);
+			}
+			((Component)graphicsPanel.getInputHistogram().getCanvas()).repaint();
+			((Component)graphicsPanel.getOutputHistogram().getCanvas()).repaint();
+		}
+
+		// Cambio el tipo de visualizacion del histograma
+		if (e.getSource() == selectorsPanel.getHistogramType()) {
+			if (((String) selectorsPanel.getHistogramType().getSelectedItem()).equals(Messages.getText("standard"))) {
+				graphicsPanel.getOutputHistogram().setHistogramType(GraphicHistogram.VIEW_LINEAL);
+			}
+			
+			if (((String) selectorsPanel.getHistogramType().getSelectedItem()).equals(Messages.getText("cumulative"))) {
+				graphicsPanel.getOutputHistogram().setHistogramType(GraphicHistogram.VIEW_ACUMMULATED);
+			}
+			
+			if (((String) selectorsPanel.getHistogramType().getSelectedItem()).equals(Messages.getText("logaritmic"))) {
+				graphicsPanel.getOutputHistogram().setHistogramType(GraphicHistogram.VIEW_LOGARITHMIC);
+			}
+			
+			if (((String) selectorsPanel.getHistogramType().getSelectedItem()).equals(Messages.getText("cumulative_logarithmic"))) {
+				graphicsPanel.getOutputHistogram().setHistogramType(GraphicHistogram.VIEW_ACUMMULATEDLOG);
+			}
+			((Component)graphicsPanel.getOutputHistogram().getCanvas()).repaint();
+		}
+
+		// Seleccion de modo RGB o normal
+		if (e.getSource() == graphicsPanel.getRGB()) {
+			graphicsPanel.updateHistogram();
+			updatePreview();
+		}
+		
+		//Cambio de banda
+		if(e.getSource() == selectorsPanel.getBand(null)) {
+			if(((String)selectorsPanel.getBand(null).getSelectedItem()).equals(Messages.getText("red"))) {
+				graphicsPanel.getInputHistogram().setHistogramDrawed(HistogramGraphicBase.RED);
+				graphicsPanel.getOutputHistogram().setHistogramDrawed(HistogramGraphicBase.RED);
+			}
+			
+			if(((String)selectorsPanel.getBand(null).getSelectedItem()).equals(Messages.getText("green"))) {
+				graphicsPanel.getInputHistogram().setHistogramDrawed(HistogramGraphicBase.GREEN);
+				graphicsPanel.getOutputHistogram().setHistogramDrawed(HistogramGraphicBase.GREEN);
+			}
+			
+			if(((String)selectorsPanel.getBand(null).getSelectedItem()).equals(Messages.getText("blue"))) {
+				graphicsPanel.getInputHistogram().setHistogramDrawed(HistogramGraphicBase.BLUE);
+				graphicsPanel.getOutputHistogram().setHistogramDrawed(HistogramGraphicBase.BLUE);
+			}
+
+			updateTypeSelected();
+			
+			HistogramStatus status = graphicsPanel.getOutputHistogram().getHistogramStatus(HistogramGraphicBase.DRAWED);
+
+			switch (status.getGraphicHistogram().getType()) {
+				case GraphicHistogram.TYPE_FILL:
+					selectorsPanel.getDrawType().setSelectedItem(Messages.getText("fill"));
+					break;
+				default:
+					selectorsPanel.getDrawType().setSelectedItem(Messages.getText("line"));
+					break;
+			}
+
+			switch (status.getGraphicHistogram().getTypeViewed()) {
+				case GraphicHistogram.VIEW_ACUMMULATED:
+					selectorsPanel.getHistogramType().setSelectedItem(Messages.getText("cumulative"));
+					break;
+				case GraphicHistogram.VIEW_LOGARITHMIC:
+					selectorsPanel.getHistogramType().setSelectedItem(Messages.getText("logaritmic"));
+					break;
+				case GraphicHistogram.VIEW_ACUMMULATEDLOG:
+					selectorsPanel.getHistogramType().setSelectedItem(Messages.getText("cumulative_logarithmic"));
+					break;
+				default:
+					selectorsPanel.getHistogramType().setSelectedItem(Messages.getText("standard"));
+					break;
+			}
+		}
+		
+		//Cambio de operaci�n
+		if(e.getSource() == selectorsPanel.getEnhancedType()) {
+			graphicsPanel.setLevelsEnabled(false);
+			
+			if(((String)selectorsPanel.getEnhancedType().getSelectedItem()).equals(Messages.getText("lineal"))) {
+				graphicsPanel.getInputHistogram().setFunction(GraphicHistogram.FUNCTION_LINEAL);
+				updatePreview();
+			}
+			
+			if(((String)selectorsPanel.getEnhancedType().getSelectedItem()).equals(Messages.getText("gaussian"))) {
+
+			}
+			
+			if(((String)selectorsPanel.getEnhancedType().getSelectedItem()).equals(Messages.getText("logaritmic"))) {
+				graphicsPanel.getInputHistogram().setFunction(GraphicHistogram.FUNCTION_LOGARIT);
+				updatePreview();
+			}
+			
+			if(((String)selectorsPanel.getEnhancedType().getSelectedItem()).equals(Messages.getText("exponential"))) {
+				graphicsPanel.getInputHistogram().setFunction(GraphicHistogram.FUNCTION_EXPONENT);
+				updatePreview();
+			}
+			
+			if(((String)selectorsPanel.getEnhancedType().getSelectedItem()).equals(Messages.getText("equalization"))) {
+				graphicsPanel.getInputHistogram().setFunction(GraphicHistogram.FUNCTION_NONE);
+				int[] renderBands = enhancedDialog.getLayer().getRender().getRenderColorInterpretation().buildRenderBands();
+				String values = "";
+				for (int i = 0; i < renderBands.length; i++) 
+					values += renderBands[i] + " ";
+				values = values.trim();
+				Params params = RasterLocator.getManager().createParams("", 0, 0, null);
+				params.setParam("Histogram", graphicsPanel.getHistogram(), -1, null);
+				params.setParam("RenderBands", values, -1, null);
+				params.setParam("EcualizedBands", new int[]{0, 1, 2}, -1, null);
+						
+				Class<?> filterClass = enhancedDialog.getLayer().getRender().getFilterList().getFilterClassByID("equalization");
+				filteredPreview.addNewParam("equalization", params, filterClass);				
+				updatePreview();
+			}
+			
+			if(((String)selectorsPanel.getEnhancedType().getSelectedItem()).equals(Messages.getText("square_root"))) {
+				graphicsPanel.getInputHistogram().setFunction(GraphicHistogram.FUNCTION_SQUARE_ROOT);
+				updatePreview();
+			}
+			
+			if(((String)selectorsPanel.getEnhancedType().getSelectedItem()).equals(Messages.getText("level_slice"))) {
+				graphicsPanel.setLevelsEnabled(true);
+				graphicsPanel.getInputHistogram().setFunction(GraphicHistogram.FUNCTION_DENSITY);
+
+				// Establece el numero de niveles en el cuadro de texto
+				HistogramStatus status = graphicsPanel.getInputHistogram().getHistogramStatus(HistogramGraphicBase.DRAWED);
+				graphicsPanel.getLevels().setValue(new Long(((DensitySlicingLine) status.getBaseFunction()).getLevels()));
+				updatePreview();
+			}
+		}
+		
+		//Cambio de tipo (estandar/acumulado)
+		if(e.getSource() == selectorsPanel.getHistogramType()) {
+			if(((String)selectorsPanel.getHistogramType().getSelectedItem()).equals(Messages.getText("standard"))) {
+				
+			}
+			
+			if(((String)selectorsPanel.getHistogramType().getSelectedItem()).equals(Messages.getText("cumulative"))) {
+				
+			}
+		}
+		
+		//Cambio en el n�mero de niveles
+		if(e.getSource() == graphicsPanel.getLevels()) {
+			Long lValue = (Long)graphicsPanel.getLevels().getValue();
+			int value = lValue.intValue();
+			if(value > 30 || value < 2) {
+				RasterSwingLibrary.messageBoxInfo(Messages.getText("range_wrong") + " [2-30]", graphicsPanel);
+				if(value > 30)
+					value = 30;
+				if(value < 2)
+					value = 2;
+			}
+			graphicsPanel.getLevels().setValue(new Long(value));
+			try {
+				graphicsPanel.getInputHistogram().setLevel(value);
+				updatePreview();
+			} catch (NumberFormatException exc) {
+				//No asignamos el nivel
+			}
+		}
+	}
+	
+	/**
+	 * Actualiza el combo de EnhancedType para que este seleccionado siempre el
+	 * item que corresponde con la grafica mostrada en ese momento
+	 */
+	private void updateTypeSelected() {
+		HistogramStatus status = graphicsPanel.getInputHistogram().getHistogramStatus(HistogramGraphicBase.DRAWED);
+
+		if (status.getBaseFunction().getClass().equals(DensitySlicingLine.class))
+			selectorsPanel.setSelectedEnhancedType(Messages.getText("level_slice"));
+
+		if (status.getBaseFunction().getClass().equals(StraightLine.class))
+			selectorsPanel.setSelectedEnhancedType(Messages.getText("lineal"));
+
+		Class<?> filterClass = enhancedDialog.getLayer().getRender().getFilterList().getFilterClassByID("equalization");
+		if (status.getBaseFunction().getClass().equals(filterClass))
+			selectorsPanel.setSelectedEnhancedType(Messages.getText("equalization"));
+
+		if (status.getBaseFunction().getClass().equals(SquareRootPowLine.class))
+			selectorsPanel.setSelectedEnhancedType(Messages.getText("square_root"));
+
+		if (status.getBaseFunction().getClass().equals(LogaritmicExponentialLine.class)) {
+			if (((StraightLine) status.getBaseFunction()).getValueFunction() >= 0)
+				selectorsPanel.setSelectedEnhancedType(Messages.getText("logaritmic"));
+			else
+				selectorsPanel.setSelectedEnhancedType(Messages.getText("exponential"));
+		}
+	}
+	
+	/**
+	 * Gets the list of points from the stretches
+	 * @param stretch
+	 * @return
+	 */
+	private List<Point2D> getPointListFromStretches(Stretch stretch) {
+		List<Point2D> pointList = new ArrayList<Point2D>();
+		for (int i = 0; i < stretch.getStretchIn().length; i++) {
+			Point2D p = new Point2D.Double(
+				(stretch.getStretchIn()[i] - stretch.getMinValue()) / (stretch.getMaxValue() - stretch.getMinValue()),
+				stretch.getStretchOut()[i] / 255.0D);
+			pointList.add(p);
+		}
+		simplifyPointList(pointList);
+		return pointList;
+	}
+	
+	/**
+	 * Removes the first and the last point if the coordinate X don't change.
+	 * @param pointList
+	 */
+	private double[] simplifyPointList(List<Point2D> pointList) {
+		int lastPoint = pointList.size() - 1;
+		double[]  removed = new double[2];
+		if(pointList.size() > 1) {
+			if(pointList.get(lastPoint).getX() == 1 && 
+					pointList.get(lastPoint).getY() == 1 && 
+					pointList.get(lastPoint - 1).getY() == 1) {
+				removed[0] = pointList.remove(lastPoint).getX();
+			}
+		}
+
+		if(pointList.size() > 1) {
+			if(pointList.get(0).getX() == 0 && 
+					pointList.get(0).getY() == 0 && 
+					pointList.get(1).getY() == 0) {
+				removed[1] = pointList.remove(0).getX();
+			}
+		}
+		return removed;
+	}
+	
+	/**
+	 * En la primera carga se define cada banda en los histogramas, para dejarlo en
+	 * su estado logico.
+	 * @param stretch
+	 * @param band
+	 */
+	private void firstLoadBand(Stretch stretch, int band) {
+		boolean firstBand = ((band == HistogramGraphicBase.GRAY) || (band == HistogramGraphicBase.RED));
+
+		graphicsPanel.getInputHistogram().setHistogramDrawed(band);
+		
+		BaseFunction baseFunction = null;
+		HistogramStatus status;
+		status = graphicsPanel.getInputHistogram().getHistogramStatus(band);
+		if (status == null)
+			return;
+		
+		//MinMaxLines linesLayer = status.getMinMaxLines();
+		
+		GCanvas canvas = RasterSwingLocator.getSwingManager().createGraphicCanvas(Color.white);
+		
+		switch (stretch.getFunctionType()) {
+			case 0:
+				if (firstBand) {
+					selectorsPanel.getEnhancedType().setSelectedItem(Messages.getText("lineal"));
+					graphicsPanel.setLevelsEnabled(false);
+				}
+				baseFunction = canvas.createStraightLineForGCanvas(
+						((DrawableElement)status.getBaseFunction()).getColor());
+				((StraightLine) baseFunction).clearSquares();
+				List<Point2D> pointList = getPointListFromStretches(stretch);
+				//linesLayer.setMinimum(pointList.get(0).getX());
+			    //linesLayer.setMaximum(pointList.get(pointList.size() - 1).getX());
+				
+				StraightLine func = ((StraightLine) baseFunction);
+				//((DefaultBaseFunction)func).setMinX(prueba[0]);
+				//((DefaultBaseFunction)func).setMaxX(prueba[1]);
+				
+				for (int i = 0; i < pointList.size(); i++) {
+					func.addSquare(pointList.get(i).getX(), pointList.get(i).getY());
+				}
+				break;
+			case 1:
+				if (firstBand) {
+					if (stretch.getValueFunction() >= 0)
+						selectorsPanel.getEnhancedType().setSelectedItem(Messages.getText("logaritmic"));
+					else
+						selectorsPanel.getEnhancedType().setSelectedItem(Messages.getText("exponential"));
+					graphicsPanel.setLevelsEnabled(false);
+				}
+				baseFunction = canvas.createLogaritmicExponentialLineForGCanvas(
+						((DrawableElement)status.getBaseFunction()).getColor(), stretch.getValueFunction());
+				break;
+			case 2:
+				if (firstBand) {
+					selectorsPanel.getEnhancedType().setSelectedItem(Messages.getText("square_root"));
+					graphicsPanel.setLevelsEnabled(false);
+				}
+				baseFunction = canvas.createSquareRootPowLineForGCanvas(
+						((DrawableElement)status.getBaseFunction()).getColor(), stretch.getValueFunction());
+				break;
+			case 3:
+				if (firstBand) {
+					selectorsPanel.getEnhancedType().setSelectedItem(Messages.getText("level_slice"));
+					graphicsPanel.setLevelsEnabled(true);
+				}
+				baseFunction = canvas.createDensitySliceForGCanvas(
+						((DrawableElement)status.getBaseFunction()).getColor(), (int) stretch.getValueFunction());
+				break;
+		}
+		if (baseFunction != null) {
+			status.setBaseFunction(baseFunction);
+			graphicsPanel.getInputHistogram().setHistogramDrawed(band);
+		}
+	}
+	
+	/**
+	 * En la primera carga se han de establecer todos los histogramas de entrada
+	 * a sus valores correspondientes segun el filtro.
+	 */
+	public void firstLoad() {
+		RasterFilterList rasterFilterList = enhancedDialog.getLayer().getRender().getFilterList();
+
+		RasterFilter filter = rasterFilterList.getByName("enhanced_stretch");
+		if (filter != null) {
+			LinearStretchParams stretch = (LinearStretchParams) filter.getParam("stretchs");
+			
+			firstLoadBand(stretch.getBlue(), HistogramGraphicBase.BLUE);
+			firstLoadBand(stretch.getGreen(), HistogramGraphicBase.GREEN);
+			firstLoadBand(stretch.getRed(), HistogramGraphicBase.RED);
+			firstLoadBand(stretch.getRed(), HistogramGraphicBase.GRAY);
+			graphicsPanel.getRGB().setSelected(stretch.isRgb());
+		}
+		graphicsPanel.getInputHistogram().repaint();
+	}
+	
+	/**
+	 * Coge los datos que hay en los histogramas y los aplica a la vista previa
+	 */
+	public void updatePreview() {
+		enhancedManager.updatePreview();
+		enhancedManager.updateHistogramOut();
+	}
+
+	/**
+	 * Coge los datos que hay en los histogramas y los aplica en el histograma de salida
+	 */
+	private void updateHistogramOut() {
+		updateTypeSelected();
+		enhancedManager.updatePreview();
+		enhancedManager.updateHistogramOut();
+	}
+	
+	public void actionDataChanged(GCanvasEvent e) {
+		if (e.getKey().equals("minmax")) {
+			updatePreview();
+			return;
+		}
+		if (e.getKey().equals("line")) {
+			updatePreview();
+			return;
+		}
+	}
+
+	public void actionDataDragged(GCanvasEvent e) {
+		if (e.getKey().equals("minmax")) {
+			updateHistogramOut();
+			return;
+		}
+		if (e.getKey().equals("line")) {
+			updateHistogramOut();
+			return;
+		}
+	}
+
+	public void actionButtonPressed(ButtonsPanelEvent e) {
+		switch (e.getButton()) {
+		case ButtonsPanel.BUTTON_CANCEL:
+			cancel();
+			break;
+		case ButtonsPanel.BUTTON_APPLY:
+			apply();
+			break;
+		case ButtonsPanel.BUTTON_CLOSE:
+			enhancedDialog.close();
+			break;
+		}
+	}
+	
+	/**
+	 * Que acciones se ejecutaran al haber presionado el bot�n aceptar o aplicar
+	 */
+	public void apply() {
+		FLyrRaster lyr = enhancedDialog.getLayer();
+		if (lyr == null)
+			return;
+
+		String path = null;
+		if (!enhancedDialog.getNewOrSaveLayerPanel().isOnlyViewSelected()) {
+			path = enhancedDialog.getNewOrSaveLayerPanel().getFileSelected();
+			if (path == null)
+				return;
+		}
+
+
+		// Array para guardar los filtros que se van a usar en forma de ParamStruct
+		List<ParamStruct> listFilterUsed = enhancedDialog.getFilteredPreview().applySelectedFilters(null);
+
+		if (enhancedDialog.getNewOrSaveLayerPanel().isOnlyViewSelected()) {
+			try {
+				ParamStruct.addSelectedFilters(lyr.getRender().getFilterList(), listFilterUsed);
+				enhancedDialog.getLayer().getRender().setFilterList(lyr.getRender().getFilterList());
+				enhancedDialog.getLayer().getMapContext().invalidate();
+			} catch (FilterTypeException e) {
+				RasterSwingLibrary.messageBoxError(Messages.getText("error_adding_filters"), this, e);
+			} catch (FilterManagerException e) {
+				RasterSwingLibrary.messageBoxError(Messages.getText("error_adding_filters"), this, e);
+			}
+		} else {
+			FilterProcess filterProcess = new FilterProcess();
+			filterProcess.setActions(this);
+			filterProcess.addParam("rendering", lyr);
+			filterProcess.addParam("filename", path);
+			filterProcess.addParam("rasterdatasource", lyr.getDataStore());
+			filterProcess.addParam("layer", ((FLyrRaster) enhancedDialog.getLayer()));
+			filterProcess.addParam("listfilterused", listFilterUsed);
+			filterProcess.addParam("onlyrenderbands", Boolean.TRUE);
+			filterProcess.start();
+		}
+	}
+	
+	/**
+	 * Volvemos todo a la normalidad cuando se cancela
+	 */
+	public void cancel() {
+		if (enhancedDialog.getLayer() != null) {
+			status.restoreVisualStatus(enhancedDialog.getLayer());
+			enhancedDialog.getLayer().getMapContext().invalidate();
+		}
+	}
+	
+
+	/**
+	 * Acciones que se realizan al finalizar de crear los recortes de imagen.
+	 * Este m�todo es llamado por el thread TailRasterProcess al finalizar.
+	 */
+	public void loadLayerInToc(String fileName) {
+		if (!enhancedDialog.getNewOrSaveLayerPanel().isNewLayerSelected())
+			return;
+		if(!new File(fileName).exists())
+			return;
+		try {
+			RasterToolsUtil.loadLayer(enhancedDialog.getViewName(), fileName, null);
+		} catch (RasterNotLoadException e) {
+			RasterSwingLibrary.messageBoxError("error_cargar_capa", this, e);
+		}
+
+		if(enhancedDialog != null)
+			enhancedDialog.getNewOrSaveLayerPanel().updateNewLayerText();
+	}
+
+	public void end(Object param) {
+		loadLayerInToc((String) param);
+	}
+	
+	public void interrupted() {}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/EnhancedListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/GraphicsPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/GraphicsPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/GraphicsPanel.java	(revision 8183)
@@ -0,0 +1,355 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.app.basic.tool.enhanced.ui;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.text.NumberFormat;
+
+import javax.swing.JCheckBox;
+import javax.swing.JFormattedTextField;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.text.DefaultFormatterFactory;
+import javax.swing.text.NumberFormatter;
+
+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.exception.HistogramException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.preview.PreviewBasePanelTab;
+import org.gvsig.raster.tools.app.basic.tool.enhanced.graphics.InputHistogram;
+import org.gvsig.raster.tools.app.basic.tool.enhanced.graphics.OutputHistogram;
+import org.gvsig.tools.locator.LocatorException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+/**
+ * Panel que contiene las gr�ficas para la modificaci�n del realce.
+ * 
+ * 19/02/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class GraphicsPanel extends JPanel implements PreviewBasePanelTab, KeyListener {
+	private static final long   serialVersionUID = 1L;
+	private Logger              log              = LoggerFactory.getLogger(GraphicsPanel.class);
+	private InputHistogram      input            = null;
+	private OutputHistogram     output           = null;
+	private JPanel              controls         = null;
+
+	private JLabel              llevels          = null;
+	private JFormattedTextField tlevels          = null;
+	private JCheckBox           cbRGB            = null;
+
+	private HistogramComputer           hist             = null;
+	private BufferHistogram     histRGB          = null;
+
+	private double[]            minList          = null;
+	private double[]            maxList          = null;
+	private FLyrRaster          lyr              = null;
+	
+
+	/**
+	 * Crea una instancia del panel GraphicsPanel
+	 */
+	public GraphicsPanel(FLyrRaster lyr) {
+		try {
+			this.lyr = lyr;
+			hist = lyr.getDataStore().getHistogramComputer();
+			histRGB = RasterLocator.getManager().getRasterUtils().convertHistogramToRGB(hist.getBufferHistogram());
+			minList = lyr.getDataStore().getStatistics().getMin();
+			maxList = lyr.getDataStore().getStatistics().getMax();
+			if (minList == null)
+				minList = new double[] { 0 };
+			if (maxList == null)
+				maxList = new double[] { 255 };
+		} catch (HistogramException e) {
+			hist = null;
+		} catch (LocatorException e) {
+			
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+
+		init();
+
+		if (lyr.getDataStore().getDataType()[0] == Buffer.TYPE_BYTE)
+			getRGB().setSelected(true);
+		else
+			getRGB().setEnabled(false);
+	}
+	
+	/**
+	 * Inicializaci�n de los controles gr�ficos.
+	 */
+	private void init() {
+		setLayout(new GridBagLayout());
+		setBorder(javax.swing.BorderFactory.createTitledBorder(null, Messages.getText("histograms"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+		GridBagConstraints gridBagConstraints = null;
+
+		JLabel label1 = new JLabel(Messages.getText("input_hist"));
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.insets = new Insets(4, 4, 4, 4);
+		gridBagConstraints.anchor = java.awt.GridBagConstraints.CENTER;
+		label1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
+		label1.setPreferredSize(new Dimension(150, 14));
+		add(label1, gridBagConstraints);
+		
+		JLabel label2 = new JLabel(Messages.getText("output_hist"));
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 2;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.insets = new Insets(4, 4, 4, 4);
+		gridBagConstraints.anchor = java.awt.GridBagConstraints.CENTER;
+		label2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
+		label2.setPreferredSize(new Dimension(150, 14));
+		add(label2, gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.fill = GridBagConstraints.BOTH;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.weighty = 1.0;
+		gridBagConstraints.insets = new Insets(4, 4, 4, 4);
+		add(getInputHistogram(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.fill = GridBagConstraints.VERTICAL;
+		gridBagConstraints.insets = new Insets(4, 4, 4, 4);
+		add(getControls(), gridBagConstraints);
+		
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 2;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.fill = GridBagConstraints.BOTH;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.weighty = 1.0;
+		gridBagConstraints.insets = new Insets(4, 4, 4, 4);
+		add(getOutputHistogram(), gridBagConstraints);		
+		
+		setLevelsEnabled(false);
+	}
+	
+	/**
+	 * Obtiene el histograma de entrada
+	 * @return Histogram
+	 */
+	public HistogramComputer getHistogram() {
+		return hist;
+	}
+	
+	/**
+	 * Obtiene el gr�fico con el histograma de entrada
+	 * @return InputHistogram
+	 */
+	public InputHistogram getInputHistogram() {
+		if (input == null) {
+			try {
+				input = new InputHistogram(hist.getBufferHistogram(), lyr, minList, maxList);
+				input.setHistogram(hist.getBufferHistogram(), minList, maxList);
+			} catch (ProcessInterruptedException e) {
+				log.debug("Proceso de calculo de histograma interrumpido", this, e);
+			} catch (HistogramException e) {
+				log.debug("Excepci�n en el c�lculo del histograma", this, e);
+			}
+		}
+		return input;
+	}
+	
+	/**
+	 * Actualiza el histograma a visualizar por si se ha cambiado de RGB a normal.
+	 */
+	public void updateHistogram() {
+		if (getRGB().isSelected()) {
+			double[] min = new double[minList.length];
+			double[] max = new double[maxList.length];
+			for (int i = 0; i < minList.length; i++) {
+				min[i] = 0.0;
+				max[i] = 255.0;
+			}
+			input.setHistogram(histRGB, min, max);
+		} else {
+			try {
+				input.setHistogram(hist.getBufferHistogram(), minList, maxList);
+			} catch (ProcessInterruptedException e) {
+				log.debug("Proceso de calculo de histograma interrumpido", this, e);
+			} catch (HistogramException e) {
+				log.debug("Excepci�n en el c�lculo del histograma", this, e);
+			}
+		}
+	}
+	
+	/**
+	 * Obtiene el gr�fico con el histograma de salida
+	 * @return OutputHistogram
+	 */
+	public OutputHistogram getOutputHistogram() {
+		if (output == null) {
+			try {
+				output = new OutputHistogram(hist.getBufferHistogram(), lyr, minList, maxList);
+			} catch (ProcessInterruptedException e) {
+				log.debug("Proceso de calculo de histograma interrumpido", this, e);
+			} catch (HistogramException e) {
+				log.debug("Excepci�n en el c�lculo del histograma", this, e);
+			}
+		}
+		return output;
+	}
+	
+	/**
+	 * Obtiene el panel con los controles
+	 * @return JPanel
+	 */
+	public JPanel getControls() {
+		if(controls == null) {
+			controls = new JPanel();
+			controls.setLayout(new GridBagLayout());
+			
+			llevels = new JLabel(Messages.getText("levels"));
+			
+			GridBagConstraints gbc = new GridBagConstraints();
+			gbc.weightx = 1;
+			gbc.insets = new Insets(0, 5, 0, 5);
+			gbc.fill = GridBagConstraints.BOTH;
+			controls.add(llevels, gbc);
+			gbc.gridy = 1;
+			controls.add(getLevels(), gbc);
+			
+			gbc.gridy = 2;
+			controls.add(getRGB(), gbc);
+		}
+		return controls;
+	}
+	
+	/**
+	 * Activa o desactiva el control de niveles de posterizaci�n en level-slice
+	 * de recorte.
+	 * @param enabled
+	 */
+	public void setLevelsEnabled(boolean enabled) {
+		getLevels().setEnabled(enabled);
+		if(enabled)
+			getLevels().setBackground(Color.WHITE);
+		else
+			getLevels().setBackground(getControls().getBackground());
+	}
+	
+	/**
+	 * Obtiene el n�mero de niveles.
+	 * @return
+	 */
+	public JFormattedTextField getLevels() {
+		if (tlevels == null) {
+			NumberFormat doubleDisplayFormat = NumberFormat.getNumberInstance();
+			doubleDisplayFormat.setMinimumFractionDigits(0);
+			NumberFormat doubleEditFormat = NumberFormat.getNumberInstance();
+
+			tlevels = new JFormattedTextField(new DefaultFormatterFactory(new NumberFormatter(doubleDisplayFormat), new NumberFormatter(doubleDisplayFormat), new NumberFormatter(doubleEditFormat)));
+
+			tlevels.addKeyListener(this);
+		}
+		return tlevels;
+	}
+	
+	/**
+	 * Obtiene el checkbox que indica si se va a tratar la imagen como un checkbox
+	 * @return
+	 */
+	public JCheckBox getRGB() {
+		if (cbRGB == null) {
+			cbRGB = new JCheckBox("RGB");
+		}
+		return cbRGB;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.beans.previewbase.IUserPanelInterface#getPanel()
+	 */
+	public JPanel getPanel() {
+		return this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.beans.previewbase.IUserPanelInterface#getTitle()
+	 */
+	public String getTitle() {
+		return "";
+	}
+
+	/**
+	 * Asigna el listener para gestionar el evento de movimiento de gr�ficos
+	 * @param listener
+	 */
+	public void setListener(EnhancedListener listener) {
+		getInputHistogram().setListener(listener);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.KeyListener#keyPressed(java.awt.event.KeyEvent)
+	 */
+	public void keyPressed(KeyEvent e) {
+		Long lValue = (Long) getLevels().getValue();
+		int value = lValue.intValue();
+
+		boolean change = false;
+		switch (e.getKeyCode()) {
+			case KeyEvent.VK_UP:
+				value++;
+				change = true;
+				break;
+			case KeyEvent.VK_DOWN:
+				value--;
+				change = true;
+				break;
+		}
+
+		if (change) {
+			if (value > 30)
+				value = 30;
+	
+			if (value < 2)
+				value = 2;
+	
+			if (!getLevels().getValue().equals(new Long(value))) {
+				getLevels().setValue(new Long(value));
+				getLevels().postActionEvent();
+			}
+		}
+	}
+
+	public void keyReleased(KeyEvent e) {}
+	public void keyTyped(KeyEvent e) {}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/GraphicsPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/SelectorsPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/SelectorsPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/SelectorsPanel.java	(revision 8183)
@@ -0,0 +1,245 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.app.basic.tool.enhanced.ui;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.border.TitledBorder;
+
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.tool.enhanced.graphics.HistogramGraphicBase;
+import org.gvsig.utils.swing.JComboBox;
+
+/**
+ * Panel con las selecci�n de opciones.
+ * 
+ * 20/02/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class SelectorsPanel extends JPanel {
+	private static final long serialVersionUID = 3453973982901626644L;
+	private JComboBox            enhancedType  = null;
+	private JComboBox            histogramType = null;
+	private JComboBox            drawType      = null;
+	private JComboBox            band          = null;
+	private HistogramGraphicBase graphicBase   = null;
+	// private JComboBox sourcesMatchingPanel = null;
+
+	/**
+	 * Crea una instancia del panel GraphicsPanel
+	 * @param lyr
+	 * @param list
+	 * @param graphicBase Grafica donde estan los histogramas, para saber como
+	 *          rellenar el combo de colores
+	 */
+	public SelectorsPanel(FLyrRaster lyr, HistogramGraphicBase graphicBase) {
+		this.graphicBase = graphicBase;
+		init(lyr);
+	}
+	
+	/**
+	 * Inicializaci�n de los controles gr�ficos.
+	 */
+	private void init(FLyrRaster lyr) {
+		GridBagConstraints gridBagConstraints = null;
+
+		setBorder(BorderFactory.createTitledBorder(null, null, TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));
+
+		setLayout(new GridBagLayout());
+		
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.anchor = GridBagConstraints.EAST;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(5, 5, 2, 2);
+		add(new JLabel(RasterToolsUtil.getText(this, "operation")), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.insets = new Insets(5, 2, 2, 2);
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		add(getEnhancedType(), gridBagConstraints);
+		
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.anchor = GridBagConstraints.EAST;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(2, 5, 2, 2);
+		add(new JLabel(RasterToolsUtil.getText(this, "band")), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.insets = new Insets(2, 2, 2, 2);
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		add(getBand(lyr), gridBagConstraints);
+		
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 2;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.anchor = GridBagConstraints.EAST;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(5, 2, 2, 2);
+		add(new JLabel(RasterToolsUtil.getText(this, "drawing_type")), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 3;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.insets = new Insets(5, 2, 2, 5);
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		add(getDrawType(), gridBagConstraints);
+		
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 2;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.anchor = GridBagConstraints.EAST;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(2, 2, 2, 2);
+		add(new JLabel(RasterToolsUtil.getText(this, "histogram_type")), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 3;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.insets = new Insets(2, 2, 2, 5);
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		add(getHistogramType(), gridBagConstraints);
+		
+//		gridBagConstraints = new GridBagConstraints();
+//		gridBagConstraints.gridx = 0;
+//		gridBagConstraints.gridy = 2;
+//		gridBagConstraints.gridwidth = 4;
+//		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+//		gridBagConstraints.anchor = GridBagConstraints.NORTH;
+//		gridBagConstraints.weighty = 1.0;
+//		gridBagConstraints.insets = new Insets(2, 5, 5, 5);
+//		add(getSourcesMatchingPanel(list), gridBagConstraints);
+	}
+	
+//	/**
+//	 * Obtiene la lista con las capas cargadas en el TOC para la selecci�n de la 
+//	 * que necesitemos en la funcionalidad de histogram matching
+//	 * @return JPanel
+//	 */
+//	private JComboBox getSourcesMatchingPanel(ArrayList list) {
+//		if (sourcesMatchingPanel == null) {
+//			sourcesMatchingPanel = new JComboBox();
+//			for (int i = 0; i < list.size(); i++)
+//				sourcesMatchingPanel.addItem(((FLyrRaster) list.get(i)).getName());
+//		}
+//		return sourcesMatchingPanel;
+//	}
+	
+	/**
+	 * Obtiene el tipo de histograma
+	 * @return JComboBox
+	 */
+	public JComboBox getHistogramType() {
+		if (histogramType == null) {
+			histogramType = new JComboBox();
+			histogramType.addItem(RasterToolsUtil.getText(this, "standard"));
+			histogramType.addItem(RasterToolsUtil.getText(this, "cumulative"));
+			histogramType.addItem(RasterToolsUtil.getText(this, "logaritmic"));
+			histogramType.addItem(RasterToolsUtil.getText(this, "cumulative_logarithmic"));
+		}
+		return histogramType;
+	}
+	
+	/**
+	 * Obtiene el tipo de dibujado de histograma (lineas, barras, ...)
+	 * @return JComboBox
+	 */
+	public JComboBox getDrawType() {
+		if (drawType == null) {
+			drawType = new JComboBox();
+			drawType.addItem(RasterToolsUtil.getText(this, "line"));
+			drawType.addItem(RasterToolsUtil.getText(this, "fill"));
+		}
+		return drawType;
+	}
+	
+	/**
+	 * Obtiene la banda que representa el histograma
+	 * @return JComboBox
+	 */
+	public JComboBox getBand(FLyrRaster lyr) {
+		if (band == null) {
+			band = new JComboBox();
+			
+			if (lyr.getRender().isRenderingAsGray()) {
+				band.addItem(RasterToolsUtil.getText(this, "gray"));
+			} else {
+				if (graphicBase.getHistogramStatus(HistogramGraphicBase.RED) != null)
+					band.addItem(RasterToolsUtil.getText(this, "red"));
+				if (graphicBase.getHistogramStatus(HistogramGraphicBase.GREEN) != null)
+					band.addItem(RasterToolsUtil.getText(this, "green"));
+				if (graphicBase.getHistogramStatus(HistogramGraphicBase.BLUE) != null)
+					band.addItem(RasterToolsUtil.getText(this, "blue"));
+			}
+		}
+		return band;
+	}
+
+	/**
+	 * Obtiene el tipo de funci�n a aplicar (ecualizaci�n, realce lineal, ...)
+	 * @return JComboBox
+	 */
+	public JComboBox getEnhancedType() {
+		if (enhancedType == null) {
+			enhancedType = new JComboBox();
+			enhancedType.addItem(RasterToolsUtil.getText(this, "lineal"));
+			enhancedType.addItem(RasterToolsUtil.getText(this, "square_root"));
+			enhancedType.addItem(RasterToolsUtil.getText(this, "logaritmic"));
+			enhancedType.addItem(RasterToolsUtil.getText(this, "exponential"));
+			enhancedType.addItem(RasterToolsUtil.getText(this, "level_slice"));
+//			enhancedType.addItem(RasterToolsUtil.getText(this, "gaussian"));
+//			enhancedType.addItem(RasterToolsUtil.getText(this, "equalization"));
+		}
+		return enhancedType;
+	}
+
+	/**
+	 * Selecciona un item del combo EnhancedType sin lanzar un evento
+	 * @param type
+	 */
+	public void setSelectedEnhancedType(String type) {
+		if (getEnhancedType().getSelectedItem() != type) {
+			ActionListener[] copyActionListeners = getEnhancedType().getActionListeners();
+			for (int i = 0; i < copyActionListeners.length; i++)
+				getEnhancedType().removeActionListener(copyActionListeners[i]);
+	
+			getEnhancedType().setSelectedItem(type);
+
+			for (int i = 0; i < copyActionListeners.length; i++)
+				getEnhancedType().addActionListener(copyActionListeners[i]);
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/SelectorsPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/EnhancedDialog.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/EnhancedDialog.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/EnhancedDialog.java	(revision 8183)
@@ -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.raster.tools.app.basic.tool.enhanced.ui;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.util.ArrayList;
+
+import javax.swing.JPanel;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.andami.ui.mdiManager.WindowInfo;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.mainplugin.beans.createlayer.CreateLayerPanel;
+import org.gvsig.raster.swing.RasterSwingLocator;
+import org.gvsig.raster.swing.preview.PreviewBasePanelTab;
+import org.gvsig.raster.swing.preview.PreviewPanel;
+import org.gvsig.raster.tools.app.basic.raster.bean.previewbase.RasterDataSourcePreview;
+
+/**
+ * Dialogo para el realce por expansi�n del contraste
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class EnhancedDialog extends JPanel implements IWindow {
+	private static final long   serialVersionUID = -5374834293534046986L;
+	
+	private PreviewPanel        previewBasePanel = null;
+	private GraphicsPanel       graphicsPanel    = null;
+	private FLyrRaster          lyr              = null;
+	private PreviewFiltering    filteredPreview  = null;
+	private SelectorsPanel      controlsPanel    = null;
+	private CreateLayerPanel    layerPanel       = null;
+	private String              viewName         = null;
+	private EnhancedListener    listener         = null;
+	
+	/**
+	 * Constructor
+	 * @param lyr Capa raster sobre la que se opera
+	 * @param lyrs Lista de capas cargadas en el TOC
+	 * @param width Ancho
+	 * @param height Alto
+	 */
+	public EnhancedDialog(FLyrRaster lyr, int width, int height) {
+		this.setPreferredSize(new Dimension(width, height));
+		this.setSize(width, height);
+		this.setLayout(new BorderLayout(5, 5));
+		this.lyr = lyr;
+		
+		graphicsPanel = new GraphicsPanel(this.lyr);
+		filteredPreview = new PreviewFiltering(false);
+		filteredPreview.setFilterStatus(this.lyr.getRender().getFilterList().getStatusCloned());
+		controlsPanel = new SelectorsPanel(this.lyr, graphicsPanel.getInputHistogram());
+				
+		this.add((Component)getPreviewBasePanel(), BorderLayout.CENTER);
+		
+		listener = new EnhancedListener(controlsPanel, graphicsPanel, this, filteredPreview);
+		
+		listener.firstLoad();
+		
+		graphicsPanel.setListener(listener);
+		
+		graphicsPanel.updateHistogram();
+		listener.updatePreview();
+		
+		IWindow window = PluginServices.getMDIManager().getActiveWindow();
+		if(window instanceof AbstractViewPanel) {
+			AbstractViewPanel view = (AbstractViewPanel)window;
+			viewName = PluginServices.getMDIManager().getWindowInfo(view).getTitle();
+		}
+		
+		getPreviewBasePanel().getButtonsPanel().addButtonPressedListener(listener);
+		
+		previewBasePanel.refreshPreview();
+	}
+
+	/**
+	 * Obtiene el panel con el histograma
+	 * @return HistogramPanel
+	 */
+	public PreviewPanel getPreviewBasePanel() {
+		if (previewBasePanel == null) {
+			ArrayList<PreviewBasePanelTab> list = new ArrayList<PreviewBasePanelTab>();
+			list.add((PreviewBasePanelTab)graphicsPanel);
+			
+			JPanel downPreview = new JPanel();
+			getNewOrSaveLayerPanel().setLabelFilename("");
+			downPreview.setLayout(new GridBagLayout());
+			
+			GridBagConstraints gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+			downPreview.add(getNewOrSaveLayerPanel().getJPanel(), gridBagConstraints);
+			
+			gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.gridx = 0;
+			gridBagConstraints.gridy = 1;
+			gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+			gridBagConstraints.anchor = GridBagConstraints.NORTH;
+			gridBagConstraints.weightx = 1.0;
+			gridBagConstraints.weighty = 1.0;
+			downPreview.add(getNewOrSaveLayerPanel().getFileNamePanel(), gridBagConstraints);
+			
+			IProjection viewProj = null;
+			if(lyr.getMapContext() != null)
+				viewProj = lyr.getMapContext().getProjection();
+			RasterDataSourcePreview dataSourcePreview = new RasterDataSourcePreview(lyr, viewProj);
+			previewBasePanel = RasterSwingLocator.getSwingManager().createPreviewPanel(
+					ButtonsPanel.BUTTONS_APPLYCLOSE, 
+					list, 
+					controlsPanel, 
+					downPreview, 
+					filteredPreview, 
+					dataSourcePreview);
+			previewBasePanel.getButtonsPanel().addCancel();
+		}
+		return previewBasePanel;
+	}
+	
+	/**
+	 * Devuelve un Panel para el guardado de capas en disco o en memoria.
+	 */
+	public CreateLayerPanel getNewOrSaveLayerPanel() {
+		 if (layerPanel == null) {
+			 layerPanel = new CreateLayerPanel(lyr);
+			 if(lyr.isRemote())
+				 layerPanel.disableNewLayer();
+		 }
+		 return layerPanel;
+	 }
+	
+	/**
+	 * Acciones a ejecutar cuando se cancela
+	 */
+	public void close() {
+		try {
+			PluginServices.getMDIManager().closeWindow(this);
+		} catch (ArrayIndexOutOfBoundsException e) {
+			//Si la ventana no se puede eliminar no hacemos nada
+		}
+	}
+	
+	/**
+	 * Obtiene la capa asociada.
+	 * @return FLyrRaster
+	 */
+	public FLyrRaster getLayer() {
+		return lyr;
+	}
+
+	public WindowInfo getWindowInfo() {
+		WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODELESSDIALOG | WindowInfo.RESIZABLE | WindowInfo.MAXIMIZABLE);
+		if(getPreviewBasePanel().getDataSourcePreview().getSource() != null) {
+			FLyrRaster lyr = (FLyrRaster)getPreviewBasePanel().getDataSourcePreview().getSource();
+			m_viewinfo.setAdditionalInfo(lyr.getName());
+		}
+		m_viewinfo.setTitle(PluginServices.getText(this, "enhanced"));
+		m_viewinfo.setHeight(this.getHeight());
+		m_viewinfo.setWidth(this.getWidth());
+		return m_viewinfo;
+	}
+
+	/**
+	 * @return the filteredPreview
+	 */
+	public PreviewFiltering getFilteredPreview() {
+		return filteredPreview;
+	}
+
+	/**
+	 * @return the viewName
+	 */
+	public String getViewName() {
+		return viewName;
+	}
+
+	/**
+	 * @return the graphicsPanel
+	 */
+	public GraphicsPanel getGraphicsPanel() {
+		return graphicsPanel;
+	}
+
+	public Object getWindowProfile() {
+		return WindowInfo.PROPERTIES_PROFILE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/EnhancedDialog.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/PreviewFiltering.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/PreviewFiltering.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/PreviewFiltering.java	(revision 8183)
@@ -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.tools.app.basic.tool.enhanced.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.andami.PluginServices;
+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.gui.beans.imagenavigator.ImageUnavailableException;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.swing.preview.DataSourcePreview;
+import org.gvsig.raster.swing.preview.PreviewRenderProcess;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.raster.bean.previewbase.ParamStruct;
+
+/**
+ * Procesado de la imagen para la previsualizaci�n. Para poder usar esta clase despu�s de instanciarla
+ * habr� que asignarle un valor a showFiltersSelected aunque por defecto est� a true por lo que se
+ * visualizaran los cambios sin problemas, asigna una lista de filtros inicial (que ya tenga el raster
+ * aplicado) con setFilterStatus y asignar los filtros que queramos aplicar con addNewParam (una llamada
+ * por cada filtro).
+ * 
+ * 19/02/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class PreviewFiltering implements PreviewRenderProcess {
+
+	private boolean                  showFiltersSelected     = true;
+	private List<ParamStruct>        paramsList              = new ArrayList<ParamStruct>();
+	private List<RasterFilter>       filtersInit             = new ArrayList<RasterFilter>();
+	private boolean                  showPreview             = true;	
+	private boolean                  saveLayerFilters        = true;
+	
+	public PreviewFiltering(boolean saveLayerFilters) {
+		this.saveLayerFilters = saveLayerFilters;
+	}
+	
+	/**
+	 * Flag de selecci�n de activaci�n y desactivaci�n
+	 * @param show
+	 */
+	public void showFiltersSelected(boolean show) {
+		this.showFiltersSelected = show;
+	}
+	
+	/**
+	 * Obtiene la lista de par�metros
+	 * @return the paramsList
+	 */
+	public List<ParamStruct> getParamsList() {
+		return paramsList;
+	}
+	
+	/**
+	 * Asigna la lista de par�metros
+	 * @param params
+	 */
+	public void setParamsList(List<ParamStruct> params) {
+		this.paramsList = params;
+	}
+	
+	/**
+	 * Asigna el arrayList de filtros inicial. Esto hace que aplique los filtros que ya
+	 * existen en el raster. Estos pueden ser obtenidos del render de la capa de la forma
+	 * lyr.getRender().getFilterList().getStatusCloned().  
+	 * @param params Lista de filtros aplicados.
+	 */
+	public void setFilterStatus(List<RasterFilter> filtersInit) {
+		this.filtersInit = filtersInit;
+	}
+	
+	/**
+	 * Devuelve el arrayList de filtros inicial
+	 * @return
+	 */
+	public List<RasterFilter> getFilterStatus() {
+		return filtersInit;
+	}
+	
+	/**
+	 * A�adir un nuevo Params a la lista de Params que podemos manejar. Un Params
+	 * equivale a un filtro cargado. El hecho de trabajar con Params y no con
+	 * filtros, simplifica totalmente el panel. Sin tener que depender de los
+	 * filtros nada m�s que para el momento de dibujado o guardado.
+	 * @param name
+	 * @param params
+	 * @param classFilter
+	 */
+	public void addNewParam(String name, Params params, Class<?> classFilter) {
+		ParamStruct param = new ParamStruct();
+		param.setFilterName(name);
+		param.setFilterParam(params);
+		param.setFilterClass(classFilter);
+		paramsList.add(param);
+	}
+
+	/**
+	 * Procesa la imagen con la lista de filtros si el flag showFilterSelected est� a true.
+	 * Esta funci�n llama a addFilter por cada filtro a�adido pero es applyFilters la encargada
+	 * de construir la lista. 
+	 */
+	public void process(DataSourcePreview rendering) throws ImageUnavailableException {
+		if(!showPreview)
+			throw new ImageUnavailableException(RasterToolsUtil.getText(this, "panel_preview_not_available"));
+		
+		if(!(rendering.getSource() instanceof FLyrRaster))
+			return;
+		FLyrRaster lyr = (FLyrRaster)rendering.getSource();
+			
+		lyr.getRender().getFilterList().clear();
+
+		if (showFiltersSelected) {
+			RasterFilterList filterList = lyr.getRender().getFilterList();
+			filterList.setInitDataType(lyr.getDataStore().getDataType()[0]);
+
+			List<ParamStruct> listFilterUsed = null;
+			if(saveLayerFilters)
+				listFilterUsed = applyAllFilters(lyr);
+			else
+				listFilterUsed = applySelectedFilters(null);
+			ArrayList<Exception> exc = new ArrayList<Exception>();
+			for (int i = 0; i < listFilterUsed.size(); i++) {
+				try {
+					RasterFilterListManager filterManager = filterList.getManagerByFilterClass(((ParamStruct) listFilterUsed.get(i)).getFilterClass());
+					Class<?> c = ((ParamStruct) listFilterUsed.get(i)).getFilterClass();
+					Params p = ((ParamStruct) listFilterUsed.get(i)).getFilterParam();
+					filterManager.addFilter(c, p);
+				} catch (FilterTypeException e) {
+					exc.add(e);
+				} catch (FilterManagerException e) {
+					exc.add(e);
+				}
+			}
+			if(exc.size() != 0) {
+				RasterSwingLibrary.messageBoxError(PluginServices.getText(this, "error_adding_filters"), this, exc);
+				exc.clear();
+			}
+		}
+	}
+	
+	/**
+	 * Aqui se seleccionan que filtros se van a aplicar y se devuelven en forma
+	 * de ArrayList tanto para el dibujado como cuando aceptan o aplican el panel.
+	 * @param layerRaster
+	 * @return
+	 */
+	public List<ParamStruct> applyAllFilters(FLyrRaster layerRaster) {
+		List<ParamStruct> listFilterUsed = new ArrayList<ParamStruct>();
+		
+		int initDataType = layerRaster.getRender().getFilterList().getInitDataType();
+		RasterFilterList filterList = RasterLocator.getManager().createEmptyFilterList(initDataType);
+		filterList.setEnv(layerRaster.getRender().getFilterList().getEnv());
+		filterList.setInitDataType(initDataType);
+		List<Class<?>> registeredFilters = filterList.getRegisteredFilterList();
+
+		if(filtersInit == null)
+			return listFilterUsed;
+		
+		// Conservamos filtros ya existentes
+		for (int i = 0; i < filtersInit.size(); i++) {
+			
+			RasterFilter obj = null;
+			for (int j = 0; j < registeredFilters.size(); j++) {
+				Class<?> classFilter = (Class<?>) registeredFilters.get(j);
+				try {
+					obj = (RasterFilter) classFilter.newInstance();
+					if (obj.getName().equals(((RasterFilter) filtersInit.get(i)).getName()))
+						break;
+				} catch (InstantiationException e) {
+					RasterSwingLibrary.messageBoxError("error_creando_filtro", this, e);
+				} catch (IllegalAccessException e) {
+					RasterSwingLibrary.messageBoxError("error_creando_filtro", this, e);
+				}
+			}
+
+			// Si no encontramos el filtro apropiado, nos olvidamos de el
+			if (obj == null)
+				continue;
+
+			// Si no es visible tenemos que conservar el filtro
+			try {
+				Params params = (Params) ((RasterFilter) filtersInit.get(i)).getUIParams(((RasterFilter) filtersInit.get(i)).getName()).clone();
+				// A�ado el parametro RenderBands a los parametros del filtro
+				int[] renderBands = layerRaster.getRender().getRenderColorInterpretation().buildRenderBands();
+				String rgb = renderBands[0] + " " + renderBands[1] + " " + renderBands[2];
+				params.setParam("RenderBands", rgb, 0, null);
+			
+				ParamStruct newParam = new ParamStruct();
+				newParam.setFilterClass(obj.getClass());
+				newParam.setFilterName(((RasterFilter) filtersInit.get(i)).getName());
+				newParam.setFilterParam(params);
+				listFilterUsed.add(newParam);
+			} catch (CloneNotSupportedException e) {
+			}
+		}
+		
+		// Metemos los filtros seleccionados en listFilterUsed
+		listFilterUsed = applySelectedFilters(listFilterUsed);
+		
+		return listFilterUsed;
+	}
+	
+	/**
+	 * Gets the list of filters selected for the preview (without the layer filters). If a list of filters is
+	 * assigned, this method will replace the filter if exists in the list. 
+	 * @param listFilterUsed
+	 * @return
+	 */
+	public List<ParamStruct> applySelectedFilters(List<ParamStruct> listFilterUsed) {
+		if(listFilterUsed == null)
+			return getParamStructListCopy();
+		
+		for (int i = 0; i < paramsList.size(); i++) {
+			// En caso de existir el filtro, lo reemplazamos
+			boolean finded = false;
+			for (int j = 0; j < listFilterUsed.size(); j++) {
+				if (((ParamStruct) listFilterUsed.get(j)).getFilterName().equals(((ParamStruct) paramsList.get(i)).getFilterName())) {
+					listFilterUsed.set(j, paramsList.get(i));
+					finded = true;
+					break;
+				}
+			}
+			if (!finded)
+				listFilterUsed.add(paramsList.get(i));
+		}
+		
+		return listFilterUsed;
+	}
+	
+	private List<ParamStruct> getParamStructListCopy() {
+		List<ParamStruct> p = new ArrayList<ParamStruct>();
+		for (int i = 0; i < paramsList.size(); i++) {
+			p.add(paramsList.get(i).clone());
+		}
+		return p;
+	}
+	
+	/**
+	 * Obtiene el flag que informa de si se est� mostrando la previsualizaci�n o no.
+	 * En caso de no mostrarse se lanza una excepci�n ImageUnavailableExcepcion con el 
+	 * mensaje "La previsualizaci�n no est� disponible para este panel"
+	 * @return
+	 */
+	public boolean isShowPreview() {
+		return showPreview;
+	}
+	
+	/**
+	 * Asigna el flag para mostrar u ocultar la preview. En caso de no mostrarse se lanza una 
+	 * excepci�n ImageUnavailableExcepcion con el mensaje "La previsualizaci�n no est� disponible para
+	 * este panel"
+	 * @param showPreview
+	 */
+	public void setShowPreview(boolean showPreview) {
+		this.showPreview = showPreview;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/PreviewFiltering.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/graphics/HistogramGraphicBase.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/graphics/HistogramGraphicBase.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/graphics/HistogramGraphicBase.java	(revision 8183)
@@ -0,0 +1,371 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.app.basic.tool.enhanced.graphics;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.util.List;
+
+import javax.swing.JPanel;
+
+import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.RasterSwingLocator;
+import org.gvsig.raster.swing.gcanvas.BaseFunction;
+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.GraphicHistogram;
+import org.gvsig.raster.swing.gcanvas.InfoLayer;
+import org.gvsig.raster.swing.gcanvas.MinMaxLines;
+/**
+ * Clase base para los gr�ficos de histogramas de entrada y salida.
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public abstract class HistogramGraphicBase extends JPanel  {
+	private static final long serialVersionUID = 68166939596605313L;
+	protected Color minMaxLineColor = Color.WHITE;
+	protected Color borderColor     = Color.WHITE;
+	protected Color functionColor   = Color.YELLOW;
+	
+	/**
+	 * Clase para tener guardados los valores de estado de una banda del histograma
+	 * 
+	 * @author BorSanZa - Borja S�nchez Zamorano 
+	 */
+	public class HistogramStatus {
+		private double[]         histogram        = new double[] { 0, 0, 3, 4, 5, 8, 7, 18, 45, 36, 21, 36, 12, 23, 23, 40, 17, 10, 5, 1, 0, 0, 0 };
+		private double           min              = 0.0D;
+		private double           max              = 1.0D;
+		private BaseFunction     baseFunction     = null;
+		private GraphicHistogram graphicHistogram = null;
+		private MinMaxLines      minMaxLines      = null;
+		private InfoLayer        infoLayer        = null;
+
+		public HistogramStatus(Color color) {
+			GCanvas canvas = RasterSwingLocator.getSwingManager().createGraphicCanvas(Color.black);
+			graphicHistogram = canvas.createHistogramForGCanvas(null, color);
+			graphicHistogram.setType(GraphicHistogram.TYPE_LINE);
+			baseFunction = canvas.createStraightLineForGCanvas(functionColor);
+			minMaxLines = canvas.createMinMaxLinesForGCanvas(minMaxLineColor);
+			infoLayer = canvas.createInfoLayerForGCanvas(Color.WHITE);
+		}
+
+		/**
+		 * Establece los valores minimo y maximo
+		 * @param min
+		 * @param max
+		 */
+		public void setLimits(double min, double max) {
+			this.min = min;
+			this.max = max;
+			infoLayer.setLimits(min, max);
+		}
+		
+		/**
+		 * @return the histogram
+		 */
+		public double[] getHistogram() {
+			return histogram;
+		}
+
+		/**
+		 * @param histogram the histogram to set
+		 */
+		public void setHistogram(double[] histogram) {
+			graphicHistogram.setHistogramDrawed(histogram);
+			this.histogram = histogram;
+		}
+
+		/**
+		 * @return the graphicHistogram
+		 */
+		public GraphicHistogram getGraphicHistogram() {
+			return graphicHistogram;
+		}
+
+		/**
+		 * @return the minMaxLines
+		 */
+		public MinMaxLines getMinMaxLines() {
+			return minMaxLines;
+		}
+
+		/**
+		 * @return the straightLine
+		 */
+		public BaseFunction getBaseFunction() {
+			return baseFunction;
+		}
+		
+		/**
+		 * Asigna la funci�n dibujada. Por defecto se crea con StraightLine
+		 * pero puede ser modificada.
+		 * @param baseFunction BaseFunction
+		 */
+		public void setBaseFunction(BaseFunction baseFunction) {
+			this.baseFunction = baseFunction;
+		}
+		
+		/**
+		 * N�mero de cortes cuando es una funci�n level slice
+		 * @param level
+		 */
+		public void setLevel(int level) {
+			if(baseFunction instanceof DensitySlicingLine)
+				((DensitySlicingLine)baseFunction).setShape(level);
+		}
+
+		/**
+		 * @return the min
+		 */
+		public double getMin() {
+			return min;
+		}
+
+		/**
+		 * @return the max
+		 */
+		public double getMax() {
+			return max;
+		}
+
+		/**
+		 * @return the infoLayer
+		 */
+		public InfoLayer getInfoLayer() {
+			return infoLayer;
+		}
+	}
+
+	/**
+	 * Constantes que identifican un histograma con una banda
+	 */
+	public final static int   RED             = 0;
+	public final static int   GREEN           = 1;
+	public final static int   BLUE            = 2;
+	public final static int   GRAY            = 3;
+
+	/**
+	 * Constante para poder coger el histograma visualizado en ese momento
+	 */
+	public final static int   DRAWED          = 4;
+
+	protected GCanvas         canvas          = null;
+
+	protected HistogramStatus histogramRed    = null;
+	protected HistogramStatus histogramGreen  = null;
+	protected HistogramStatus histogramBlue   = null;
+	protected HistogramStatus histogramGray   = null;
+	protected HistogramStatus histogramDrawed = null;
+	private FLyrRaster        lyr             = null;
+
+	public HistogramGraphicBase(BufferHistogram hist, FLyrRaster lyr, double[] minList, double[] maxList) {
+		this.lyr = lyr;
+		setHistogram(hist, minList, maxList);
+		initialize();
+	}
+	
+	private void initialize() {
+		this.setLayout(new BorderLayout());
+		this.add((Component)getCanvas(), BorderLayout.CENTER);
+	}
+
+	/**
+	 * Crea la lista de objetos dibujables y la guarda en un array
+	 */
+	public void setHistogram(BufferHistogram hist, double[] minList, double[] maxList) {
+		long[][] table = hist.getTable();
+		if (lyr.getRender().isRenderingAsGray()) {
+			setHistogramBand(GRAY, minList, maxList, table);
+			setHistogramBand(RED, minList, maxList, table);
+			setHistogramBand(GREEN, minList, maxList, table);
+			setHistogramBand(BLUE, minList, maxList, table);
+		} else {
+			setHistogramBand(RED, minList, maxList, table);
+			setHistogramDrawed(RED);
+			setHistogramBand(GREEN, minList, maxList, table);
+			setHistogramBand(BLUE, minList, maxList, table);
+		}
+	}
+	
+	/**
+	 * Define el histograma para una banda de color
+	 * @param color 
+	 *        Banda a la que se le aplicara el histograma
+	 * @param minList 
+	 *        Lista de minimos
+	 * @param maxList 
+	 *        Lista de maximos
+	 * @param table 
+	 *        Tabla de valores de un histograma
+	 */
+	private void setHistogramBand(int color, double[] minList, double[] maxList, long[][] table) {
+		int position = 0;
+		switch (color) {
+			case GREEN:
+				position = 1;
+				break;
+			case BLUE:
+				position = 2;
+				break;
+		}
+
+		ColorInterpretation ci = lyr.getRender().getRenderColorInterpretation();
+		int[] renderBands = ci.buildRenderBands();
+
+		if (position >= renderBands.length)
+			return;
+
+		int band = renderBands[position];
+
+		if ((band < 0) || (band >= table.length))
+			return;
+
+		double histogram[] = new double[table[band].length];
+		for (int i = 0; i < histogram.length; i++)
+			histogram[i] = (double) table[band][i];
+		setHistogram(histogram, color);
+
+		HistogramStatus histogramStatus = getHistogramStatus(color);
+
+		if (histogramStatus == null)
+			return;
+
+		if ((band >= minList.length) || (band >= maxList.length))
+			return;
+
+		histogramStatus.setLimits(minList[band], maxList[band]);
+	}
+
+	/**
+	 * Asigna el histograma marcado con la interpretaci�n de color indicada.
+	 * @param hist Histograma a asignar
+	 * @param colorInterp Band a la que corresponde el histograma
+	 */
+	public void setHistogram(double[] hist, int colorInterp) {
+		switch (colorInterp) {
+			case GREEN:
+				if (histogramGreen == null)
+					histogramGreen = new HistogramStatus(Color.green);
+				histogramGreen.setHistogram(hist);
+				break;
+			case BLUE:
+				if (histogramBlue == null)
+					histogramBlue = new HistogramStatus(Color.blue);
+				histogramBlue.setHistogram(hist);
+				break;
+			case GRAY:
+				if (histogramGray == null)
+					histogramGray = new HistogramStatus(Color.gray);
+				histogramGray.setHistogram(hist);
+				break;
+			default: // Banda roja
+				if (histogramRed == null)
+					histogramRed = new HistogramStatus(Color.red);
+				histogramRed.setHistogram(hist);
+				break;
+		}
+
+		if (histogramDrawed == null)
+			setHistogramDrawed(colorInterp);
+	}
+	
+	/**
+	 * Devuelve el estado del histograma seleccionado
+	 * @param colorInterp
+	 * @return
+	 */
+	public HistogramStatus getHistogramStatus(int colorInterp) {
+		switch (colorInterp) {
+			case RED:
+				return histogramRed;
+			case GREEN:
+				return histogramGreen;
+			case BLUE:
+				return histogramBlue;
+			case GRAY:
+				return histogramGray;
+			case DRAWED:
+				return histogramDrawed;
+		}
+		return null;
+	}
+	
+	/**
+	 * Asigna el histograma dibujado 
+	 * @param colorInterp
+	 */
+	public void setHistogramDrawed(int colorInterp) {
+		switch (colorInterp) {
+			case RED:
+				histogramDrawed = histogramRed;
+				break;
+			case GREEN:
+				histogramDrawed = histogramGreen;
+				break;
+			case BLUE:
+				histogramDrawed = histogramBlue;
+				break;
+			case GRAY:
+				histogramDrawed = histogramGray;
+				break;
+		}
+
+
+		if (histogramDrawed != null) {
+			getCanvas().replaceDrawableElement(histogramDrawed.getGraphicHistogram());
+			getCanvas().replaceDrawableElement(histogramDrawed.getMinMaxLines());
+			getCanvas().replaceDrawableElement((DrawableElement)histogramDrawed.getBaseFunction(), BaseFunction.class);
+			getCanvas().replaceDrawableElement(histogramDrawed.getInfoLayer());
+			((Component)getCanvas()).repaint();
+		}
+	}
+	
+	/**
+	 * Asigna el tipo de histograma Standard/Cumulative
+	 * @param type Tipo de histograma. El valor est� definido en las constantes de GraphicHistogram
+	 */
+	public void setHistogramType(int type) {
+		if (histogramDrawed != null)
+			histogramDrawed.getGraphicHistogram().setTypeViewed(type);
+	}
+		
+	/**
+	 * Asigna el tipo
+	 * @param type
+	 */
+	public void setType(int type) {
+		List<DrawableElement> elements = getCanvas().getDrawableElements(GraphicHistogram.class);
+		for (int i = 0; i < elements.size(); i++)
+			((GraphicHistogram) elements.get(i)).setType(type);
+	}
+
+	/**
+	 * Obtiene el lienzo donde se dibujan las gr�ficas
+	 * @return GCanvas
+	 */
+	public abstract GCanvas getCanvas();
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/graphics/HistogramGraphicBase.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/graphics/InputHistogram.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/graphics/InputHistogram.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/graphics/InputHistogram.java	(revision 8183)
@@ -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.tools.app.basic.tool.enhanced.graphics;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.util.List;
+
+import javax.swing.JPanel;
+
+import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.RasterSwingLocator;
+import org.gvsig.raster.swing.gcanvas.BaseFunction;
+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.GraphicHistogram;
+import org.gvsig.raster.swing.gcanvas.LogaritmicExponentialLine;
+import org.gvsig.raster.swing.gcanvas.SquareRootPowLine;
+import org.gvsig.raster.swing.gcanvas.StraightLine;
+import org.gvsig.raster.tools.app.basic.tool.enhanced.ui.EnhancedListener;
+/**
+ * Componente con el histograma de entrada.
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class InputHistogram extends HistogramGraphicBase {
+	private static final long serialVersionUID = 681848373747974757L;
+	
+	/**
+	 * Crea una nueva instancia de InputHistogram.
+	 */
+	public InputHistogram(BufferHistogram hist, FLyrRaster lyr, double[] minList, double[] maxList) {
+		super(hist, lyr, minList, maxList);
+	}
+	
+	public GCanvas getCanvas() {
+		if(canvas == null) {
+			canvas = RasterSwingLocator.getSwingManager().createGraphicCanvas(Color.BLACK);
+			
+			canvas.addDrawableElement(canvas.createHistogramForGCanvas(null, Color.white));
+			canvas.addDrawableElement(canvas.createMinMaxLinesForGCanvas(minMaxLineColor));
+			canvas.addDrawableElement((DrawableElement)canvas.createStraightLineForGCanvas(functionColor));
+			canvas.addDrawableElement(canvas.createBorderLayerForGCanvas(borderColor));
+			canvas.addDrawableElement(canvas.createInfoLayerForGCanvas(Color.WHITE));
+		}
+		return canvas;
+	}
+	
+	/**
+	 * Asigna el listener para gestionar el evento de movimiento de gr�ficos
+	 * @param listener
+	 */
+	public void setListener(EnhancedListener listener) {
+		getCanvas().addValueChangedListener(listener);
+	}
+	
+	/**
+	 * Asigna el nivel de la funci�n si esta es density slicing.
+	 * @param level
+	 */
+	public void setLevel(int level) {
+		if (histogramDrawed != null)
+			histogramDrawed.setLevel(level);
+		((Component)getCanvas()).repaint();
+	}
+	
+	/**
+	 * Asigna el tipo de funci�n Lineal, Exponencial, logaritmica, density slicing, campana de gauss, 
+	 * raiz cuadrada o ecualizaci�n.
+	 * 
+	 * @param type Tipo de histograma. El valor est� definido en las constantes de GraphicHistogram
+	 */
+	public void setFunction(int function) {
+		if (histogramDrawed == null)
+			return;
+
+		BaseFunction baseFunction = histogramDrawed.getBaseFunction();
+		
+		List<DrawableElement> listBaseFunc = canvas.getDrawableElements(BaseFunction.class);
+		if(listBaseFunc != null && listBaseFunc.get(0) instanceof DrawableElement)
+			((DrawableElement)listBaseFunc.get(0)).setDrawing(true);
+		
+		boolean regen = false;
+		switch (function) {
+			case GraphicHistogram.FUNCTION_DENSITY:
+				if (!baseFunction.getClass().equals(DensitySlicingLine.class))
+					baseFunction = canvas.createDensitySliceForGCanvas(
+							((DrawableElement)histogramDrawed.getBaseFunction()).getColor(), -1);
+				break;
+			case GraphicHistogram.FUNCTION_LINEAL:
+				if (!baseFunction.getClass().equals(StraightLine.class))
+					baseFunction = canvas.createStraightLineForGCanvas(((DrawableElement)histogramDrawed.getBaseFunction()).getColor());
+				break;
+			case GraphicHistogram.FUNCTION_LOGARIT:
+				regen = false;
+				if (!baseFunction.getClass().equals(LogaritmicExponentialLine.class)) {
+					regen = true;
+				} else {
+					if (!((LogaritmicExponentialLine) baseFunction).isLogaritmical())
+						regen = true;
+				}
+				if (regen)
+					baseFunction = canvas.createLogaritmicExponentialLineForGCanvas(
+							((DrawableElement)histogramDrawed.getBaseFunction()).getColor(), 1.0);
+				break;
+			case GraphicHistogram.FUNCTION_EXPONENT:
+				regen = false;
+				if (!baseFunction.getClass().equals(LogaritmicExponentialLine.class)) {
+					regen = true;
+				} else {
+					if (!((LogaritmicExponentialLine) baseFunction).isExponencial())
+						regen = true;
+				}
+				if (regen)
+					baseFunction = canvas.createLogaritmicExponentialLineForGCanvas(
+							((DrawableElement)histogramDrawed.getBaseFunction()).getColor(), -1.0);
+				break;
+			case GraphicHistogram.FUNCTION_SQUARE_ROOT:
+				if (!baseFunction.getClass().equals(SquareRootPowLine.class))
+					baseFunction = canvas.createSquareRootPowLineForGCanvas(
+							((DrawableElement)histogramDrawed.getBaseFunction()).getColor(), 1.0);
+				break;
+			case GraphicHistogram.FUNCTION_NONE:
+				((DrawableElement)listBaseFunc.get(0)).setDrawing(false);		
+				break;
+		}
+					
+		histogramDrawed.setBaseFunction(baseFunction);
+		getCanvas().replaceDrawableElement(((DrawableElement)histogramDrawed.getBaseFunction()), BaseFunction.class);
+		
+		// Fuerza un repintado inmediato para actualizar los valores
+		getCanvas().paint(((JPanel)getCanvas()).getGraphics());
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/graphics/InputHistogram.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/graphics/OutputHistogram.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/graphics/OutputHistogram.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/graphics/OutputHistogram.java	(revision 8183)
@@ -0,0 +1,62 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.app.basic.tool.enhanced.graphics;
+
+import java.awt.Color;
+
+import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.RasterSwingLocator;
+import org.gvsig.raster.swing.gcanvas.GCanvas;
+import org.gvsig.raster.swing.gcanvas.InfoLayer;
+/**
+ * Componente con el histograma de salida.
+ * 
+ * 20/02/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class OutputHistogram extends HistogramGraphicBase {
+	private static final long serialVersionUID = -3827308936130572914L;
+
+	/**
+	 * Crea una nueva instancia de OutputHistogram.
+	 */
+	public OutputHistogram(BufferHistogram hist, FLyrRaster lyr, double[] minList, double[] maxList) {
+		super(hist, lyr, minList, maxList);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.enhanced.graphics.HistogramGraphicBase#getCanvas()
+	 */
+	public GCanvas getCanvas() {
+		if (canvas == null) {
+			canvas = RasterSwingLocator.getSwingManager().createGraphicCanvas(Color.BLACK);
+			canvas.addDrawableElement(canvas.createHistogramForGCanvas(null, Color.white));
+			canvas.addDrawableElement(canvas.createBorderLayerForGCanvas(borderColor));
+			InfoLayer infoLayer = canvas.createInfoLayerForGCanvas(Color.WHITE);
+			infoLayer.setLimits(0.0, 255.0);
+			canvas.addDrawableElement(infoLayer);
+		}
+		return canvas;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/graphics/OutputHistogram.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/graphics
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/EnhancedTocMenuEntry.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/EnhancedTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/EnhancedTocMenuEntry.java	(revision 8183)
@@ -0,0 +1,145 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.app.basic.tool.enhanced;
+
+import javax.swing.Icon;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.IconThemeHelper;
+import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.layers.ILayerState;
+import org.gvsig.raster.fmap.layers.IRasterLayerActions;
+import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
+import org.gvsig.raster.tools.app.basic.raster.process.HistogramProcess;
+import org.gvsig.raster.tools.app.basic.raster.process.IProcessActions;
+import org.gvsig.raster.tools.app.basic.raster.process.StatisticsProcess;
+import org.gvsig.raster.tools.app.basic.tool.enhanced.ui.EnhancedDialog;
+
+
+/**
+ * Punto de entrada para la funcionalidad de realce por expansi�n del contraste
+ * 19/02/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class EnhancedTocMenuEntry extends AbstractTocContextMenuAction implements IGenericToolBarMenuItem, IProcessActions {
+	static private EnhancedTocMenuEntry   singleton   = null;
+	private FLyrRaster                    lyr         = null;
+
+	/**
+	 * Nadie puede crear una instancia a esta clase �nica, hay que usar el
+	 * getSingleton()
+	 */
+	private EnhancedTocMenuEntry() {}
+
+	/**
+	 * Devuelve un objeto unico a dicha clase
+	 * @return
+	 */
+	static public EnhancedTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new EnhancedTocMenuEntry();
+		return singleton;
+	}
+	
+	public String getGroup() {
+		return "Enhanced";
+	}
+
+	public int getGroupOrder() {
+		return 55;
+	}
+
+	public int getOrder() {
+		return 0;
+	}
+
+	public String getText() {
+		return Messages.getText("enhanced_rad");
+	}
+
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof ILayerState))
+			return false;
+
+		if (!((ILayerState) selectedItems[0]).isOpen())
+			return false;
+		
+		if(((FLyrRaster) selectedItems[0]).getRender().existColorTable())
+			return false;
+
+		return true;
+	}
+
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof IRasterLayerActions))
+			return false;
+		
+		return ((IRasterLayerActions) selectedItems[0]).isActionEnabled(IRasterLayerActions.ENHANCED);
+	}
+
+	public void execute(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1) || (!(selectedItems[0] instanceof FLyrRaster)))
+			return;
+				
+		this.lyr = (FLyrRaster)selectedItems[0];
+		
+		if(!lyr.getDataStore().getStatistics().isCalculated()) 
+			StatisticsProcess.launcher(lyr, this);
+		else
+			end(null);
+	}
+	
+	public Icon getIcon() {
+		return IconThemeHelper.getImageIcon("layer-enhanced");
+	}
+
+	/**
+	 * Lanzamos la ventana al final del proceso de calculo de estad�sticas.
+	 */
+	public synchronized void end(Object param) {
+		if(param == null || param instanceof FLyrRaster) {
+			HistogramProcess histogramProcess = new HistogramProcess();
+			histogramProcess.setActions(this);
+			histogramProcess.addParam("histogramable", this.lyr.getDataStore().getHistogramComputer());
+			histogramProcess.start();
+		} 
+		if(param instanceof BufferHistogram) {
+			EnhancedDialog enhancedDialog = new EnhancedDialog(lyr, 760, 421);
+			PluginServices.getMDIManager().addCentredWindow(enhancedDialog);
+		}
+	}
+
+	public void interrupted() {
+	}
+	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/EnhancedTocMenuEntry.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/overview/OverviewsTocMenuEntry.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/overview/OverviewsTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/overview/OverviewsTocMenuEntry.java	(revision 8183)
@@ -0,0 +1,172 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.overview;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import javax.swing.Icon;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.exception.BandAccessException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.mapcontext.exceptions.ReloadLayerException;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLyrDefault;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.layers.ILayerState;
+import org.gvsig.raster.fmap.layers.IRasterLayerActions;
+import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.raster.process.IProcessActions;
+import org.gvsig.raster.tools.app.basic.raster.process.OverviewsProcess;
+import org.gvsig.raster.tools.app.basic.raster.process.RasterProcess;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Herramienta del men� contextual para la generaci�n de overviews.
+ * 
+ * 10-dic-2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class OverviewsTocMenuEntry extends AbstractTocContextMenuAction implements PropertyChangeListener, IGenericToolBarMenuItem, IProcessActions {
+	private Logger                       log              = LoggerFactory.getLogger(OverviewsTocMenuEntry.class);
+	static private OverviewsTocMenuEntry singleton        = null;
+
+	/**
+	 * Nadie puede crear una instancia a esta clase �nica, hay que usar el
+	 * getSingleton()
+	 */
+	private OverviewsTocMenuEntry() {}
+
+	/**
+	 * Devuelve un objeto unico a dicha clase
+	 * @return
+	 */
+	static public OverviewsTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new OverviewsTocMenuEntry();
+		return singleton;
+	}
+
+	public String getGroup() {
+		return "RasterLayer";
+	}
+
+	public int getGroupOrder() {
+		return 10;
+	}
+
+	public int getOrder() {
+		return 70;
+	}
+
+	public String getText() {
+		return PluginServices.getText(this, "generar_overviews");
+	}
+	
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		if(!RasterLocator.getManager().isOverviewBuilderSupported())
+			return false;
+		
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof FLyrRaster))
+			return false;
+
+		if (!((ILayerState) selectedItems[0]).isOpen())
+			return false;
+
+		if (!((FLyrRaster) selectedItems[0]).getDataStore().overviewsSupport())
+			return false;
+		
+		if (!((FLyrRaster) selectedItems[0]).getDataStore().overviewsSupport())
+			return false;
+
+		return ((IRasterLayerActions) selectedItems[0]).isActionEnabled(IRasterLayerActions.CREATEOVERVIEWS);							
+	}
+
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		if(!RasterLocator.getManager().isOverviewBuilderSupported())
+			return false;
+		
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof FLyrRaster))
+			return false;
+
+		return true;
+	}
+
+	public void execute(ITocItem item, FLayer[] selectedItems) {		
+		FLayer lyr = selectedItems[0];
+		if (lyr instanceof FLyrRaster) {
+			if (RasterSwingLibrary.messageBoxYesOrNot("sobreescribir_datos_overview", this)) {
+
+				try {
+					if (((FLyrRaster) lyr).getDataStore().getOverviewCount(0) > 0) {
+						if (!RasterSwingLibrary.messageBoxYesOrNot("sobreescribir_overviews", this))
+							return;
+					}
+				} catch (BandAccessException e) {
+					// Actuamos como si no tubiera overviews pero salvamos un Log
+					log.debug("Error accediendo a la banda en getOverViewCount", this, e);
+
+				} catch (RasterDriverException e) {
+					// Actuamos como si no tubiera overviews pero salvamos un Log
+					log.debug("Error en getOverViewCount", this, e);
+				}
+
+				RasterProcess process = new OverviewsProcess();
+				process.addParam("layer", (FLyrRaster) lyr);
+				process.setCancelable(false);
+				process.setActions(this);
+				process.start();
+			}
+		}
+	}
+
+	public Icon getIcon() {
+		return IconThemeHelper.getImageIcon("layer-modify-overviews");
+	}
+
+	public void end(Object param) {
+		try {
+			((FLyrDefault) param).reload();
+		} catch (ReloadLayerException e) {
+		}
+	}
+
+	public void propertyChange(PropertyChangeEvent evt) {}
+	public void interrupted() {}
+	
+	public boolean isEnableEvents() {
+		return true;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/overview/OverviewsTocMenuEntry.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/overview
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/layerdatatype/LayerDatatypeTocMenuEntry.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/layerdatatype/LayerDatatypeTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/layerdatatype/LayerDatatypeTocMenuEntry.java	(revision 8183)
@@ -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.raster.tools.app.basic.tool.layerdatatype;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.Icon;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.defaultbuttonspanel.DefaultButtonsPanel;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.algorithm.BasicAPISwingPanel;
+import org.gvsig.raster.algorithm.process.DataProcess;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.layers.ILayerState;
+import org.gvsig.raster.fmap.layers.IRasterLayerActions;
+import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
+import org.gvsig.raster.tools.algorithm.swing.AlgorithmSwingLocator;
+import org.gvsig.raster.tools.app.basic.MainWindow;
+
+/**
+ * <code>LayerDatatypeMenuEntry</code> entry point to change the data type of a layer
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class LayerDatatypeTocMenuEntry extends AbstractTocContextMenuAction 
+	implements IGenericToolBarMenuItem, ActionListener {
+	static private LayerDatatypeTocMenuEntry       singleton              = null;
+	private MainWindow                             window                 = null;
+	private BasicAPISwingPanel                     panel                  = null;
+	private FLyrRaster                             inputLayer             = null;
+	
+	/**
+	 * Nobody can instantiate this object. It's necessary to use getSingleton method
+	 */
+	private LayerDatatypeTocMenuEntry() {}
+
+	/**
+	 * Gets a unique instance of this class
+	 * @return
+	 */
+	public static LayerDatatypeTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new LayerDatatypeTocMenuEntry();
+		return singleton;
+	}
+
+	public String getGroup() {
+		return "RasterExport";
+	}
+
+	public int getGroupOrder() {
+		return 50;
+	}
+
+	public int getOrder() {
+		return 2;
+	}
+
+	public String getText() {
+		return Messages.getText("change_datatype");
+	}
+
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof ILayerState))
+			return false;
+
+		if (!((ILayerState) selectedItems[0]).isOpen())
+			return false;
+		return true;
+	}
+
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof IRasterLayerActions))
+			return false;
+
+		return ((IRasterLayerActions) selectedItems[0]).isActionEnabled(IRasterLayerActions.CLIPPING);
+	}
+
+	public void execute(ITocItem item, FLayer[] selectedItems) {
+		FLayer fLayer = null;
+
+		if (selectedItems.length != 1)
+			return;
+
+		fLayer = selectedItems[0];
+
+		if (!(fLayer instanceof FLyrRaster))
+			return;
+		inputLayer = (FLyrRaster)fLayer;
+		
+		panel = AlgorithmSwingLocator.getSwingManager().createLayerDatatypePanel(
+				inputLayer.getDataStore(), 
+				getDataType(inputLayer),
+				inputLayer.getName());
+		window = new MainWindow(panel.getComponent(), 
+				null, 
+				Messages.getText("change_datatype"), 
+				350, 290, 
+				this);
+		
+		PluginServices.getMDIManager().addCentredWindow(window);
+	}
+	
+	/**
+	 * Gets the data type of the input layer as String
+	 * @param fLayer
+	 * @return
+	 */
+	private String getDataType(FLyrRaster fLayer) {
+		int dt = fLayer.getDataStore().getDataType()[0];
+		if(dt == Buffer.TYPE_BYTE)
+			return "BYTE";
+		if(dt == Buffer.TYPE_SHORT)
+			return "SHORT";
+		if(dt == Buffer.TYPE_INT)
+			return "INTEGER";
+		if(dt == Buffer.TYPE_FLOAT)
+			return "FLOAT";
+		if(dt == Buffer.TYPE_DOUBLE)
+			return "DOUBLE";
+		return "";
+	}
+	
+	public void actionPerformed(ActionEvent e) {
+		if( e.getSource() == ((DefaultButtonsPanel)window).getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY) ||
+				e.getSource() == ((DefaultButtonsPanel)window).getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT)) {
+			DataProcess task = null;
+			try {
+				task = (DataProcess)panel.getResult();
+			} catch (Exception e1) {
+				Messages.getText("error_getting_process");
+			}
+			task.setActions(new ProcessEndActions(window, inputLayer));
+			task.init();
+			task.start();
+		}
+	}
+
+	public Icon getIcon() {
+		return IconThemeHelper.getImageIcon("datatype-icon");
+	}
+	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/layerdatatype/LayerDatatypeTocMenuEntry.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/layerdatatype/ProcessEndActions.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/layerdatatype/ProcessEndActions.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/layerdatatype/ProcessEndActions.java	(revision 8183)
@@ -0,0 +1,181 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2011-2012 Prodevelop S.L
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.app.basic.tool.layerdatatype;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.HashMap;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+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.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.fmap.mapcontext.layers.FLyrDefault;
+import org.gvsig.raster.algorithm.process.IProcessActions;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.swing.RasterSwingLocator;
+import org.gvsig.raster.tools.algorithm.layerdatatype.LayerDatatypeProcess;
+import org.gvsig.raster.util.RasterNotLoadException;
+
+/**
+ * Actions when the process finalizes or is interrupted
+ *
+ * Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ProcessEndActions implements IProcessActions {
+	private IWindow     window        = null;
+	private FLayer      inputLyr      = null;
+
+	/**
+	 * Constructor
+	 * @param window
+	 * @param lyr
+	 *        The input layer is only used to select the view where the new layer be loaded
+	 */
+	public ProcessEndActions(IWindow window, FLayer lyr) {
+		this.window = window;
+		this.inputLyr = lyr;
+	}
+
+	@SuppressWarnings("unchecked")
+	public void end(Object params) {
+		if(window != null) {
+			PluginServices.getMDIManager().closeWindow(window);
+			window = null;
+		}
+		if(params instanceof HashMap<?, ?>) {
+			HashMap<String, Object>  map = (HashMap<String, Object>) params;
+			String fName = (String)map.get(LayerDatatypeProcess.FILENAME);
+			long milis = (Long)map.get(LayerDatatypeProcess.TIME);
+			processFinalize(fName, milis);
+			RasterSwingLocator.getSwingManager().showSummaryProcessDialog(fName, milis);
+		}
+
+	}
+
+	/**
+	 * Acciones que se realizan al finalizar de crear los recortes de imagen.
+	 * Este m�todo es llamado por el thread TailRasterProcess al finalizar.
+	 */
+	private void processFinalize(String fileName, long milis) {
+		if (!new File(fileName).exists())
+			return;
+
+		if (RasterSwingLibrary.messageBoxYesOrNot("cargar_toc", this)) {
+			try {
+				loadLayer(fileName, fileName.substring(fileName.lastIndexOf(File.separator) + 1));
+			} catch (RasterNotLoadException e) {
+				RasterSwingLibrary.messageBoxError("error_load_layer", e);
+			}
+		}
+	}
+
+	/**
+	 * Gets the view
+	 * @return
+	 */
+	private AbstractViewPanel getView() {
+		IWindow[] w = PluginServices.getMDIManager().getAllWindows();
+		for (int i = 0; i < w.length; i++) {
+			if(w[i] instanceof AbstractViewPanel) {
+				FLayers lyrs = ((AbstractViewPanel)w[i]).getMapControl().getMapContext().getLayers();
+				for (int j = 0; j < lyrs.getLayersCount(); j++) {
+					FLayer lyr = lyrs.getLayer(j);
+					if(inputLyr == lyr) {
+						return ((AbstractViewPanel) w[i]);
+					}
+				}
+			}
+		}
+		return null;
+	}
+
+	@SuppressWarnings("deprecation")
+	private void loadLayer(String fileName, String layerName) throws RasterNotLoadException {
+		if(fileName ==  null)
+			return;
+
+		//Seleccionamos la vista de gvSIG
+		AbstractViewPanel theView = getView();
+
+		theView.getMapControl().getMapContext().beginAtomicEvent();
+
+		try {
+			DataManager dataManager = DALLocator.getDataManager();
+
+			ProviderServices provServ = RasterLocator.getManager().getProviderServices();
+			RasterDataParameters storeParameters = provServ.createParameters(fileName);
+            File file = new File(fileName);
+			storeParameters.setURI(file.toURI());
+
+			MapContextManager mcm = MapContextLocator.getMapContextManager();
+
+			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.");
+			}
+
+			if(layerName == null) {
+				int endIndex = fileName.lastIndexOf(".");
+				if (endIndex < 0)
+					endIndex = fileName.length();
+
+				layerName = fileName.substring(fileName.lastIndexOf(File.separator) + 1, endIndex);
+			}
+
+			FLayer lyr = mcm.createLayer(layerName, dataStore);
+			theView.getMapControl().getMapContext().getLayers().addLayer(lyr);
+
+		} catch (LoadLayerException e) {
+			throw new RasterNotLoadException("Error al cargar la capa.", e);
+		}
+		theView.getMapControl().getMapContext().invalidate();
+		theView.getMapControl().getMapContext().endAtomicEvent();
+	}
+
+	public void interrupted() {
+
+    }
+
+	public void updateProgress(int current, int total) {
+
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/layerdatatype/ProcessEndActions.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/layerdatatype
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrgb/SelectRGBListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrgb/SelectRGBListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrgb/SelectRGBListener.java	(revision 8183)
@@ -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.tools.app.basic.tool.selectrgb;
+
+import java.awt.geom.Point2D;
+import java.awt.image.BufferedImage;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.Events.PointEvent;
+import org.gvsig.raster.tools.app.basic.tool.selectrasterlayer.SelectImageListImpl;
+
+/**
+ * Extensi�n de la clase SelectImageListenerImple de FMap. Esta clase permite
+ * capturar el evento de la selecci�n de un punto RGB sobre la vista
+ * 
+ * 22/02/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class SelectRGBListener extends SelectImageListImpl {
+	private ISelectRGB selectRGB;
+
+	/**
+	 * Contructor
+	 * @param mapCtrl
+	 */
+	public SelectRGBListener(MapControl mapCtrl, ISelectRGB selectRGB) {
+		super(mapCtrl);
+		this.selectRGB = selectRGB;
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.PointListener#point(com.iver.cit.gvsig.fmap.tools.Events.PointEvent)
+	 */
+	public void point(PointEvent event) {
+		super.point(event);
+
+		Point2D point2D = event.getPoint();
+
+		if (PluginServices.getMainFrame() != null)
+			PluginServices.getMainFrame().enableControls();
+
+		BufferedImage image = mapCtrl.getImage();
+		int value = image.getRGB((int) point2D.getX(), (int) point2D.getY());
+		int r = (value >> 16) & 0xff;
+		int g = (value >> 8) & 0xff;
+		int b = value & 0xff;
+		
+		selectRGB.actionRGBSelected(r, g, b);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrgb/SelectRGBListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrgb/ISelectRGB.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrgb/ISelectRGB.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrgb/ISelectRGB.java	(revision 8183)
@@ -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.tools.app.basic.tool.selectrgb;
+
+/**
+ * Interfaz para la seleccion de un RGB
+ * 
+ * 22/02/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public interface ISelectRGB {
+	/**
+	 * Establece el RGB seleccionado con el puntero del raton sobre la vista
+	 * @param r
+	 * @param g
+	 * @param b
+	 */
+	public void actionRGBSelected(int r, int g, int b);
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrgb/ISelectRGB.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrgb
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/viewexport/SaveViewToImageTocMenuEntry.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/viewexport/SaveViewToImageTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/viewexport/SaveViewToImageTocMenuEntry.java	(revision 8183)
@@ -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.tools.app.basic.tool.viewexport;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import javax.swing.Icon;
+
+import org.gvsig.andami.plugins.Extension;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+
+
+/**
+ * Entry point for save view to image
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SaveViewToImageTocMenuEntry extends AbstractTocContextMenuAction implements PropertyChangeListener, IGenericToolBarMenuItem {
+	static private SaveViewToImageTocMenuEntry singleton  = null;
+	private Extension                          extension  = null;
+
+	/**
+	 * Nadie puede crear una instancia a esta clase �nica, hay que usar el
+	 * getSingleton()
+	 */
+	private SaveViewToImageTocMenuEntry() {
+		
+	}
+	
+	private Extension getExtension() {
+		if(extension == null) {
+			extension = new Export();
+			extension.initialize();
+			extension.postInitialize();
+		}
+		return extension;
+	}
+
+	/**
+	 * Devuelve un objeto unico a dicha clase
+	 * @return
+	 */
+	static public SaveViewToImageTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new SaveViewToImageTocMenuEntry();
+		return singleton;
+	}
+	
+	public String getGroup() {
+		return "RasterExport";
+	}
+
+	public int getGroupOrder() {
+		return 50;
+	}
+
+	public int getOrder() {
+		return 3;
+	}
+
+	public String getText() {
+		return RasterToolsUtil.getText(this, "export_view_to_image");
+	}
+	
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		return getExtension().isEnabled();
+	}
+
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		return getExtension().isVisible();
+	}
+
+	public void execute(ITocItem item, FLayer[] selectedItems) {		
+		getExtension().execute(null);
+	}
+
+	public Icon getIcon() {
+		return RasterToolsUtil.getIcon("view-export-image");
+	}
+
+	public void propertyChange(PropertyChangeEvent evt) {}
+	
+	public boolean isEnableEvents() {
+		return true;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/viewexport/SaveViewToImageTocMenuEntry.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/viewexport/Export.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/viewexport/Export.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/viewexport/Export.java	(revision 8183)
@@ -0,0 +1,409 @@
+package org.gvsig.raster.tools.app.basic.tool.viewexport;
+
+import java.awt.Component;
+import java.awt.geom.AffineTransform;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.util.Hashtable;
+import java.util.Iterator;
+
+import javax.swing.JFileChooser;
+import javax.swing.JOptionPane;
+import javax.swing.filechooser.FileFilter;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.plugins.Extension;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+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.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.store.DataServerWriter;
+import org.gvsig.fmap.dal.coverage.store.RasterWriter;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.sun.jimi.core.Jimi;
+import com.sun.jimi.core.JimiException;
+
+
+/**
+ * Plugin to export the view to image
+ */
+public class Export extends Extension {
+	private Logger                          log                     = LoggerFactory.getLogger(Export.class);
+	private String                          lastPath                = null;
+	private Hashtable<String, MyFileFilter> cmsExtensionsSupported  = null;
+	private Hashtable<String, MyFileFilter> jimiExtensionsSupported = null;
+
+	public boolean isEnabled() {
+		IWindow f = PluginServices.getMDIManager().getActiveWindow();
+
+		if (f == null || !(f instanceof AbstractViewPanel)) {
+			return false;
+		}
+
+		AbstractViewPanel avp = (AbstractViewPanel)f;
+		FLayers layers = avp.getMapControl().getMapContext().getLayers();
+		for (int i = 0; i < layers.getLayersCount(); i++) {
+			if(layers.getLayer(i) != null)
+				return layers.getLayer(i).isAvailable();
+		}
+		return false;
+	}
+
+	public boolean isVisible() {
+		IWindow f = PluginServices.getMDIManager().getActiveWindow();
+		if (f == null) {
+			return false;
+		}
+
+		return (f instanceof AbstractViewPanel);
+	}
+
+	public void initialize() {
+	}
+
+	public void postInitialize() {
+		cmsExtensionsSupported = new Hashtable<String, MyFileFilter>();
+		jimiExtensionsSupported = new Hashtable<String, MyFileFilter>();
+		cmsExtensionsSupported.put("jpg", new MyFileFilter("jpg",
+				PluginServices.getText(this, "jpeg_file"), "cms"));
+		jimiExtensionsSupported.put("png",new MyFileFilter("png",
+				PluginServices.getText(this, "png_file"), "cms"));
+		jimiExtensionsSupported.put("bmp",new MyFileFilter("bmp",
+				PluginServices.getText(this, "bmp_file"), "cms"));
+		cmsExtensionsSupported.put("tif",new MyFileFilter("tif",
+				PluginServices.getText(this, "tif_file"), "cms"));
+	}
+
+	public static boolean saveImageCMS(File fileDst,BufferedImage srcImage) throws RasterDriverException, IOException   {
+		RasterManager manager = (RasterManager)RasterLocator.getManager();
+		DataServerWriter data = new RasterizerImage(srcImage);
+		RasterWriter writer = null;
+		try {
+			/*DataServerExplorerParameters eparams = DALLocator.getDataManager().createServerExplorerParameters("FilesystemExplorer");
+			eparams.setDynValue("initialpath", fileDst.getAbsolutePath());
+			DataServerExplorer serverExplorer = DALLocator.getDataManager().openServerExplorer(eparams.getExplorerName(), eparams);
+			NewRasterStoreParameters sparams = (NewRasterStoreParameters)serverExplorer.getAddParameters("Gdal Store");
+			sparams.setDataServer((DataServerWriter)processIncrement);
+			sparams.setDestination(path, file);
+			sparams.setBuffer(buffer);
+			sparams.setColorInterpretation(new String[]{ColorInterpretation.GRAY_BAND});
+			sparams.setWktProjection(dstoreCopy.getWktProjection());
+			sparams.setBand(i);
+			sparams.setAffineTransform(affineTransform);
+			sparams.setDriverParams(params);
+			serverExplorer.add(provider, sparams, true);*/
+			
+			Params params = manager.createWriter(fileDst.getAbsolutePath()).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
+			writer = manager.createWriter(data, 
+											fileDst.getAbsolutePath(),
+											3,
+											new AffineTransform(1, 0, 0, -1, 0, 0),
+											srcImage.getWidth(), 
+											srcImage.getHeight(), 
+											Buffer.TYPE_IMAGE,
+											params,
+											null);
+			if (writer == null) {
+				PluginServices.getLogger().error("No supported Format: " + fileDst.getAbsolutePath());
+				return false;
+			}
+		} catch (NotSupportedExtensionException e) {
+			throw new RasterDriverException("");
+		}
+		try {
+			writer.dataWrite();
+		} catch (ProcessInterruptedException e) {
+		}
+		writer.writeClose();
+		return true;
+	}
+
+
+
+	public static boolean saveImageJimi(File fileDst,BufferedImage srcImage) throws Exception{
+		try {
+
+			Jimi.putImage(srcImage, fileDst.getAbsolutePath());
+
+		} catch (JimiException e) {
+			throw new Exception(fileDst.getAbsolutePath(),e);
+		}
+		return true;
+
+	}
+
+	/**
+	 * @see org.gvsig.andami.plugins.IExtension#execute(java.lang.String)
+	 */
+	public void execute(String actionCommand) {
+		JFileChooser jfc = new JFileChooser(lastPath);
+
+		jfc.removeChoosableFileFilter(jfc.getAcceptAllFileFilter());
+
+		Iterator<MyFileFilter> iter = cmsExtensionsSupported.values().iterator();
+		while (iter.hasNext()){
+			jfc.addChoosableFileFilter((FileFilter)iter.next());
+		}
+
+		iter = jimiExtensionsSupported.values().iterator();
+		while (iter.hasNext()){
+			jfc.addChoosableFileFilter((FileFilter)iter.next());
+		}
+
+		jfc.setFileFilter((FileFilter)jimiExtensionsSupported.get("png"));
+		if (jfc.showSaveDialog(
+				(Component) PluginServices.getMainFrame()
+				) == JFileChooser.APPROVE_OPTION) {
+
+			BufferedImage tempImage;
+
+			tempImage = ((AbstractViewPanel) PluginServices.getMDIManager().getActiveWindow()).getImage();
+
+			File f = jfc.getSelectedFile();
+
+			lastPath = f.getParent();
+
+			MyFileFilter filter = (MyFileFilter)jfc.getFileFilter();
+			f = filter.normalizeExtension(f);
+
+
+			if (f.exists()){
+				int resp = JOptionPane.showConfirmDialog(
+						(Component) PluginServices.getMainFrame(),
+						PluginServices.getText(this,
+								"fichero_ya_existe_seguro_desea_guardarlo")+
+								"\n"+
+								f.getAbsolutePath(),
+						PluginServices.getText(this,"guardar"), JOptionPane.YES_NO_OPTION);
+				if (resp != JOptionPane.YES_OPTION) {
+					return;
+				}
+
+			}
+
+			if (filter.getInfo().equalsIgnoreCase("cms")){
+
+				try {
+					saveImageCMS(f, tempImage);
+				} catch (IOException e) {
+					log.debug("Error exportando la imagen", e);
+				} catch (RasterDriverException e) {
+					log.debug("Error exportando la imagen", e);
+				}
+			}else if (filter.getInfo().equalsIgnoreCase("jimi")) {
+				try {
+					saveImageJimi(f, tempImage);
+				} catch (Exception e) {
+					log.debug("Error exportando la imagen", e);
+				}
+
+			}
+
+
+		}
+	}
+}
+
+/**
+ * Servidor de datos desde un BufferedImage. Cada petici�n es de un tama�o
+ * de bloque indicado por el escritor en los par�metros de la llamada por lo 
+ * que en la siguiente petici�n habr� que escribir el bloque siguiente.
+ */
+class RasterizerImage implements DataServerWriter {
+	private BufferedImage source  = null;
+	private int[]         data    = null;
+	private int           y       = 0;
+
+	public RasterizerImage(BufferedImage source) {
+		this.source = source;
+	}
+
+	/**
+	 * Solo necesita implementar el m�todo RGB porque solo se
+	 * utiliza para exportar la vista.
+	 */
+	public int[] readARGBData(int sX, int sY, int nBand){
+		return readData( sX, sY, nBand);
+	}
+
+	public int[] readData(int sizeX, int sizeY, int nBand) {
+		if(nBand == 0) { //Con nBand==0 se devuelven las 3 bandas
+			this.data = this.source.getRGB(0, y, sizeX, sizeY, this.data, 0, sizeX);
+			y += sizeY;
+			return this.data;
+		}
+		return null;
+	}
+
+	public byte[][] readByteData(int sizeX, int sizeY) {
+		return null;
+	}
+
+	public double[][] readDoubleData(int sizeX, int sizeY) {
+		return null;
+	}
+
+	public float[][] readFloatData(int sizeX, int sizeY) {
+		return null;
+	}
+
+	public int[][] readIntData(int sizeX, int sizeY) {
+		return null;
+	}
+
+	public short[][] readShortData(int sizeX, int sizeY) {
+		return null;
+	}
+
+	public int getPercent() {
+		return 0;
+	}
+
+	public void setAlphaBuffer(Buffer alphaBuffer) {
+		
+	}
+
+	public void setBuffer(Buffer buffer, int nband) {
+		
+	}
+
+	public Buffer getBuffer() {
+		return null;
+	}
+	
+	public void setBand(int nband) {
+		
+	}
+
+	public void dispose() {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public Buffer getSource() {
+		return null;
+	}
+
+	public void setPercent(int value) {
+		// TODO Auto-generated method stub
+		
+	}
+}
+
+class MyFileFilter extends FileFilter{
+
+	private String[] extensiones = new String[1];
+	private String   description = null;
+	private boolean  dirs        = true;
+	private String   info        = null;
+
+	public MyFileFilter(String[] ext, String desc) {
+		extensiones = ext;
+		description = desc;
+	}
+
+	public MyFileFilter(String[] ext, String desc,String info) {
+		extensiones = ext;
+		description = desc;
+		this.info = info;
+	}
+
+	public MyFileFilter(String ext, String desc) {
+		extensiones[0] = ext;
+		description = desc;
+	}
+
+	public MyFileFilter(String ext, String desc,String info) {
+		extensiones[0] = ext;
+		description = desc;
+		this.info = info;
+	}
+
+	public MyFileFilter(String ext, String desc, boolean dirs) {
+		extensiones[0] = ext;
+		description = desc;
+		this.dirs = dirs;
+	}
+
+	public MyFileFilter(String ext, String desc, boolean dirs,String info) {
+		extensiones[0] = ext;
+		description = desc;
+		this.dirs = dirs;
+		this.info = info;
+	}
+
+	public boolean accept(File f) {
+		if (f.isDirectory()) {
+			if (dirs) {
+				return true;
+			} else {
+				return false;
+			}
+		}
+		for (int i = 0; i < extensiones.length; i++) {
+			if (extensiones[i].equals("")) {
+				continue;
+			}
+			if (getExtensionOfAFile(f).equalsIgnoreCase(extensiones[i])) {
+				return true;
+			}
+		}
+
+		return false;
+	}
+
+	/**
+	 * @see javax.swing.filechooser.FileFilter#getDescription()
+	 */
+	public String getDescription() {
+		return description;
+	}
+
+	public String[] getExtensions() {
+		return extensiones;
+	}
+
+	public boolean isDirectory(){
+		return dirs;
+	}
+
+	private String getExtensionOfAFile(File file){
+		String name;
+		int dotPos;
+		name = file.getName();
+		dotPos = name.lastIndexOf(".");
+		if (dotPos < 1){
+			return "";
+		}
+		return name.substring(dotPos+1);
+	}
+
+	public File normalizeExtension(File file){
+		String ext = getExtensionOfAFile(file);
+		if (ext.equals("") || !(this.accept(file))){
+			return new File(file.getAbsolutePath() + "." + extensiones[0]);
+		}
+		return file;
+	}
+
+	public String getInfo(){
+		return this.info;
+	}
+
+	public void setInfo(String info){
+		this.info = info;
+	}
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/viewexport/Export.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/viewexport
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/SaveViewToRasterTocMenuEntry.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/SaveViewToRasterTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/SaveViewToRasterTocMenuEntry.java	(revision 8183)
@@ -0,0 +1,135 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.saveviewtoraster;
+
+import javax.swing.Icon;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.app.project.documents.view.ViewDocument;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.app.project.documents.view.toolListeners.StatusBarListener;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseMovementBehavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.RectangleBehavior;
+import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.tool.saveviewtoraster.tool.SaveRasterRectangleTool;
+
+
+/**
+ * Punto de entrada para la funcionalidad de salvar a raster
+ * 
+ * 22/07/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class SaveViewToRasterTocMenuEntry extends AbstractTocContextMenuAction implements IGenericToolBarMenuItem {
+	static private SaveViewToRasterTocMenuEntry singleton  = null;
+
+	/**
+	 * Nadie puede crear una instancia a esta clase �nica, hay que usar el
+	 * getSingleton()
+	 */
+	private SaveViewToRasterTocMenuEntry() {}
+
+	/**
+	 * Devuelve un objeto unico a dicha clase
+	 * @return
+	 */
+	static public SaveViewToRasterTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new SaveViewToRasterTocMenuEntry();
+		return singleton;
+	}
+
+	public String getGroup() {
+		return "RasterExport";
+	}
+
+	public int getGroupOrder() {
+		return 50;
+	}
+
+	public int getOrder() {
+		return 0;
+	}
+
+	public String getText() {
+		return RasterToolsUtil.getText(this, "salvar_raster_geo");
+	}
+
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		return true;
+	}
+
+	@SuppressWarnings("deprecation")
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		org.gvsig.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager().getActiveWindow();
+		if (f == null)
+			return false;
+
+		if (f instanceof AbstractViewPanel) {
+			AbstractViewPanel vista = (AbstractViewPanel) f;
+			ViewDocument model = vista.getModel();
+			MapContext mapa = model.getMapContext();
+			if (mapa.getLayers().getLayersCount() > 0) 
+				return true;
+		}
+
+		return false;
+	}
+
+	public void execute(ITocItem item, FLayer[] selectedItems) {
+		AbstractViewPanel theView = (AbstractViewPanel) PluginServices.getMDIManager().getActiveWindow();
+		MapControl mapCtrl = theView.getMapControl();
+
+		// Listener de eventos de movimiento que pone las coordenadas del rat�n en
+		// la barra de estado
+		StatusBarListener sbl = new StatusBarListener(mapCtrl);
+
+		RasterSwingLibrary.messageBoxInfo("start_save", theView);
+		loadSaveRasterListener(mapCtrl, sbl, theView.getViewDocument().getName());
+		mapCtrl.setTool("SaveRasterRectangleTool");
+	}
+	
+	/**
+	 * Carga el listener de salvar a raster en el MapControl.
+	 */
+	private void loadSaveRasterListener(MapControl m_MapControl, StatusBarListener sbl, String viewName) {
+		// Si no se ha cargado el listener a�n lo cargamos.
+		if (m_MapControl.getNamesMapTools().get("SaveRasterRectangleTool") == null) {
+			SaveRasterRectangleTool srl = new SaveRasterRectangleTool(m_MapControl, viewName);
+			m_MapControl.addBehavior("SaveRasterRectangleTool", new Behavior[] { new RectangleBehavior(srl), new MouseMovementBehavior(sbl) });
+		}
+	}
+	
+	public Icon getIcon() {
+		return IconThemeHelper.getImageIcon("view-export-georeferenced-raster");
+	}
+	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/SaveViewToRasterTocMenuEntry.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/tool/SaveRasterRectangleTool.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/tool/SaveRasterRectangleTool.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/tool/SaveRasterRectangleTool.java	(revision 8183)
@@ -0,0 +1,147 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.saveviewtoraster.tool;
+
+
+import java.awt.Image;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.text.DecimalFormat;
+import java.text.NumberFormat;
+import java.util.Locale;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.Events.EnvelopeEvent;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.RectangleListener;
+import org.gvsig.raster.tools.algorithm.swing.saveraster.SaveRasterPanel;
+import org.gvsig.raster.tools.app.basic.tool.saveviewtoraster.ui.SaveViewToRasterDialog;
+
+
+
+/**
+ * Extensi�n de la clase SaveRasterListenerImpl de FMap para poder llamar a m�todos
+ * de andami o de gvSIG.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SaveRasterRectangleTool implements RectangleListener {
+	private final Image   isaveraster = IconThemeHelper.getImage("rectangle-select-cursor");
+	protected MapControl  mapCtrl     = null;
+	protected Rectangle2D pixelRect   = null;
+	protected Envelope    rect        = null;
+	private String        viewName    = null;
+
+	/**
+	 * Crea un nuevo RectangleListenerImpl.
+	 *
+	 * @param mapCtrl MapControl.
+	 */
+	public SaveRasterRectangleTool(MapControl mapCtrl, String viewName) {
+		this.mapCtrl = mapCtrl;
+		this.viewName = viewName;
+	}
+	
+	public void rectangle(EnvelopeEvent event) {
+		rect = event.getWorldCoordRect();
+		pixelRect = event.getPixelCoordRect();
+
+		if (PluginServices.getMainFrame() != null)
+				PluginServices.getMainFrame().enableControls();
+
+		FLayers layers = mapCtrl.getMapContext().getLayers();
+
+		SaveViewToRasterDialog saveRaster = null;
+		boolean open = false;
+		IWindow[] win = PluginServices.getMDIManager().getAllWindows();
+		for(int i = 0; i < win.length; i++) {
+			if(win[i] instanceof SaveViewToRasterDialog) {
+				saveRaster = (SaveViewToRasterDialog)win[i];
+				open = true;
+			}
+		}
+		if(saveRaster == null)
+			saveRaster = new SaveViewToRasterDialog(layers, mapCtrl, viewName);
+
+		ViewPort vp = mapCtrl.getViewPort();
+		Point2D ini = vp.fromMapPoint(rect.getMinimum(0), rect.getMinimum(1));
+		Point2D fin = vp.fromMapPoint(rect.getMaximum(0), rect.getMaximum(1));
+		if(Math.abs(fin.getY() - ini.getY()) > 10 && Math.abs(fin.getX() - ini.getX()) > 10) {
+			SaveRasterPanel panel = saveRaster.getSaveRasterPanel();
+			panel.getBProperties().setEnabled(false);
+
+			DecimalFormat nf = (DecimalFormat)NumberFormat.getInstance(Locale.ENGLISH);
+			nf.applyPattern("#.#");
+	        nf.setMaximumFractionDigits(4);
+	        
+			if(!vp.getProjection().isProjected())
+				nf.setMaximumFractionDigits(6);
+
+			try{
+				panel.setValueLRX(nf.format(rect.getMaximum(0)));
+			}catch(IndexOutOfBoundsException ex){
+				panel.setValueLRX(String.valueOf(rect.getMaximum(0)));
+			}
+
+			try{
+				panel.setValueLRY(nf.format(rect.getMinimum(1)));
+			}catch(IndexOutOfBoundsException ex){
+				panel.setValueLRY(String.valueOf(rect.getMinimum(1)));
+			}
+
+			try{
+				panel.setValueULX(nf.format(rect.getMinimum(0)));
+			}catch(IndexOutOfBoundsException ex){
+				panel.setValueULX(String.valueOf(rect.getMinimum(0)));
+			}
+
+			try{
+				panel.setValueULY(nf.format(rect.getMaximum(1)));
+			}catch(IndexOutOfBoundsException ex){
+				panel.setValueULY(String.valueOf(rect.getMaximum(1)));
+			}
+			if(!open) {
+				PluginServices.getMDIManager().addCentredWindow(saveRaster);
+			}
+			panel.setWidthPxValue(String.valueOf((int)pixelRect.getWidth()));
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener#getImageCursor()
+	 */
+	public Image getImageCursor() {
+		return isaveraster;
+	}
+	
+	public boolean cancelDrawing() {
+	    System.out.println("cancelDrawing del SaveRasterListenerImpl");
+		return true;
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/tool/SaveRasterRectangleTool.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/tool
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/SaveViewToRasterDialog.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/SaveViewToRasterDialog.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/SaveViewToRasterDialog.java	(revision 8183)
@@ -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.tools.app.basic.tool.saveviewtoraster.ui;
+
+import java.awt.BorderLayout;
+import java.awt.Container;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.andami.ui.mdiManager.WindowInfo;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.defaultbuttonspanel.DefaultButtonsPanel;
+import org.gvsig.raster.tools.algorithm.swing.AlgorithmSwingLocator;
+import org.gvsig.raster.tools.algorithm.swing.saveraster.SaveRasterPanel;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.DriverProperties;
+import org.gvsig.raster.tools.app.basic.tool.saveviewtoraster.ui.listener.DataInputListener;
+import org.gvsig.raster.tools.app.basic.tool.saveviewtoraster.ui.listener.SaveViewToRasterDialogListener;
+
+/**
+ * Panel que contiene los botones de Aceptar, Cancelar y Aplicar heredando de
+ * DefaultDialogPanel. Dentro de este estar� el panel con los controles de
+ * salvar a raster.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SaveViewToRasterDialog extends DefaultButtonsPanel implements IWindow {
+	final private static long 			serialVersionUID = -3370601314380922368L;
+	private DataInputListener			listener         =  null;
+	public DriverProperties				driverProps      = null;
+	private SaveRasterPanel             saveRasterPanel  = null;
+	private FLayers				 		layers           = null;
+	private String                      viewName         = null;
+
+	/**
+	 * Constructor de la ventana de dialogo para gvSIG.
+	 */
+	public SaveViewToRasterDialog(FLayers layers, MapControl mapCtrl, String viewName) {
+		super(ButtonsPanel.BUTTONS_APPLYCLOSE);
+		driverProps = new DriverProperties();
+		this.layers = layers;
+		this.viewName = viewName;
+		init(mapCtrl);
+	}
+
+	/**
+	 * Constructor generico para poder visualizar la ventana desde
+	 * una funci�n main.
+	 */
+	public SaveViewToRasterDialog() {
+		super(ButtonsPanel.BUTTONS_NONE);
+			init(null);
+	}
+
+	public String getViewName() {
+		return viewName;
+	}
+	
+	/**
+	 * Inicializaci�n del panel.
+	 * @return void
+	 */
+	public void init(MapControl mapCtrl) {
+		setLayout(new BorderLayout());
+		add(getSaveRasterPanel().getComponent(), BorderLayout.CENTER);
+
+		if (layers != null && mapCtrl != null)
+			new SaveViewToRasterDialogListener(this, layers, mapCtrl);
+
+		getDataInputListener();
+
+		setName("saveRaster");
+	}
+
+	/**
+	 * Cierra esta ventana a trav�s de andami
+	 */
+	public void closeJDialog() {
+		this.setVisible(false);
+		for(int i = 0; i < layers.getLayersCount(); i++){
+			layers.getLayer(i).getMapContext().invalidate();
+		}
+		PluginServices.getMDIManager().closeWindow(SaveViewToRasterDialog.this);
+	}
+
+	/**
+	 * Obtiene el panel con los controles de Salvar a Raster.
+	 * @return
+	 */
+	public SaveRasterPanel getSaveRasterPanel() {
+		if (saveRasterPanel == null) {
+			saveRasterPanel = AlgorithmSwingLocator.getSwingManager().createSaveRasterPanel();
+		}
+		return saveRasterPanel;
+	}
+
+	public DataInputListener getDataInputListener() {
+		if (listener == null) {
+			listener = new DataInputListener(getSaveRasterPanel());
+			listener.setLayers(layers);
+		}
+		return listener;
+	}
+
+	/**
+	 * This method initializes jContentPane	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */    
+	public Container getContentPane() {
+		return this;
+	}
+
+	/**
+	 * Asigna la lista de capas
+	 * @param layers
+	 */
+	public void setLayerList(FLayers layers){
+		this.layers = layers;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.IWindow#getWindowInfo()
+	 */
+	public WindowInfo getWindowInfo() {
+		WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODELESSDIALOG | WindowInfo.RESIZABLE);
+		m_viewinfo.setTitle(PluginServices.getText(this, "clip_view"));
+		m_viewinfo.setWidth(310);
+		m_viewinfo.setHeight(490);
+		return m_viewinfo;
+	}
+
+	public Object getWindowProfile() {
+		return WindowInfo.PROPERTIES_PROFILE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/SaveViewToRasterDialog.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/listener/DataInputListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/listener/DataInputListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/listener/DataInputListener.java	(revision 8183)
@@ -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.tools.app.basic.tool.saveviewtoraster.ui.listener;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+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.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.util.EventObject;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.util.MathUtils;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.gui.beans.datainput.DataInputContainerListener;
+import org.gvsig.gui.beans.swing.JFileChooser;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.algorithm.swing.saveraster.SaveRasterPanel;
+import org.gvsig.raster.util.ExtendedFileFilter;
+
+/**
+ * Listener to synchronize the components in the main panel
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DataInputListener implements ActionListener, MouseListener, FocusListener, KeyListener, DataInputContainerListener, PropertyChangeListener {
+	final private static long        serialVersionUID         = -3370601314380922368L;
+	private SaveRasterPanel          controlPanel             = null;
+	private String                   fName                    = null;
+	private boolean                  enableEventValueChanged  = true;
+	private MathUtils                math                     = RasterLocator.getManager().getMathUtils();
+	//private ViewPort                 viewPort                 = null;
+	//private FLayers                  layers                   = null;
+	
+	/**
+	 * This method initializes
+	 *
+	 */
+	public DataInputListener(SaveRasterPanel controlPanel) {
+		super();
+		this.controlPanel = controlPanel;
+		initialize();
+	}
+	
+	public void setLayers(FLayers layers) {
+		//this.layers = layers;
+		//this.viewPort = layers.getMapContext().getViewPort();
+	}
+
+	/**
+	 * This method initializes this
+	 *
+	 * @return void
+	 */
+	void initialize() {
+		controlPanel.addPropertiesChangeListener(this);
+		controlPanel.addValueChangedListener(this);
+		controlPanel.getCbResolution().addKeyListener(this);
+		controlPanel.addActionListener(this);
+	}
+	
+	/**
+	 * Checks a integer value
+	 * @param value
+	 * @return
+	 */
+	private boolean checkInteger(String value) {
+		if(value == null)
+			return false;
+		if(value.length() > 8) {
+			RasterSwingLibrary.messageBoxError("output_too_big", controlPanel);
+			return false;
+		}
+		int v = 0;
+		try {
+			v = Integer.parseInt(value);
+		} catch (NumberFormatException e) {
+			return false;
+		}
+		if(v <= 0)
+			return false;
+		return true;
+	}
+	
+	/**
+	 * Checks a double value
+	 * @param value
+	 * @return
+	 */
+	private boolean checkDouble(String value) {
+		if(value == null)
+			return false;
+		double v = 0;
+		try {
+			v = Double.parseDouble(value);
+		} catch (NumberFormatException e) {
+			return false;
+		}
+		if(v <= 0)
+			return false;
+		return true;
+	}
+
+	/**
+	 * Calculo del tama�o en pixels de la imagen a partir de las coordenadas del
+	 * mundo real, la escala y los puntos por pulgada
+	 */
+	private void recalcParams(Object obj, Object oldValue) {
+		controlPanel.validateFields();
+		double widthMts = 0;
+		double heightMts = 0;
+		try {
+			double[] size = calcSizeInMts();
+			if(size != null) {
+				widthMts = size[0];
+				heightMts = size[1];
+			} else {
+				return;
+			}
+		} catch (NumberFormatException e) {
+			return;
+		}
+
+		//M�todo por tama�o seleccionado
+		if(controlPanel.isPixelMethodSelected()) {
+			modifyPixelMethod(obj, widthMts, heightMts, oldValue);
+		} else {
+			modifyPrintMethod(obj, widthMts, heightMts, oldValue);
+		}
+		calculateFileSize();
+	}
+	
+	/**
+	 * When the event comes from a component in the pixel size method
+	 * @param obj
+	 * @param widthMts
+	 * @param heightMts
+	 * @param oldValue
+	 */
+	private void modifyPixelMethod(Object obj, double widthMts, double heightMts, Object oldValue) {
+		double rel = (widthMts / heightMts);
+		if(	controlPanel.getComponentID(obj) == SaveRasterPanel.WIDTH_COMPONENT &&
+				!controlPanel.getWidthPxValue().equals("")) {
+			if(!checkInteger(controlPanel.getWidthPxValue())) {
+				controlPanel.setWidthPxValue(String.valueOf(oldValue));
+				return;
+			}
+			int w = Integer.parseInt(controlPanel.getWidthPxValue());
+			int h = (int)Math.floor(w / rel);
+			controlPanel.setHeightPxValue(String.valueOf(h));
+			controlPanel.setCellSize(String.valueOf(widthMts / w));
+		} else if(	controlPanel.getComponentID(obj) == SaveRasterPanel.HEIGHT_COMPONENT &&
+				!controlPanel.getHeightPxValue().equals("")) {
+			if(!checkInteger(controlPanel.getHeightPxValue())) {
+				controlPanel.setHeightPxValue(String.valueOf(oldValue));
+				return;
+			}
+			int h = Integer.parseInt(controlPanel.getHeightPxValue());
+			int w = (int)Math.ceil(h * rel);
+			controlPanel.setWidthPxValue(String.valueOf(w));
+			controlPanel.setCellSize(String.valueOf(widthMts / w));
+		} else if(	controlPanel.getComponentID(obj) == SaveRasterPanel.CELLSIZE_COMPONENT &&
+				!controlPanel.getScaleValue().equals("")) {
+			if(!checkDouble(controlPanel.getCellSize())) {
+				controlPanel.setCellSize(String.valueOf(oldValue));
+				return;
+			}
+			double cellsize = Double.parseDouble(controlPanel.getCellSize());
+			int w = (int)Math.round(widthMts / cellsize);
+			int h = (int)Math.round(heightMts / cellsize);
+			if((widthMts / cellsize) >= Integer.MAX_VALUE || (heightMts / cellsize) >= Integer.MAX_VALUE) {
+				RasterSwingLibrary.messageBoxError("output_too_big", controlPanel);
+				controlPanel.setCellSize(String.valueOf(oldValue));
+				return;
+			}
+			controlPanel.setWidthPxValue(String.valueOf(w));
+			controlPanel.setHeightPxValue(String.valueOf(h));
+			controlPanel.setCellSize(String.valueOf(widthMts / w));
+		} else if(controlPanel.getComponentID(obj) == SaveRasterPanel.ULX_COMPONENT || 
+			controlPanel.getComponentID(obj) == SaveRasterPanel.ULY_COMPONENT ||
+			controlPanel.getComponentID(obj) == SaveRasterPanel.LRX_COMPONENT ||
+			controlPanel.getComponentID(obj) == SaveRasterPanel.LRY_COMPONENT) {
+			int w = Integer.parseInt(controlPanel.getWidthPxValue());
+			if(w == 0)
+				return;
+			controlPanel.setCellSize(String.valueOf(widthMts / w));
+		}
+	}
+	
+	/**
+	 * When the event comes from a component in the print method
+	 * @param obj
+	 * @param widthMts
+	 * @param heightMts
+	 * @param oldValue
+	 */
+	private void modifyPrintMethod(Object obj, double widthMts, double heightMts, Object oldValue) {
+		double rel = (widthMts / heightMts);
+		if(	controlPanel.getComponentID(obj) == SaveRasterPanel.WCMS_COMPONENT &&
+				!controlPanel.getValueXCms().equals("")) {
+			if(!checkInteger(controlPanel.getValueXCms())) {
+				controlPanel.setValueXCms(String.valueOf(oldValue));
+				return;
+			}
+			int cmsx = Integer.parseInt(controlPanel.getValueXCms());
+			int cmsy = (int)Math.round(cmsx / rel);
+			int scale = (int)Math.round(widthMts / (cmsx / 100D));
+			controlPanel.setValueYCms(String.valueOf(cmsy));
+			controlPanel.setScaleValue(String.valueOf(scale));
+		} else if(	controlPanel.getComponentID(obj) == SaveRasterPanel.HCMS_COMPONENT &&
+				!controlPanel.getValueYCms().equals("")) {
+			if(!checkInteger(controlPanel.getValueYCms())) {
+				controlPanel.setValueYCms(String.valueOf(oldValue));
+				return;
+			}
+			int cmsy = Integer.parseInt(controlPanel.getValueYCms());
+			int cmsx = (int)Math.round(cmsy * rel);
+			int scale = (int)Math.round(widthMts / (cmsx / 100D));
+			controlPanel.setValueXCms(String.valueOf(cmsx));
+			controlPanel.setScaleValue(String.valueOf(scale));
+		} else if(	controlPanel.getComponentID(obj) == SaveRasterPanel.SCALE_COMPONENT &&
+				!controlPanel.getScaleValue().equals("")) {
+			if(!checkInteger(controlPanel.getScaleValue())) {
+				controlPanel.setScaleValue(String.valueOf(oldValue));
+				return;
+			}
+			int scale = Integer.parseInt(controlPanel.getScaleValue());
+			int cmsx = (int)Math.round((widthMts / scale) * 100D);
+			int cmsy = (int)Math.round((heightMts / scale) * 100D);
+			controlPanel.setValueXCms(String.valueOf(cmsx));
+			controlPanel.setValueYCms(String.valueOf(cmsy));
+			scale = (int)Math.round(widthMts / (cmsx / 100D));
+			controlPanel.setScaleValue(String.valueOf(scale));
+		} else if(controlPanel.getComponentID(obj) == SaveRasterPanel.ULX_COMPONENT || 
+				controlPanel.getComponentID(obj) == SaveRasterPanel.ULY_COMPONENT ||
+				controlPanel.getComponentID(obj) == SaveRasterPanel.LRX_COMPONENT ||
+				controlPanel.getComponentID(obj) == SaveRasterPanel.LRY_COMPONENT) {
+			int cmsx = Integer.parseInt(controlPanel.getValueXCms());
+			if(cmsx == 0)
+				return;
+			int scale = (int)Math.round(widthMts / (cmsx / 100D));
+			controlPanel.setScaleValue(String.valueOf(scale));
+		}
+		calculateSizePxResult();
+	}
+
+	/**
+	 * Calculates the size in pixels for the print method
+	 */
+	private void calculateSizePxResult() {
+		int resolution = Integer.parseInt((String)controlPanel.getCbResolution().getSelectedItem());
+		int cmsx = Integer.parseInt(controlPanel.getValueXCms());
+		int cmsy = Integer.parseInt(controlPanel.getValueYCms());
+		int wpx = (int)Math.round((cmsx * MathUtils.INCHESCM) * resolution);
+		int hpx = (int)Math.round((cmsy * MathUtils.INCHESCM) * resolution);
+		controlPanel.setSizePxPrintResult(wpx, hpx);
+	}
+
+	/**
+	 * Calculates the output file size in megabytes
+	 */
+	private void calculateFileSize() {
+		int w = 0;
+		int h = 0;
+		if(controlPanel.isPixelMethodSelected()) {
+			w = Integer.parseInt(controlPanel.getWidthPxValue());
+			h = Integer.parseInt(controlPanel.getHeightPxValue());
+		} else {
+			w = controlPanel.getWidthPxPrint();
+			h = controlPanel.getHeightPxPrint();
+		}
+		controlPanel.setSizeMB(math.clipDecimals((((long)w * (long)h * (long)3) / 1048576D), 1));
+	}
+
+	/**
+	 * Calcula el tama�o en mtrs a partir de las coordenadas.
+	 * 
+	 * @return
+	 * @throws NumberFormatException
+	 */
+	private double[] calcSizeInMts()throws NumberFormatException {
+		double lrx = Double.parseDouble(controlPanel.getValueLRX());
+		double lry = Double.parseDouble(controlPanel.getValueLRY());
+		double ulx = Double.parseDouble(controlPanel.getValueULX());
+		double uly = Double.parseDouble(controlPanel.getValueULY());
+
+		double distWidth = 0;
+		double distHeight = 0;
+		
+		/*if(!controlPanel.isPixelMethodSelected() && !viewPort.getProjection().isProjected()) {
+			Point2D pUL = new Point2D.Double(ulx, uly);
+			Point2D pUR = new Point2D.Double(lrx, uly);
+			Point2D pLR = new Point2D.Double(lrx, lry);
+			distWidth = viewPort.distanceWorld(pUL, pUR);
+			distHeight = viewPort.distanceWorld(pUR, pLR);
+			double[] trans2Meter = MapContext.getDistanceTrans2Meter();
+			distWidth = distWidth / trans2Meter[viewPort.getDistanceUnits()];
+			distHeight = distHeight / trans2Meter[viewPort.getDistanceUnits()];
+		} else {*/
+			if (ulx > lrx)
+				distWidth = ulx - lrx;
+			else
+				distWidth = lrx - ulx;
+
+			if (uly > lry)
+				distHeight = uly - lry;
+			else
+				distHeight = lry - uly;
+		//}
+
+		return new double[]{distWidth, distHeight};
+	}
+
+	/**
+	 * Gestiona los eventos del cambio de escala de la imagen y lla apertura del
+	 * dialogo de selecci�n del nombre del fichero.
+	 */
+	public void actionPerformed(ActionEvent e) {
+		Object obj = e.getSource();
+
+		// Selector de Fichero sobre el cual se va a salvar a raster
+		if (obj.equals(controlPanel.getBSelect())) {
+			JFileChooser chooser = new JFileChooser("DATA_INPUT_LISTENER", JFileChooser.getLastPath("DATA_INPUT_LISTENER", null));
+			chooser.setDialogTitle(PluginServices.getText(this, "seleccionar_fichero"));
+			chooser.setAcceptAllFileFilterUsed(false);
+
+			// A�adimos las extensiones que hayan sido registradas en el driver
+			String[] extList = RasterLocator.getManager().getProviderServices().getDriversExtensions();
+			ExtendedFileFilter selectedFilter = null;
+			for (int i = 0; i < extList.length; i++) {
+				ExtendedFileFilter fileFilter = new ExtendedFileFilter(extList[i]);
+				chooser.addChoosableFileFilter(fileFilter);
+				if (extList[i].toLowerCase().equals("tif"))
+					selectedFilter = fileFilter;
+			}
+			if (selectedFilter != null)
+				chooser.setFileFilter(selectedFilter);
+
+			int returnVal = chooser.showOpenDialog(controlPanel.getComponent());
+
+			if (returnVal == JFileChooser.APPROVE_OPTION) {
+				ExtendedFileFilter fileFilter = ((ExtendedFileFilter) chooser.getFileFilter());
+
+				fName = chooser.getSelectedFile().toString();
+				fName = fileFilter.getNormalizedFilename(chooser.getSelectedFile());
+				String ext = RasterLocator.getManager().getFileUtils().getExtensionFromFileName(fName);
+
+//				controlPanel.getBProperties().setText(
+//						PluginServices.getText(this, "props") + " " + RasterLocator.getManager().getProviderServices().getWriteDriverType(ext));
+
+				controlPanel.getBProperties().setEnabled(true);
+				controlPanel.getLFileName().setText(
+						fName.substring(fName.lastIndexOf(File.separator) + 1, fName.length()));
+
+				JFileChooser.setLastPath("DATA_INPUT_LISTENER", chooser.getSelectedFile());
+			}
+		}
+		
+		if(	controlPanel.getComponentID(obj) == SaveRasterPanel.RESOLUTION_COMPONENT) {
+			if(!enableEventValueChanged)
+				return;
+			enableEventValueChanged = false;
+			this.recalcParams(e.getSource(), null);
+			enableEventValueChanged = true;
+		}
+		
+		/*if(controlPanel.getComponentID(obj) == SaveRasterPanel.PRINT_SELECTOR) {
+			IProjection viewProj = viewPort.getProjection();
+			for (int i = 0; i < layers.getLayersCount(); i++) {
+				FLayer lyr = layers.getLayer(i);
+				if(lyr.getProjection() == null || !lyr.getProjection().getAbrev().equals(viewProj.getAbrev())) {
+					RasterToolsUtil.messageBoxInfo("different_projection", controlPanel);
+					break;
+				}
+			}
+			
+		}*/
+		
+		if(	controlPanel.getComponentID(obj) == SaveRasterPanel.PIXEL_SELECTOR || 
+			controlPanel.getComponentID(obj) == SaveRasterPanel.PRINT_SELECTOR) {
+			calculateFileSize();
+		}
+	}
+
+	/**
+	 * Devuelve el nombre del fichero seleccionado
+	 *
+	 * @return Nombre del fichero seleccionado
+	 */
+	public String getFileName() {
+		return fName;
+	}
+
+	/**
+	 * Pone a null el valor de la variable con el valor del fichero de texto.
+	 */
+	public void resetFileName() {
+		fName = null;
+		controlPanel.getLFileName().setText("");
+	}
+
+	public void mouseClicked(MouseEvent e) {
+	}
+
+	/**
+	 * Recalcula el tama�o de la imagen con los datos existentes y activa o
+	 * desactiva los botones.
+	 */
+	public void focusLost(FocusEvent e) {
+	}
+
+	/**
+	 * Activa o Desactiva los botones a trav�s de la funci�n que valida los
+	 * campos
+	 */
+	public void keyTyped(KeyEvent e) {
+	}
+
+	/**
+	 * Activa o Desactiva los botones a trav�s de la funci�n que valida los
+	 * campos
+	 */
+	public void keyPressed(KeyEvent e) {
+	}
+
+	/**
+	 * Activa o Desactiva los botones a trav�s de la funci�n que valida los
+	 * campos
+	 */
+	public void keyReleased(KeyEvent e) {
+	}
+
+	public void actionValueChanged(EventObject e) {
+		if(!enableEventValueChanged)
+			return;
+		enableEventValueChanged = false;
+		this.recalcParams(e.getSource(), "0");
+		enableEventValueChanged = true;
+	}
+
+	public void propertyChange(PropertyChangeEvent e) {
+		if(!enableEventValueChanged)
+			return;
+		enableEventValueChanged = false;
+		this.recalcParams(e.getSource(), e.getOldValue());
+		enableEventValueChanged = true;
+	}
+
+	public void mouseExited(MouseEvent e) {}
+	public void mouseReleased(MouseEvent e) {}
+	public void mouseEntered(MouseEvent e) {}
+	public void mousePressed(MouseEvent e) {}
+	public void focusGained(FocusEvent e) {}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/listener/DataInputListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/listener/WriterPropertiesListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/listener/WriterPropertiesListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/listener/WriterPropertiesListener.java	(revision 8183)
@@ -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.tools.app.basic.tool.saveviewtoraster.ui.listener;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
+import org.gvsig.gui.beans.propertiespanel.PropertiesComponent;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.ui.property.WriterPropertiesDialog;
+
+
+/**
+ * Listener para el dialogo de propiedades de los escritores.
+ * 
+ * @version 24/04/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class WriterPropertiesListener implements ButtonsPanelListener {
+
+	private WriterPropertiesDialog dialog = null;
+	private Params params = null;
+	private PropertiesComponent pComp = null;
+	
+	/**
+	 * Constructor
+	 * @param dialog
+	 */
+	public WriterPropertiesListener(WriterPropertiesDialog dialog, Params params) {
+		this.dialog = dialog;
+		this.params = params;
+		this.pComp = dialog.getPropertiesPanel().getPropertiesComponent();
+		RasterToolsUtil.loadPropertiesFromWriterParams(pComp, params, null);
+	}
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener#actionButtonPressed(org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent)
+	 */
+	public void actionButtonPressed(ButtonsPanelEvent e) {
+		switch (e.getButton()) {
+		case ButtonsPanel.BUTTON_APPLY:
+			RasterToolsUtil.loadWriterParamsFromPropertiesPanel(pComp, params);
+			break;
+		case ButtonsPanel.BUTTON_ACCEPT:
+			RasterToolsUtil.loadWriterParamsFromPropertiesPanel(pComp, params);
+		case ButtonsPanel.BUTTON_CANCEL:
+			PluginServices.getMDIManager().closeWindow(dialog);
+			break;
+		}
+		
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/listener/WriterPropertiesListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/listener/SaveRasterActions.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/listener/SaveRasterActions.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/listener/SaveRasterActions.java	(revision 8183)
@@ -0,0 +1,72 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.saveviewtoraster.ui.listener;
+
+import org.gvsig.raster.algorithm.process.IProcessActions;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.swing.RasterSwingLocator;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.util.RasterNotLoadException;
+/**
+ * Acciones que ejecuta el proceso de salvado.
+ *
+ * @version 26/09/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SaveRasterActions implements IProcessActions {
+	private String                      viewName         = null;
+	
+	public SaveRasterActions(String viewName) {
+		this.viewName = viewName;
+	}
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.IProcessActions#end(java.lang.Object)
+	 */
+	public void end(Object params) {
+		if(	params instanceof Object[] &&
+			((Object[])params).length == 2 &&
+			((Object[])params)[0] instanceof String &&
+			((Object[])params)[1] instanceof Long) {
+
+			String fName = (String)((Object[])params)[0];
+			long milis = ((Long)((Object[])params)[1]).longValue();
+
+			if(RasterSwingLibrary.messageBoxYesOrNot("cargar_toc", this)) {
+				try {
+					RasterToolsUtil.loadLayer(viewName, fName, null);
+				} catch (RasterNotLoadException e) {
+					RasterSwingLibrary.messageBoxError("error_load_layer", this, e);
+				}
+			}
+			RasterSwingLocator.getSwingManager().showSummaryProcessDialog(fName, milis);
+		}
+	}
+
+	public void interrupted() {
+		
+	}
+	
+	public void updateProgress(int current, int total) {
+		
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/listener/SaveRasterActions.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/listener/SaveViewToRasterDialogListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/listener/SaveViewToRasterDialogListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/listener/SaveViewToRasterDialogListener.java	(revision 8183)
@@ -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.tools.app.basic.tool.saveviewtoraster.ui.listener;
+
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.io.File;
+
+import javax.swing.JOptionPane;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.andami.PluginServices;
+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.datastruct.Params;
+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.fmap.geom.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
+import org.gvsig.gui.beans.propertiespanel.PropertiesPanel;
+import org.gvsig.raster.algorithm.RasterBaseAlgorithmLibrary;
+import org.gvsig.raster.algorithm.process.DataProcess;
+import org.gvsig.raster.algorithm.process.ProcessException;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.mainplugin.config.Configuration;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.algorithm.swing.saveraster.SaveRasterPanel;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.ui.property.WriterPropertiesDialog;
+import org.gvsig.raster.tools.app.basic.tool.saveviewtoraster.ui.SaveViewToRasterDialog;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Clase que gestiona los eventos de los botones del dialogo de Salvar a raster.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class SaveViewToRasterDialogListener implements ButtonsPanelListener {
+	private static final GeometryManager 	geomManager	= GeometryLocator.getGeometryManager();
+	private Logger                          log         = LoggerFactory.getLogger(SaveViewToRasterDialogListener.class);
+	private SaveViewToRasterDialog          dialog 		= null;
+	private FLayers							layers		= null;
+	private MapControl						mapCtrl 	= null;
+	private RasterWriter                    writer 		= null;
+
+	/**
+	 * Constructor
+	 * @param dialog
+	 */
+	public SaveViewToRasterDialogListener(SaveViewToRasterDialog dialog, FLayers layers, MapControl mapCtrl) {
+		this.dialog = dialog;
+		this.layers = layers;
+		this.mapCtrl = mapCtrl;
+
+		dialog.addButtonPressedListener(this);
+
+		//Captura de eventos para el bot�n de propiedades
+		(dialog.getSaveRasterPanel()).getBProperties().addActionListener(new java.awt.event.ActionListener() {
+			public void actionPerformed(java.awt.event.ActionEvent evt) {
+				propsButtonActionPerformed(evt);
+			}
+		});
+	}
+	
+	public boolean isCorrectlyConfigured() {
+		SaveRasterPanel controlPanel = dialog.getSaveRasterPanel();
+		try {
+			double ulx = Double.parseDouble(controlPanel.getValueULX());
+			double uly = Double.parseDouble(controlPanel.getValueULY());
+			double lrx = Double.parseDouble(controlPanel.getValueLRX());
+			double lry = Double.parseDouble(controlPanel.getValueLRY());
+			if(Math.abs(uly - ulx) == 0 || Math.abs(lry - lrx) == 0) {
+				RasterSwingLibrary.messageBoxError("wc_wrong", controlPanel);
+				return false;
+			} 
+			
+			if(controlPanel.isPixelMethodSelected()) {
+				int wpx = Integer.parseInt(controlPanel.getWidthPxValue());
+				int hpx = Integer.parseInt(controlPanel.getHeightPxValue());
+				double cellsize = Double.parseDouble(controlPanel.getCellSize());
+				if(wpx == 0) {
+					RasterSwingLibrary.messageBoxError("width_cannot_be_zero", controlPanel);
+					return false;
+				}
+				if(hpx == 0) {
+					RasterSwingLibrary.messageBoxError("height_cannot_be_zero", controlPanel);
+					return false;
+				}
+				if(cellsize == 0) {
+					RasterSwingLibrary.messageBoxError("cellsize_cannot_be_zero", controlPanel);
+					return false;
+				}
+			} else {
+				int cmsx = Integer.parseInt(controlPanel.getValueXCms());
+				int cmsy = Integer.parseInt(controlPanel.getValueYCms());
+				int scale = Integer.parseInt(controlPanel.getScaleValue());
+				if(cmsx == 0) {
+					RasterSwingLibrary.messageBoxError("width_cannot_be_zero", controlPanel);
+					return false;
+				}
+				if(cmsy == 0) {
+					RasterSwingLibrary.messageBoxError("height_cannot_be_zero", controlPanel);
+					return false;
+				}
+				if(scale == 0) {
+					RasterSwingLibrary.messageBoxError("scale_cannot_be_zero", controlPanel);
+					return false;
+				}
+			}
+
+			String fName = controlPanel.getLFileName().getText();
+			if(fName == null || fName.equals("")) {
+				RasterSwingLibrary.messageBoxError("filename_cannot_be_empty", controlPanel);
+				return false;
+			}
+
+		} catch (NumberFormatException e) {
+			RasterSwingLibrary.messageBoxError("some_parameter_is_not_correct", controlPanel);
+			return false;
+		}
+
+		return true;
+	}
+
+
+	/**
+	 * Eventos para los botones de aplicar, aceptar y cancelar
+	 * @param e
+	 */
+	public void actionButtonPressed(ButtonsPanelEvent e) {
+		switch (e.getButton()) {
+		case ButtonsPanel.BUTTON_APPLY:
+			if(isCorrectlyConfigured()) {
+				checkProjections();
+				acceptButtonActionPerformed(e);
+			}
+			break;
+		case ButtonsPanel.BUTTON_CLOSE:
+			dialog.closeJDialog();
+			break;
+		}
+	}
+	
+	/**
+	 * Checks that the view projection be the same that every layer 
+	 * loaded in the TOC and shows a message if not
+	 * @return
+	 */
+	private boolean checkProjections() {
+		IProjection viewProj = mapCtrl.getProjection();
+		for (int i = 0; i < layers.getLayersCount(); i++) {
+			FLayer lyr = layers.getLayer(i);
+			if(lyr.getProjection() == null || !lyr.getProjection().getAbrev().equals(viewProj.getAbrev())) {
+				RasterSwingLibrary.messageBoxInfo("different_projection", dialog);
+				return false;
+			}
+		}
+		return true;
+	}
+
+	/**
+	 * Acciones realizadas al aceptar.
+	 * @param e
+	 * @return true si se ha completado la operaci�n de escritura y false si no se ha hecho
+	 */
+	private boolean acceptButtonActionPerformed(ButtonsPanelEvent e) {
+		SaveRasterPanel controlPanel = dialog.getSaveRasterPanel();
+
+		String fName = dialog.getDataInputListener().getFileName();
+		int wpx = 0;
+		int hpx = 0;
+		if(controlPanel.isPixelMethodSelected()) {
+			wpx = Integer.valueOf(controlPanel.getWidthPxValue());
+			hpx = Integer.valueOf(controlPanel.getHeightPxValue());
+		} else {
+			wpx = Integer.valueOf(controlPanel.getWidthPxPrint());
+			hpx = Integer.valueOf(controlPanel.getHeightPxPrint());
+		}
+		
+		Dimension dimension = new Dimension(wpx, hpx);
+
+		//Limitamos el tama�o
+		if(wpx > 20000 || wpx > 20000) {
+			if(!RasterSwingLibrary.messageBoxYesOrNot("output_file_too_big", null))
+				return false;
+		}
+		
+		//Comprobamos que el en la ruta de destino tengamos permisos de escritura
+		File f = new File(fName);
+		if(f.exists())
+			if(!RasterSwingLibrary.messageBoxYesOrNot("raster_error_file_exists", dialog))
+				return false;
+
+		f = new File(fName.substring(0, fName.lastIndexOf(File.separator)));
+
+		if(f.exists() && f.isDirectory() && !f.canWrite()) {
+			RasterSwingLibrary.messageBoxError("error_file_not_writable", dialog);
+			return false;
+		}
+
+		double lrX = Double.parseDouble(controlPanel.getValueLRX());
+		double lrY = Double.parseDouble(controlPanel.getValueLRY());
+		double ulX = Double.parseDouble(controlPanel.getValueULX());
+		double ulY = Double.parseDouble(controlPanel.getValueULY());
+
+		Envelope ext = null;
+		try{
+			ext = geomManager.createEnvelope(ulX, lrY, lrX, ulY, SUBTYPES.GEOM2D);
+		}catch(CreateEnvelopeException e1){
+			log.debug("Error creating the envelope", null, e1);
+		}
+		
+		// Controlamos el tama�o en caso de un jpeg2000
+		long bytes = RasterLocator.getManager().getRasterUtils().getBytesFromRaster((int)dimension.getWidth(),
+				(int)dimension.getHeight(), 0, 3);	
+		
+		long maxJp2 = 13000 * 12500 * 3;
+		if (fName.endsWith(".jp2")) {
+			if (bytes > maxJp2) {
+				if(!RasterSwingLibrary.messageBoxYesOrNot("output_file_too_big_jpeg2000", null))
+					return false;
+			}
+		}
+		
+		Params params = getWriterParams(fName);
+		int blockSize = getBlockSize(params, layers);
+
+		ViewPort viewPort = new ViewPort(mapCtrl.getViewPort().getProjection());
+		viewPort.setBackColor(mapCtrl.getViewPort().getBackColor());
+		viewPort.setImageSize(dimension);
+		viewPort.setEnvelope(ext);
+
+		try {
+			DataProcess saveRasterProcess = RasterBaseAlgorithmLibrary.getManager().createRasterTask("SaveRasterProcess");
+			saveRasterProcess.setActions(new SaveRasterActions(dialog.getViewName()));
+			saveRasterProcess.addParam("ViewPort", viewPort);
+			saveRasterProcess.addParam("Dimension", dimension);
+			saveRasterProcess.addParam("Blocksize", blockSize);
+			saveRasterProcess.addParam("FileName", fName);
+			saveRasterProcess.addParam("FLyrs", layers);
+			saveRasterProcess.addParam("writerparams", params);
+			saveRasterProcess.addParam("Projection", mapCtrl.getProjection());
+			saveRasterProcess.start();
+		} catch (ProcessException e1) {
+			RasterSwingLibrary.messageBoxError("error_processing", this, e1);
+		}
+
+		return true;
+	}
+
+	/**
+	 * Funci�n a ejecutar cuando se pulsa el bot�n de propiedades.
+	 * @param e ActionEvent
+	 */
+	private void propsButtonActionPerformed(ActionEvent e){
+		String name = dialog.getDataInputListener().getFileName();
+
+		//Si no se ha seleccionado ning�n fichero salimos
+		if(name == null || name.equals(""))
+			return;
+
+		Params params = getWriterParams(name);
+		PropertiesPanel panel = new PropertiesPanel();
+		WriterPropertiesDialog dialog = new WriterPropertiesDialog(panel, params);
+		PluginServices.getMDIManager().addWindow(dialog);
+	}
+
+	/**
+	 * Obtiene los par�metros del driver de escritura. Si el driver no se ha creado a�n se obtienen
+	 * unos par�metros con la inicializaci�n por defecto. Si se ha creado ya y se han modificado se
+	 * devuelven los par�metros con las modificaciones. Si se cambia de driver se devolver� un WriterParams
+	 * como si fuera la primera vez que se abre.
+	 * @param name Nombre del fichero sobre el que se salva.
+	 * @return WriterParams
+	 */
+	private Params getWriterParams(String name) {
+		RasterManager rManager = RasterLocator.getManager();
+		String ext = rManager.getFileUtils().getExtensionFromFileName(name);
+		try {
+			if(writer == null) //La primera vez que se obtiene el driver
+				writer = rManager.createWriter(name);
+			else {
+				String newType = rManager.getProviderServices().getWriteDriverType(ext);
+				String oldType = writer.getDriverName();
+				if(!newType.equals(oldType))  //Cambio de driver despu�s de haber seleccionado y modificado las propiedades de uno
+					writer = rManager.createWriter(name);
+			}
+
+			if(writer == null)
+				JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), PluginServices.getText(this, "no_driver_escritura"));
+
+			return writer.getParams();
+
+		} catch (NotSupportedExtensionException e1) {
+			JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), PluginServices.getText(this, "no_driver_escritura"));
+			return null;
+		} catch (RasterDriverException e1) {
+			JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), PluginServices.getText(this, "no_driver_escritura"));
+			return null;
+		}
+	}
+
+	/**
+	 * Calculo del tama�o de bloque. Para ello comprueba si el raster est� siendo tileado. Si est� siendo
+	 * tileado se aplica el alto del tile menor para no pedir un bloque mayor que lo que un servidor puede
+	 * devolver. Si no est� siendo tileado se devuelve el tama�o de bloque de los par�metros.
+	 * @param flyrs Capas
+	 * @param params Par�metros del driver de escritura
+	 * @return tama�o de bloque
+	 */
+	private int getBlockSize(Params params, FLayers flyrs) {
+
+		int blockSize = Configuration.getValue("cache_blockheight", Integer.valueOf(RasterLibrary.blockHeight)).intValue();
+		blockSize = RasterLibrary.blockHeight;
+
+		//Recorremos todas las capas comprobando si alguna de ellas implementa RasterOperations y tilea.
+		//En ese caso se obtiene el ancho de bloque. El ancho de bloque total ser� el menor obtenido.
+		//Esto lo hacemos para que las capas que tilean WebMapService, WebCoverageService, ... no hagan demasiadas peticiones al servidor
+		//por tener un ancho de bloque muy peque�o de modo que el ancho del bloque se ajuste al Tile menor
+		//soportado por los servidores que intervienen en el salvado.
+		int[] wBlock = null;
+		boolean isTiling = false;
+		int block = Integer.MAX_VALUE;
+		for(int i = 0; i < flyrs.getLayersCount(); i++)
+			if(flyrs.getLayer(i) instanceof FLyrRaster)
+				if(((FLyrRaster)flyrs.getLayer(i)).isTiled()){
+					wBlock = ((FLyrRaster)flyrs.getLayer(i)).getTileSize();
+					if((wBlock[0] - 1)< block){
+						block = wBlock[0] - 1;
+						isTiling = true;
+					}
+				}
+		if(isTiling) {
+			params.changeParamValue("blocksize", String.valueOf(block));
+			return block;
+		}
+
+		return blockSize;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/listener/SaveViewToRasterDialogListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui/listener
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster/ui
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveviewtoraster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/multiresolution/ZoomResolutionLevelTocMenuEntry.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/multiresolution/ZoomResolutionLevelTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/multiresolution/ZoomResolutionLevelTocMenuEntry.java	(revision 8183)
@@ -0,0 +1,134 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.multiresolution;
+
+import java.awt.Component;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import javax.swing.Icon;
+import javax.swing.JOptionPane;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.app.project.documents.view.toolListeners.StatusBarListener;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseMovementBehavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.PointBehavior;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.layers.ILayerState;
+import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+
+
+/**
+ * Entry point for zoom by resolution level
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ZoomResolutionLevelTocMenuEntry extends AbstractTocContextMenuAction implements PropertyChangeListener, IGenericToolBarMenuItem {
+	static private ZoomResolutionLevelTocMenuEntry singleton  = null;
+
+	/**
+	 * Nadie puede crear una instancia a esta clase �nica, hay que usar el
+	 * getSingleton()
+	 */
+	private ZoomResolutionLevelTocMenuEntry() {}
+
+	/**
+	 * Devuelve un objeto unico a dicha clase
+	 * @return
+	 */
+	static public ZoomResolutionLevelTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new ZoomResolutionLevelTocMenuEntry();
+		return singleton;
+	}
+	
+	public String getGroup() {
+		return "RasterLayer";
+	}
+
+	public int getGroupOrder() {
+		return 10;
+	}
+
+	public int getOrder() {
+		return 90;
+	}
+
+	public String getText() {
+		return RasterToolsUtil.getText(this, "goto_resolution_level");
+	}
+	
+	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;
+			if (selectedItems[0] instanceof FLyrRaster) {
+				FLyrRaster lyr = (FLyrRaster)selectedItems[0];
+				if(lyr.getDataStore().isTiled())
+					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;
+	}
+
+	public void execute(ITocItem item, FLayer[] selectedItems) {		
+		IWindow theView = PluginServices.getMDIManager().getActiveWindow();
+		if(!(theView instanceof AbstractViewPanel)) {
+			JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), PluginServices.getText(this.getClass(), "window_not_valid"));
+			return;
+		}
+
+		MapControl mapCtrl = ((AbstractViewPanel)theView).getMapControl();
+		StatusBarListener sbl = new StatusBarListener(mapCtrl);
+		ResolutionLevelListener rll = new ResolutionLevelListener();
+		mapCtrl.addBehavior("zoomResolutionLevel", new Behavior[]{new PointBehavior(rll),
+				new MouseMovementBehavior(sbl)});
+		mapCtrl.setTool("zoomResolutionLevel");
+	}
+
+	public Icon getIcon() {
+		return RasterToolsUtil.getIcon("layer-zoom-res-level");
+	}
+
+	public void propertyChange(PropertyChangeEvent evt) {}
+	
+	public boolean isEnableEvents() {
+		return true;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/multiresolution/ZoomResolutionLevelTocMenuEntry.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/multiresolution/ResolutionLevelListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/multiresolution/ResolutionLevelListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/multiresolution/ResolutionLevelListener.java	(revision 8183)
@@ -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.tools.app.basic.tool.multiresolution;
+
+import java.awt.Component;
+import java.awt.Image;
+import java.awt.event.MouseEvent;
+import java.awt.geom.Point2D;
+
+import javax.swing.JOptionPane;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.BehaviorException;
+import org.gvsig.fmap.mapcontrol.tools.Events.PointEvent;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.PointListener;
+import org.gvsig.raster.fmap.layers.Multiresolution;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * <p>Inherits {@link ResolutionLevelListenerImpl ResolutionLevelListenerImpl} enabling/disabling special
+ *  controls for managing the data selected.</p>
+ *
+ * @see ResolutionLevelListenerImpl
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ResolutionLevelListener implements PointListener {
+	private static final Logger logger  = LoggerFactory.getLogger(ResolutionLevelListener.class);
+	private Image               izoomin = null;
+
+	@SuppressWarnings("deprecation")
+	public void point(PointEvent event) throws BehaviorException {
+		//Selects active window
+		IWindow theView = PluginServices.getMDIManager().getActiveWindow();
+		if(!(theView instanceof AbstractViewPanel)) {
+			JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), PluginServices.getText(this.getClass(), "window_not_valid"));
+			return;
+		}
+		
+		//Gets the multiresolution layer
+		MapControl mapCtrl = ((AbstractViewPanel)theView).getMapControl();
+		FLayers layers = mapCtrl.getMapContext().getLayers();
+		Multiresolution lyrMultires = null;
+		for (int i = 0; i < layers.getLayersCount(); i++) {
+			if(layers.getLayer(i).isActive() && 
+				layers.getLayer(i) instanceof Multiresolution &&
+				((Multiresolution)layers.getLayer(i)).isEnabledMultiresolution()) {
+				lyrMultires = (Multiresolution)layers.getLayer(i);
+			}
+		}
+		
+		//Shows a message if the layer doesn't exist or there aren't any selected
+		if(lyrMultires == null) {
+			boolean thereAreLayersSelected = false;
+			for (int i = 0; i < layers.getLayersCount(); i++) {
+				if(layers.getLayer(i).isActive())
+					thereAreLayersSelected = true;
+			}
+			String message = null;
+			if(!thereAreLayersSelected)
+				message = PluginServices.getText(this.getClass(), "there_arent_selected");
+			else
+				message = PluginServices.getText(this.getClass(), "no_resolution_level");
+			
+			JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), message);
+			return;
+		}
+		
+		//Left button. Zoom +
+		if(event.getEvent().getButton() == MouseEvent.BUTTON1) { 
+			if(!lyrMultires.increaseZoomLevel()) {
+    			JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), PluginServices.getText(this.getClass(), "max_zoom_reached"));
+    			return;
+    		}
+		}
+		
+		//Right button. Zoom -
+		if(event.getEvent().getButton() == MouseEvent.BUTTON3) { 
+			if(!lyrMultires.decreaseZoomLevel()) {
+    			JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), PluginServices.getText(this.getClass(), "min_zoom_reached"));
+    			return;
+    		}
+		}
+		
+		ViewPort viewPort = mapCtrl.getMapContext().getViewPort();
+		Point2D center = viewPort.toMapPoint(event.getPoint());
+		Envelope r;
+		try {
+			r = lyrMultires.getCoordsInLevel(center, lyrMultires.getZoomLevel(), 
+					viewPort.getImageWidth(), viewPort.getImageHeight());
+		} catch (CreateEnvelopeException e) {
+			return;
+		}
+		
+		viewPort.setEnvelope(r);
+		
+		if (PluginServices.getMainFrame() != null)
+		    PluginServices.getMainFrame().enableControls();
+	}
+
+	public void pointDoubleClick(PointEvent event) throws BehaviorException {
+	}
+
+	public boolean cancelDrawing() {
+		logger.debug("cancelDrawing true");
+		return true;
+	}
+
+	public Image getImageCursor() {
+		if(izoomin == null)
+			izoomin = IconThemeHelper.getImage("point-cursor");
+		return izoomin;
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/multiresolution/ResolutionLevelListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/multiresolution
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/analysisview/ViewRasterAnalysisTocMenuEntry.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/analysisview/ViewRasterAnalysisTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/analysisview/ViewRasterAnalysisTocMenuEntry.java	(revision 8183)
@@ -0,0 +1,185 @@
+/* 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.tools.app.basic.tool.analysisview;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JOptionPane;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.project.documents.view.MapOverview;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.raster.fmap.layers.DefaultFLyrRaster;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.layers.ILayerState;
+import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.tool.pixelincrease.PixelIncreaseDialog;
+
+/**
+ * Herramienta del men� contextual que carga el raster en el localizador para tener una visi�n general de
+ * esta y carga el zoom del cursor para tener una selecci�n de precisi�n.
+ *
+ * 16-jun-2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ViewRasterAnalysisTocMenuEntry extends AbstractTocContextMenuAction implements PropertyChangeListener, IGenericToolBarMenuItem {
+	private boolean onView = false;
+	private String rasterNameInLoc = "";
+	static private ViewRasterAnalysisTocMenuEntry singleton = null;
+
+	/**
+	 * Nadie puede crear una instancia a esta clase �nica, hay que usar el
+	 * getSingleton()
+	 */
+	private ViewRasterAnalysisTocMenuEntry() {}
+
+	/**
+	 * Devuelve un objeto unico a dicha clase
+	 * @return
+	 */
+	static public ViewRasterAnalysisTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new ViewRasterAnalysisTocMenuEntry();
+
+		return singleton;
+	}
+
+	public String getGroup() {
+		return "RasterLayer";
+	}
+
+	public int getGroupOrder() {
+		return 10;
+	}
+
+	public int getOrder() {
+		return 80;
+	}
+
+	public String getText() {
+		if (!onView)
+			return RasterToolsUtil.getText(this, "analysisview");
+		else
+			return RasterToolsUtil.getText(this, "closeanalysisview");
+	}
+
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof ILayerState))
+			return false;
+
+		if (!((ILayerState) selectedItems[0]).isOpen())
+			return false;
+		return true;
+	}
+
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof FLyrRaster))
+			return false;
+
+		return true;
+	}
+
+	public void execute(ITocItem item, FLayer[] selectedItems) {
+		MapControl mcCurrentLoc = null;
+		List<MapOverview> mapControlListLoc = new ArrayList<MapOverview>();
+		IWindow[] w = PluginServices.getMDIManager().getAllWindows();
+		IWindow activeWindow = PluginServices.getMDIManager().getActiveWindow();
+		FLayer lyr = selectedItems[0];
+
+		// Cerramos cualquier inspector de pixeles anterior que est� abierto y
+		// obtenemos el mapcontrol del localizador
+		for (int i = 0; i < w.length; i++) {
+			if (w[i] instanceof PixelIncreaseDialog)
+				RasterToolsUtil.closeWindow(w[i]);
+			if (w[i] instanceof AbstractViewPanel && w[i].equals(activeWindow))
+				mcCurrentLoc = ((AbstractViewPanel) w[i]).getMapOverview();
+			if (w[i] instanceof AbstractViewPanel)
+				mapControlListLoc.add(((AbstractViewPanel) w[i]).getMapOverview());
+		}
+
+		if (!onView) {
+			// Abrimos el inspector de pixeles
+			PixelIncreaseDialog pIncrease = new PixelIncreaseDialog();
+			RasterToolsUtil.addWindow(pIncrease);
+
+			// Cargamos el raster en el localizador
+			mcCurrentLoc.getMapContext().beginAtomicEvent();
+
+			String path = null;
+			if (lyr instanceof FLyrRaster)
+				path = new File(((FLyrRaster) lyr).getURI()).getAbsolutePath();
+
+			try {
+				File f = new File(path);
+				if(!f.exists()) {
+					RasterSwingLibrary.messageBoxError("error_file_not_found", PluginServices.getMDIManager().getActiveWindow());
+					return;
+				}
+				lyr = DefaultFLyrRaster.createLayer(lyr.getName(), f);
+				rasterNameInLoc = lyr.getName();
+				mcCurrentLoc.getMapContext().getLayers().addLayer(lyr);
+			} catch (LoadLayerException e) {
+				JOptionPane.showMessageDialog(null, RasterToolsUtil.getText(this, "coordenadas_erroneas"));
+			}
+			mcCurrentLoc.getMapContext().endAtomicEvent();
+		} else {
+			for (int nViews = 0; nViews < mapControlListLoc.size(); nViews++) {
+				MapControl mc = ((MapControl) mapControlListLoc.get(nViews));
+				FLayers lyrs = mc.getMapContext().getLayers();
+				for (int i = 0; i < lyrs.getLayersCount(); i++) {
+					if (lyrs.getLayer(i).getName().compareTo(rasterNameInLoc) == 0)
+						lyrs.removeLayer(i);
+				}
+				if (mc instanceof MapOverview)
+					((MapOverview) mc).refreshExtent();
+			}
+		}
+		onView = !onView;
+	}
+
+	public Icon getIcon() {
+		return RasterToolsUtil.getIcon("view-raster-analysis");
+	}
+
+	public void propertyChange(PropertyChangeEvent evt) {}
+
+	public boolean isEnableEvents() {
+		return true;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/analysisview/ViewRasterAnalysisTocMenuEntry.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/analysisview
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation/SaveRasterProcess.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation/SaveRasterProcess.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation/SaveRasterProcess.java	(revision 8183)
@@ -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.tools.app.basic.tool.saveraster.operation;
+
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.geom.AffineTransform;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Date;
+
+import javax.swing.JOptionPane;
+
+import org.gvsig.andami.PluginServices;
+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.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.process.TaskEventManager;
+import org.gvsig.fmap.dal.coverage.store.DataServerWriter;
+import org.gvsig.fmap.dal.coverage.store.RasterWriter;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.raster.process.RasterProcess;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Thread que se encarga de llamar a los writer para realizar la tarea de
+ * salvado y/p compresi�n
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SaveRasterProcess extends RasterProcess {
+	private ViewPort          viewPort          = null;
+	private Dimension         dimension         = null;
+	private RasterizerLayer   rasterizerLayer   = null;
+	private String            fileName          = "";
+	private Params            writerParams      = null;
+	private CopyDataset       jp2Copy           = null;
+	private boolean           supportImage      = false;
+	private ArrayList<FLyrRaster>
+                              layers            = null;
+	private RasterManager     rManager          = RasterLocator.getManager();
+	private Logger            logger            = LoggerFactory.getLogger(RasterProcess.class.toString());
+	
+	@SuppressWarnings("unchecked")
+	public void init() {
+		viewPort = (ViewPort) getParam("viewport");
+		dimension = (Dimension) getParam("dimension");
+		rasterizerLayer = (RasterizerLayer) getParam("rasterizerlayer");
+		fileName = getStringParam("filename");
+		writerParams = (Params) getParam("writerparams");
+		supportImage = getBooleanParam("remotelayers") && fileName.endsWith(".jp2");
+		layers = (ArrayList<FLyrRaster>) getParam("layers");
+	}
+
+	/**
+	 * Procesos de escritura de una porci�n de la vista.
+	 */
+	public void process() throws ProcessInterruptedException {
+		TaskEventManager task = rManager.getRasterTask();
+		if(layers != null) {
+			for (int i = 0; i < layers.size(); i++) 
+				layers.get(i).setReadingData(Thread.currentThread().getId() + "");
+		}
+		
+		jp2Copy = null;
+		long t2;
+		long t1 = new java.util.Date().getTime();
+		
+		//Creamos el driver
+		Envelope env = viewPort.getAdjustedEnvelope();
+		Extent ex = rManager.getDataStructFactory().createExtent(env.getMinimum(0), env.getMaximum(1), env.getMaximum(0), env.getMinimum(1));
+		Dimension imgSz = viewPort.getImageSize();
+		ViewPortData vpData = rManager.getDataStructFactory().createViewPortData(viewPort.getProjection(), ex, imgSz );
+		AffineTransform at = new AffineTransform(vpData.getExtent().width() / imgSz.width,
+												 0, 0,
+												 -(vpData.getExtent().height() / imgSz.height),
+												 vpData.getExtent().getULX(),
+												 vpData.getExtent().getULY());
+		String oldFileName = fileName;
+		if(supportImage) {
+			fileName = fileName.substring(0, Math.min(fileName.lastIndexOf(File.separator) + 1, fileName.length() - 1));
+			fileName += rManager.getFileUtils().usesOnlyLayerName() + ".tif";
+			writerParams = getWriterParams(fileName);
+		}
+
+		//Ejecutamos el driver con los datos pasados
+		try {
+			write(fileName, at, writerParams, rasterizerLayer);
+
+			if(task.getEvent() != null)
+				task.manageEvent(task.getEvent());
+			
+			if(supportImage) {
+				try {
+					insertLineLog(Messages.getText("saving_jp2"));
+					jp2Copy = new CopyDataset(fileName, oldFileName, incrementableTask);
+					jp2Copy.copy();
+					new File(fileName).delete();
+					new File(rManager.getFileUtils().getRMFNameFromFileName(fileName)).delete();
+				} catch (LoadLayerException e) {
+				} catch (org.gvsig.raster.algorithm.process.ProcessException e) {
+					logger.debug(RasterLocator.getManager().getRasterUtils().getTrace(e));
+					RasterSwingLibrary.messageBoxError("error_processing", this, e);
+				}
+				jp2Copy = null;
+			} 
+			t2 = new Date().getTime();
+			try {
+				saveRasterFinalize(oldFileName, (t2 - t1));
+			} catch(ArrayIndexOutOfBoundsException exc) {
+				//Si la ventana se ha cerrado ya es porque ha sido cancelada por lo que
+				//producir� esta excepci�n. En este caso no se lanza la ventana de informaci�n
+				//de finalizaci�n.
+			}
+
+		} catch(IOException ev) {
+			if (incrementableTask != null) {
+				incrementableTask.processFinalize();
+				incrementableTask = null;
+			}
+			RasterSwingLibrary.messageBoxError("error_processing", this, ev);
+			return;
+		} catch(OutOfMemoryError ev) {
+			if (incrementableTask != null) {
+				incrementableTask.processFinalize();
+				incrementableTask = null;
+			}
+			RasterSwingLibrary.messageBoxError("memoria_excedida", this, new IOException("Out of memory en salvar a raster"));
+		} finally {
+			if(layers != null) {
+				for (int i = 0; i < layers.size(); i++) 
+					layers.get(i).setReadingData(null);
+			}
+		}
+	}
+	
+	/**
+	 * 
+	 * @param name
+	 * @param at
+	 * @throws IOException
+	 * @throws InterruptedException
+	 */
+	private void write(String name, AffineTransform at, Params writerParams, DataServerWriter rasterizerLayer) throws IOException, ProcessInterruptedException {
+		TaskEventManager task = rManager.getRasterTask();
+		RasterWriter geoRasterWriter = null;
+		try {
+			//TODO: FUNCIONALIDAD: Poner los gerWriter con la proyecci�n de la vista
+			geoRasterWriter = rManager.createWriter(rasterizerLayer, name,
+												3, at, dimension.width,
+												dimension.height, Buffer.TYPE_IMAGE, writerParams, null);
+		} catch (NotSupportedExtensionException e) {
+			RasterSwingLibrary.messageBoxError("extension_no_soportada", (Component)PluginServices.getMainFrame(), e);
+		} catch (RasterDriverException e) {
+			RasterSwingLibrary.messageBoxError("no_driver_escritura", (Component)PluginServices.getMainFrame(), e);
+		}
+		
+		if(task.getEvent() != null)
+			task.manageEvent(task.getEvent());
+		
+		geoRasterWriter.setCancellableRasterDriver(new ExternalCancellable(incrementableTask));
+		geoRasterWriter.dataWrite();
+		geoRasterWriter.writeClose();
+	}
+	
+	/**
+	 * Obtiene los par�metros del driver de escritura. Si el driver no se ha creado a�n se obtienen
+	 * unos par�metros con la inicializaci�n por defecto. Si se ha creado ya y se han modificado se
+	 * devuelven los par�metros con las modificaciones. Si se cambia de driver se devolver� un WriterParams
+	 * como si fuera la primera vez que se abre.
+	 * @param name Nombre del fichero sobre el que se salva.
+	 * @return WriterParams
+	 */
+	private Params getWriterParams(String name) {
+		RasterWriter writer = null;
+		String ext = rManager.getFileUtils().getExtensionFromFileName(name);
+		try {
+			if(writer == null) //La primera vez que se obtiene el driver
+				writer = rManager.createWriter(name);
+			else {
+				String newType = rManager.getProviderServices().getWriteDriverType(ext);
+				String oldType = writer.getDriverName();
+				if(!newType.equals(oldType))  //Cambio de driver despu�s de haber seleccionado y modificado las propiedades de uno
+					writer = rManager.createWriter(name);
+			}
+
+			if(writer == null)
+				JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), PluginServices.getText(this, "no_driver_escritura"));
+
+			return writer.getParams();
+
+		} catch (NotSupportedExtensionException e1) {
+			JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), PluginServices.getText(this, "no_driver_escritura"));
+			return null;
+		} catch (RasterDriverException e1) {
+			JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), PluginServices.getText(this, "no_driver_escritura"));
+			return null;
+		}
+	}
+
+	/**
+	 * Acciones que se realizan al finalizar de salvar a raster.
+	 * @param fileName Nombre del fichero
+	 * @param milis Tiempo que ha tardado en ejecutarse
+	 */
+	private void saveRasterFinalize(String fileName, long milis) {
+		if (incrementableTask != null)
+			incrementableTask.hideWindow();
+		externalActions.end(new Object[]{fileName, new Long(milis)});
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#getPercent()
+	 */
+	public int getPercent() {
+		if(rasterizerLayer != null)
+			return rasterizerLayer.getPercent();
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#getTitle()
+	 */
+	public String getTitle() {
+		if(rasterizerLayer != null)
+			return rasterizerLayer.getTitle();
+		return null;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.RasterProcess#getLog()
+	 */
+	public String getLog() {
+		if(rasterizerLayer != null)
+			return rasterizerLayer.getLog();
+		return null;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#getLabel()
+	 */
+	public String getLabel() {
+		if(rasterizerLayer != null)
+			return rasterizerLayer.getLabel();
+		return null;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation/SaveRasterProcess.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation/CopyDataset.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation/CopyDataset.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation/CopyDataset.java	(revision 8183)
@@ -0,0 +1,149 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.saveraster.operation;
+
+import java.io.File;
+
+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.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.mapcontext.exceptions.LoadLayerException;
+import org.gvsig.gui.beans.incrementabletask.IncrementableTask;
+import org.gvsig.raster.algorithm.process.DataProcess;
+import org.gvsig.raster.algorithm.process.ProcessException;
+import org.gvsig.raster.fmap.layers.DefaultFLyrRaster;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.raster.process.ClippingProcess;
+import org.gvsig.raster.tools.app.basic.tool.saveas.SaveAsActions;
+
+/**
+ * Builds a copy of a raster file
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class CopyDataset {
+	private String 						fDstName          = null;
+	private String 						fSrcName          = null;
+	private FLyrRaster                  src               = null;
+	private DataProcess                 clippingProcess   = null;
+	private IncrementableTask           incrementableTask = null;
+	private RasterManager               rManager          = RasterLocator.getManager();
+
+	/**
+	 * Constructor
+	 * @param src	Nombre del fichero fuente
+	 * @param dst	Nombre del fichero destino
+	 * @throws LoadLayerException 
+	 * @throws LoadLayerException 
+	 * @throws RasterDriverException 
+	 * @throws NotSupportedExtensionException 
+	 */
+	public CopyDataset(String src, String dst) throws LoadLayerException {
+		fSrcName = src;
+		fDstName = dst;
+		File f = new File(fDstName);
+		if(f.exists())
+			f.delete();
+		this.src = DefaultFLyrRaster.createLayer("lyr", new File(fSrcName));
+	}
+	
+	/**
+	 * Constructor
+	 * @param src	Nombre del fichero fuente
+	 * @param dst	Nombre del fichero destino
+	 * @throws LoadLayerException 
+	 * @throws RasterDriverException 
+	 * @throws NotSupportedExtensionException 
+	 */
+	public CopyDataset(String src, String dst, IncrementableTask incrementableTask) throws LoadLayerException {
+		fSrcName = src;
+		fDstName = dst;
+		this.incrementableTask = incrementableTask;
+		File f = new File(fDstName);
+		if(f.exists())
+			f.delete();
+		this.src = DefaultFLyrRaster.createLayer("lyr", new File(fSrcName));
+	}
+	
+	/**
+	 * Funci�n que realiza la copia del dataset
+	 * @throws ProcessException 
+	 * @throws org.gvsig.raster.algorithm.process.ProcessException 
+	 * @throws InterruptedException 
+	 */
+	@SuppressWarnings("deprecation")
+	public void copy() throws ProcessInterruptedException, ProcessException {
+		// Creaci�n de par�metros
+		int[] dValues = new int[] { 0, (int) src.getDataStore().getHeight(), (int) src.getDataStore().getWidth(), 0 };
+		int[] drawableBands = new int[src.getDataStore().getBandCount()];
+		for (int i = 0; i < src.getDataStore().getBandCount(); i++)
+			drawableBands[i] = i;
+		Params params = null;
+		try {
+			params = rManager.createWriter(fDstName).getParams();
+		} catch (NotSupportedExtensionException e1) {
+			RasterSwingLibrary.messageBoxError("no_driver_escritura", this, e1);
+		} catch (RasterDriverException e1) {
+			RasterSwingLibrary.messageBoxError("no_driver_escritura", this, e1);
+		}
+
+		// Lanzamiento del proceso de guardado
+		clippingProcess = new ClippingProcess();
+		clippingProcess.setActions(new SaveAsActions());
+		if(incrementableTask != null)
+			clippingProcess.addParam("cancellable", new ExternalCancellable(incrementableTask));
+		clippingProcess.addParam("showenddialog", new Boolean(false));
+		clippingProcess.addParam("pixelcoordinates", dValues);
+		int index = fDstName.lastIndexOf(".");
+		if(index > 0) {
+			String suffix = fDstName.substring(index, fDstName.length());
+			if(suffix.length() == 4)
+				clippingProcess.addParam("suffix", suffix);
+		}
+		clippingProcess.addParam("filename", fDstName);
+		clippingProcess.addParam("layer", src.getDataStore());
+		clippingProcess.addParam("drawablebands", drawableBands);
+		clippingProcess.addParam("colorInterpretation", src.getDataStore().getColorInterpretation());
+		clippingProcess.addParam("onelayerperband", new Boolean(false));
+		clippingProcess.addParam("interpolationmethod", new Integer(Buffer.INTERPOLATION_NearestNeighbour));
+		clippingProcess.addParam("affinetransform", src.getDataStore().getAffineTransform());
+		clippingProcess.addParam("resolution", new int[]{(int) src.getDataStore().getWidth(),
+														 (int) src.getDataStore().getHeight()});
+		clippingProcess.addParam("driverparams", params);
+		clippingProcess.execute();
+	}
+	
+	/**
+	 * Obtiene el incremento de escritura
+	 * @return
+	 */
+	public int getPercent() {
+		if(clippingProcess != null)
+			return clippingProcess.getPercent();
+		return 0;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation/CopyDataset.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation/SaveRasterActions.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation/SaveRasterActions.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation/SaveRasterActions.java	(revision 8183)
@@ -0,0 +1,62 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.saveraster.operation;
+
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.swing.RasterSwingLocator;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.raster.process.IProcessActions;
+import org.gvsig.raster.util.RasterNotLoadException;
+/**
+ * Acciones que ejecuta el proceso de salvado.
+ *
+ * @version 26/09/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SaveRasterActions implements IProcessActions {
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.IProcessActions#end(java.lang.Object)
+	 */
+	public void end(Object params) {
+		if(	params instanceof Object[] &&
+			((Object[])params).length == 2 &&
+			((Object[])params)[0] instanceof String &&
+			((Object[])params)[1] instanceof Long) {
+
+			String fName = (String)((Object[])params)[0];
+			long milis = ((Long)((Object[])params)[1]).longValue();
+
+			if(RasterSwingLibrary.messageBoxYesOrNot("cargar_toc", this)) {
+				try {
+					RasterToolsUtil.loadLayer(null, fName, null);
+				} catch (RasterNotLoadException e) {
+					RasterSwingLibrary.messageBoxError("error_load_layer", this, e);
+				}
+			}
+			RasterSwingLocator.getSwingManager().showSummaryProcessDialog(fName, milis);
+		}
+	}
+
+	public void interrupted() {}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation/SaveRasterActions.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation/RasterizerLayer.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation/RasterizerLayer.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation/RasterizerLayer.java	(revision 8183)
@@ -0,0 +1,355 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.saveraster.operation;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.messages.NotificationManager;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.store.DataServerWriter;
+import org.gvsig.fmap.dal.exception.ReadException;
+import org.gvsig.fmap.geom.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.impl.DefaultMapContextDrawer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.gui.beans.incrementabletask.IIncrementable;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.tools.task.Cancellable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Sirve datos solicitados por los drivers que salvan a raster. Hereda de
+ * Rasterizer y reescribe el m�todo readData que es el que ser� llamado desde el
+ * driver cada vez que vacie el buffer y necesite m�s datos.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RasterizerLayer implements DataServerWriter, IIncrementable {
+	private static final GeometryManager 	geomManager		= GeometryLocator.getGeometryManager();
+	private Logger                          log             = LoggerFactory.getLogger(RasterizerLayer.class);
+	private ViewPort						viewPort 		= null;
+	private ViewPort						viewPortBlock	= null;
+	private FLayers							flayers 		= null;
+	private Color							backgroundColor = null;
+	private boolean							firstRead 		= true;
+	private int 							nBlocks 		= 0;
+//	private double 							percentMax 		= 100.0D;
+	protected double 						wcIntervalo 	= 0;
+	protected Dimension 					dimension 		= null;
+	protected int 							blockSize 		= 0;
+	protected double 						wcAlto 			= 0;
+	protected int 							lastBlock 		= 0;
+	protected BufferedImage 				image 			= null;
+	protected int[] 						rasterData 		= null;
+	protected int 							contBlocks 		= 1;
+	protected int							percent 		= 0;
+	protected int							imgHeight 		= 0;
+
+	/**
+	 * Calculo del viewPort
+	 * @param vp
+	 */
+	private void calcViewPort(ViewPort vp) {
+		Rectangle2D ext = null;
+
+		if (viewPortBlock == null)
+			ext = new Rectangle2D.Double(	vp.getExtent().getMinX(),
+											vp.getExtent().getMaxY() - wcIntervalo,
+											vp.getExtent().getWidth(),
+											wcIntervalo
+										);
+		else
+			ext = new Rectangle2D.Double(	viewPortBlock.getExtent().getMinX(),
+											viewPortBlock.getExtent().getMinY() - wcIntervalo,
+											viewPortBlock.getExtent().getWidth(),
+											wcIntervalo
+										);
+
+		viewPortBlock = new ViewPort(vp.getProjection());
+		Envelope env;
+		try {
+			env = geomManager.createEnvelope(ext.getMinX(), ext.getMinY(), ext.getMaxX(), ext.getMaxY(), SUBTYPES.GEOM2D);
+			viewPortBlock.setEnvelope(env);
+		} catch (CreateEnvelopeException e) {
+			log.debug("Error creating the envelope", null, e);
+		}		
+		viewPortBlock.setImageSize(dimension);
+		viewPortBlock.refreshExtent();
+	}
+
+	/**
+	 * Constructor
+	 * @param flyrs capas
+	 * @param vp viewport
+	 * @param blockSize altura del bloque que se lee de una vez en la imagen de entrada
+	 * @param mapCtrl Mapcontrol
+	 */
+	public RasterizerLayer(FLayers flyrs, ViewPort vp, int blockSize) {
+		this.blockSize = blockSize;
+		backgroundColor = vp.getBackColor();
+		viewPort = new ViewPort(vp.getProjection());
+		viewPort.setImageSize(vp.getImageSize());
+		Rectangle2D ex = vp.getExtent();
+		Envelope env = null;
+		try {
+			env = geomManager.createEnvelope(ex.getMinX(), ex.getMinY(), ex.getMaxX(), ex.getMaxY(), SUBTYPES.GEOM2D);
+			//viewPortBlock = new ViewPort(vp.getProjection());
+			//viewPortBlock.setEnvelope(env);
+		} catch (CreateEnvelopeException e) {
+			log.debug("Error creating the envelope", null, e);
+		}
+		
+
+		// Calculo del viewPort del primer bloque
+		viewPort.setEnvelope(vp.getAdjustedExtent());
+		wcAlto = viewPort.getExtent().getMaxY() - viewPort.getExtent().getMinY();
+		wcIntervalo = (blockSize * wcAlto) / viewPort.getImageHeight();
+		dimension = new Dimension(viewPort.getImageWidth(), blockSize);
+
+		imgHeight = vp.getImageHeight();
+		nBlocks = (vp.getImageHeight() / blockSize);
+
+		// Tama�o de �ltimo bloque en pixeles
+		lastBlock = vp.getImageHeight() - (nBlocks * blockSize);
+
+		calcViewPort(viewPort);
+
+		this.flayers = flyrs;
+	}
+
+	/**
+	 * Compatibilidad con el piloto de raster
+	 * @see readData
+	 */
+	public int[] readARGBData(int sX, int sY, int nBand) throws ProcessInterruptedException, OutOfMemoryError {
+		return readData( sX, sY, nBand);
+	}
+
+	public int[] readData(int sX, int sY, int nBand) throws ProcessInterruptedException, OutOfMemoryError {
+		if (nBand == 0) { // Con nBand==0 se devuelven las 3 bandas
+			nBlocks = (int) Math.ceil(imgHeight / (double) blockSize);
+			image = new BufferedImage(sX, sY, BufferedImage.TYPE_INT_RGB);
+			Graphics2D g = (Graphics2D) image.getGraphics();
+			g.setColor(backgroundColor);
+			g.fillRect(0, 0, viewPortBlock.getImageWidth(), viewPortBlock.getImageHeight());
+			try {
+				// TODO: FUNCIONALIDAD: Salvar los m�ximos y m�nimos para salvar 16 bits
+
+				// Si es la primera lectura salvamos los valores de m�ximo y m�nimo para la aplicaci�n
+				// de realce si la imagen es de 16 bits.
+				if (firstRead) {
+					for (int i = 0; i < flayers.getLayersCount(); i++)
+						if (flayers.getLayer(i) instanceof FLyrRaster) {
+							FLyrRaster raster = (FLyrRaster) flayers.getLayer(i);
+							if (raster.getDataStore().getDataType()[0] == Buffer.TYPE_SHORT || raster.getDataStore().getDataType()[0] == Buffer.TYPE_USHORT) {
+								//Statistic stats = raster.getSource().getFilterStack().getStats();
+								//stats.history.add(stats.new History(raster.getName(), stats.minBandValue, stats.maxBandValue, stats.secondMinBandValue, stats.secondMaxBandValue));
+							}
+						}
+					firstRead = false;
+				}
+
+				DefaultMapContextDrawer mapContextDrawer = new DefaultMapContextDrawer();
+				mapContextDrawer.setMapContext(flayers.getMapContext());
+				mapContextDrawer.setViewPort(viewPortBlock);
+				mapContextDrawer.draw(flayers, image, g, new Cancellable(){
+					public boolean isCanceled() {
+						return false;
+					}
+
+					public void setCanceled(boolean canceled) {
+					}
+				}, flayers.getMapContext().getScaleView());
+
+				// Si es el �ltimo bloque vaciamos el historial de m�ximos y m�nimos
+				if ((contBlocks + 1) == nBlocks)
+					for (int i = 0; i < flayers.getLayersCount(); i++)
+						if (flayers.getLayer(i) instanceof FLyrRaster) {
+							FLyrRaster raster = (FLyrRaster) flayers.getLayer(i);
+							if (raster.getDataStore().getDataType()[0] == Buffer.TYPE_SHORT || raster.getDataStore().getDataType()[0] == Buffer.TYPE_USHORT) {
+								//raster.getDatasource().getFilterStack().getStats().history.clear();
+								//Statistic stats = raster.getSource().getFilterStack().getStats();
+							}
+						}
+
+			} catch (ReadException e) {
+				NotificationManager.addError("Error en el draw de capa", e);
+			}
+			rasterData = image.getRGB(0, 0, sX, sY, rasterData, 0, sX);
+
+			// Calculamos el viewPort del sgte bloque
+
+			if (((contBlocks + 1) * blockSize) <= viewPort.getImageHeight())
+				dimension = new Dimension(sX, sY);
+			else { // Calculo de la altura del �ltimo bloque
+				dimension = new Dimension(sX, (viewPort.getImageHeight() - (contBlocks * blockSize)));
+				wcIntervalo = (lastBlock * wcAlto) / viewPort.getImageHeight();
+			}
+
+			calcViewPort(viewPortBlock);
+
+			percent = ((100 * (contBlocks)) / nBlocks);
+			contBlocks++;
+
+			return rasterData;
+		}
+
+		return null;
+	}
+
+	/**
+	 * Asigna el ancho del bloque
+	 * @param sizeBlock Ancho del bloque en pixeles
+	 */
+	public void setBlockSize(int blockSize) {
+		this.blockSize = blockSize;
+	}
+
+	/**
+	 * No tiene uso en RasterizerLayer
+	 */
+	public byte[][] readByteData(int sizeX, int sizeY) {
+		return null;
+	}
+
+	/**
+	 * No tiene uso en RasterizerLayer
+	 */
+	public double[][] readDoubleData(int sizeX, int sizeY) {
+		return null;
+	}
+
+	/**
+	 * No tiene uso en RasterizerLayer
+	 */
+	public float[][] readFloatData(int sizeX, int sizeY) {
+		return null;
+	}
+
+	/**
+	 * No tiene uso en RasterizerLayer
+	 */
+	public int[][] readIntData(int sizeX, int sizeY) {
+		return null;
+	}
+
+	/**
+	 * No tiene uso en RasterizerLayer
+	 */
+	public short[][] readShortData(int sizeX, int sizeY) {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#getTitle()
+	 */
+	public String getTitle() {
+		return PluginServices.getText(this, "salvando_raster");
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#getLog()
+	 */
+	public String getLog() {
+		return PluginServices.getText(this, "salvando_bloque") + " " + Math.min(nBlocks, contBlocks) + " " + PluginServices.getText(this, "de") + " " + nBlocks;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#getLabel()
+	 */
+	public String getLabel() {
+		return PluginServices.getText(this, "rasterizando") + "...";
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#getPercent()
+	 */
+	public int getPercent() {
+		return percent;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#isCancelable()
+	 */
+	public boolean isCancelable() {
+		return true;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#isPausable()
+	 */
+	public boolean isPausable() {
+		return false;
+	}
+
+	public void setAlphaBuffer(Buffer alphaBuffer) {
+		// TODO Auto-generated method stub
+	}
+
+	public void setBuffer(Buffer buffer, int nband) {
+		// TODO Auto-generated method stub
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.DataServerWriter#getBuffer()
+	 */
+	public Buffer getBuffer() {
+		return null;
+	}
+
+	public void setBand(int nband) {
+		// TODO Auto-generated method stub
+	}
+
+	public void dispose() {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public Buffer getSource() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public void setPercent(int value) {
+		// TODO Auto-generated method stub
+		
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation/RasterizerLayer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation/ExternalCancellable.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation/ExternalCancellable.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation/ExternalCancellable.java	(revision 8183)
@@ -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.tools.app.basic.tool.saveraster.operation;
+
+import org.gvsig.gui.beans.incrementabletask.IncrementableTask;
+
+public class ExternalCancellable implements org.gvsig.fmap.dal.coverage.store.ExternalCancellable {
+	private IncrementableTask task = null;
+	
+	public ExternalCancellable(IncrementableTask task) {
+		this.task = task;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.dataset.io.IExternalCancellable#processFinalize()
+	 */
+	public void processFinalize() {
+		if(task != null)
+			task.processFinalize();
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation/ExternalCancellable.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/operation
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/DriverProperties.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/DriverProperties.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/DriverProperties.java	(revision 8183)
@@ -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.tools.app.basic.tool.saveraster;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.util.ProviderServices;
+
+/**
+ * Clase que representa a las propiedades que se seleccionan de cada driver.
+ * Inicialmente se resetea el array driversProps a null. Cada elemento de este
+ * array representa una extensi�n de fichero soportada. Cuando se modifica
+ * las propiedades para una determinada extensi�n de un driver estas se asignan
+ * a su entrada del vector driversExtensionProps y desde aqu� son leidas para
+ * ser restauradas en caso de volver el cuadro de dialogo de propiedades.
+ *  
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class DriverProperties{
+
+	private String[][]				driversExtensionProps = null;
+	private String[]				driversExtension = null;
+
+	public DriverProperties(){
+		ProviderServices prov = RasterLocator.getManager().getProviderServices();
+		driversExtensionProps = new String[prov.getWriteNDrivers()][];
+		for(int i = 0; i < prov.getWriteNDrivers(); i++)
+			driversExtensionProps[i] = null;
+		driversExtension = prov.getDriversExtensions();
+	}
+
+	/**
+	 * Asigna un vector de propiedades de driver de escritura.
+	 * @param ext	extensi�n del driver.
+	 * @param props	propiedades.
+	 */
+	public void setProperties(String ext, String[] props){
+		for(int i = 0; i < driversExtension.length; i++){
+			if(ext.equals(driversExtension[i])){
+				driversExtensionProps[i] = props;
+			}
+		}
+	}
+
+	/**
+	 * Obtiene un vector de propiedades de driver de escritura.
+	 * @param ext	extensi�n del driver.
+	 * @return	propiedades.
+	 */
+	public String[] getProperties(String ext){
+		for(int i = 0; i < driversExtension.length; i++){
+			if(ext.equals(driversExtension[i])){
+				return driversExtensionProps[i];
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * Para una extensi�n de fichero determinada obtiene el valor de una propiedad si existe este.
+	 * La extensi�n solicitadad deber� estar registrada
+	 * @param extension Extensi�n del fichero.
+	 * @param property Propiedad a recuperar.
+	 * @return Valor de la propiedad o null en caso de que la extensi�n de fichero no exista o la propiedad
+	 * no se encuentre.
+	 */
+	public String getValue(String extension, String property) {
+		String[] props = getProperties(extension);
+		if(props != null){
+			for (int i = 0; i < props.length; i++) {
+				if(props[i].startsWith(property + "="))
+					return props[i].substring(props[i].lastIndexOf("=") + 1, props[i].length());
+			}
+		}
+		return null;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/DriverProperties.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/SaveRasterTocMenuEntry.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/SaveRasterTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/SaveRasterTocMenuEntry.java	(revision 8183)
@@ -0,0 +1,135 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.saveraster;
+
+import javax.swing.Icon;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.app.project.documents.view.ViewDocument;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.app.project.documents.view.toolListeners.StatusBarListener;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseMovementBehavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.RectangleBehavior;
+import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.map.SaveRasterListener;
+
+
+/**
+ * Punto de entrada para la funcionalidad de salvar a raster
+ * 
+ * 22/07/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class SaveRasterTocMenuEntry extends AbstractTocContextMenuAction implements IGenericToolBarMenuItem {
+	static private SaveRasterTocMenuEntry singleton  = null;
+
+	/**
+	 * Nadie puede crear una instancia a esta clase �nica, hay que usar el
+	 * getSingleton()
+	 */
+	private SaveRasterTocMenuEntry() {}
+
+	/**
+	 * Devuelve un objeto unico a dicha clase
+	 * @return
+	 */
+	static public SaveRasterTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new SaveRasterTocMenuEntry();
+		return singleton;
+	}
+
+	public String getGroup() {
+		return "RasterExport";
+	}
+
+	public int getGroupOrder() {
+		return 50;
+	}
+
+	public int getOrder() {
+		return 0;
+	}
+
+	public String getText() {
+		return RasterToolsUtil.getText(this, "salvar_raster_geo");
+	}
+
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		return true;
+	}
+
+	@SuppressWarnings("deprecation")
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		org.gvsig.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager().getActiveWindow();
+		if (f == null)
+			return false;
+
+		if (f instanceof AbstractViewPanel) {
+			AbstractViewPanel vista = (AbstractViewPanel) f;
+			ViewDocument model = vista.getModel();
+			MapContext mapa = model.getMapContext();
+			if (mapa.getLayers().getLayersCount() > 0) 
+				return true;
+		}
+
+		return false;
+	}
+
+	public void execute(ITocItem item, FLayer[] selectedItems) {
+		AbstractViewPanel theView = (AbstractViewPanel) PluginServices.getMDIManager().getActiveWindow();
+		MapControl mapCtrl = theView.getMapControl();
+
+		// Listener de eventos de movimiento que pone las coordenadas del rat�n en
+		// la barra de estado
+		StatusBarListener sbl = new StatusBarListener(mapCtrl);
+
+		RasterSwingLibrary.messageBoxInfo("start_save", theView);
+		loadSaveRasterListener(mapCtrl, sbl);
+		mapCtrl.setTool("saveRaster");
+	}
+	
+	/**
+	 * Carga el listener de salvar a raster en el MapControl.
+	 */
+	private void loadSaveRasterListener(MapControl m_MapControl, StatusBarListener sbl) {
+		// Si no se ha cargado el listener a�n lo cargamos.
+		if (m_MapControl.getNamesMapTools().get("saveRaster") == null) {
+			SaveRasterListener srl = new SaveRasterListener(m_MapControl);
+			m_MapControl.addBehavior("saveRaster", new Behavior[] { new RectangleBehavior(srl), new MouseMovementBehavior(sbl) });
+		}
+	}
+	
+	public Icon getIcon() {
+		return IconThemeHelper.getImageIcon("view-export-georeferenced-raster");
+	}
+	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/SaveRasterTocMenuEntry.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/map/SaveRasterListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/map/SaveRasterListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/map/SaveRasterListener.java	(revision 8183)
@@ -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.raster.tools.app.basic.tool.saveraster.map;
+
+
+import java.awt.Image;
+import java.awt.geom.Point2D;
+import java.text.DecimalFormat;
+import java.text.NumberFormat;
+import java.util.Locale;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.Events.EnvelopeEvent;
+import org.gvsig.raster.fmap.tool.SaveRasterListenerImpl;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.ui.SaveRasterDialog;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.ui.SaveRasterPanel;
+
+
+
+/**
+ * Extensi�n de la clase SaveRasterListenerImpl de FMap para poder llamar a m�todos
+ * de andami o de gvSIG.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SaveRasterListener extends SaveRasterListenerImpl {
+	private final Image isaveraster = IconThemeHelper.getImage("rectangle-select-cursor");
+
+	public SaveRasterListener(MapControl mapCtrl) {
+		super(mapCtrl);
+	}
+
+	public void rectangle(EnvelopeEvent event) {
+		super.rectangle(event);
+
+		if (PluginServices.getMainFrame() != null)
+				PluginServices.getMainFrame().enableControls();
+
+		FLayers layers = mapCtrl.getMapContext().getLayers();
+
+		SaveRasterDialog saveRaster = null;
+		boolean open = false;
+		IWindow[] win = PluginServices.getMDIManager().getAllWindows();
+		for(int i = 0; i < win.length; i++) {
+			if(win[i] instanceof SaveRasterDialog) {
+				saveRaster = (SaveRasterDialog)win[i];
+				open = true;
+			}
+		}
+		if(saveRaster == null)
+			saveRaster = new SaveRasterDialog(layers, mapCtrl);
+
+		ViewPort vp = mapCtrl.getViewPort();
+		Point2D ini = vp.fromMapPoint(rect.getMinimum(0), rect.getMinimum(1));
+		Point2D fin = vp.fromMapPoint(rect.getMaximum(0), rect.getMaximum(1));
+		if(Math.abs(fin.getY() - ini.getY()) > 10 && Math.abs(fin.getX() - ini.getX()) > 10) {
+			SaveRasterPanel dialog = saveRaster.getControlsPanel();
+			dialog.getBProperties().setEnabled(false);
+			dialog.setViewPort(vp);
+
+			DecimalFormat nf = (DecimalFormat)NumberFormat.getInstance(Locale.ENGLISH);
+			nf.applyPattern("#.#");
+	        nf.setMaximumFractionDigits(4);
+	        
+			if(!vp.getProjection().isProjected())
+				nf.setMaximumFractionDigits(6);
+
+			try{
+				dialog.getTInfDerX().setValue(nf.format(rect.getMaximum(0)));
+			}catch(IndexOutOfBoundsException ex){
+				dialog.getTInfDerX().setValue(String.valueOf(rect.getMaximum(0)));
+			}
+
+			try{
+				dialog.getTInfDerY().setValue(nf.format(rect.getMinimum(1)));
+			}catch(IndexOutOfBoundsException ex){
+				dialog.getTInfDerY().setValue(String.valueOf(rect.getMinimum(1)));
+			}
+
+			try{
+				dialog.getTSupIzqX().setValue(nf.format(rect.getMinimum(0)));
+			}catch(IndexOutOfBoundsException ex){
+				dialog.getTSupIzqX().setValue(String.valueOf(rect.getMinimum(0)));
+			}
+
+			try{
+				dialog.getTSupIzqY().setValue(nf.format(rect.getMaximum(1)));
+			}catch(IndexOutOfBoundsException ex){
+				dialog.getTSupIzqY().setValue(String.valueOf(rect.getMaximum(1)));
+			}
+			if(!open)
+				PluginServices.getMDIManager().addWindow(saveRaster);
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener#getImageCursor()
+	 */
+	public Image getImageCursor() {
+		return isaveraster;
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/map/SaveRasterListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/map
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/property/WriterPropertiesDialog.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/property/WriterPropertiesDialog.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/property/WriterPropertiesDialog.java	(revision 8183)
@@ -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.tools.app.basic.tool.saveraster.ui.property;
+
+import java.awt.BorderLayout;
+
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.andami.ui.mdiManager.WindowInfo;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.gui.beans.propertiespanel.PropertiesPanel;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.ui.listener.WriterPropertiesListener;
+
+
+/**
+ * Ventana para el dialogo de propiedades del driver de escritura.
+ * 
+ * @version 24/04/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class WriterPropertiesDialog extends JPanel implements IWindow {
+	private static final long serialVersionUID = 1L;
+	private PropertiesPanel pd = null;
+	private WriterPropertiesListener listener = null;
+	
+	/**
+	 * Constructor. Asigna el panel de propiedades.
+	 * @param pd PropertiesDialog
+	 */
+	public WriterPropertiesDialog(PropertiesPanel pd, Params params) {
+		this.pd = pd;
+		listener = new WriterPropertiesListener(this, params);
+		pd.addButtonPressedListener(listener);
+		setSize(330, 135);
+		this.setLayout(new BorderLayout());
+		add(pd, BorderLayout.CENTER);
+	}
+	
+	/**
+	 * Obtiene el componente panel de propiedades
+	 * @return PropertiesPanel
+	 */
+	public PropertiesPanel getPropertiesPanel() {
+		return pd;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.andami.ui.mdiManager.IWindow#getWindowInfo()
+	 */
+	public WindowInfo getWindowInfo() {
+		WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG | WindowInfo.RESIZABLE);
+		m_viewinfo.setTitle(PluginServices.getText(this, "properties"));
+		return m_viewinfo;
+	}
+
+	public Object getWindowProfile() {
+		return WindowInfo.DIALOG_PROFILE;
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/property/WriterPropertiesDialog.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/property
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/listener/DataInputListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/listener/DataInputListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/listener/DataInputListener.java	(revision 8183)
@@ -0,0 +1,597 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.saveraster.ui.listener;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+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.io.File;
+import java.util.EventObject;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.util.MathUtils;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.datainput.DataInputContainer;
+import org.gvsig.gui.beans.datainput.DataInputContainerListener;
+import org.gvsig.gui.beans.swing.JFileChooser;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.ui.SaveRasterDialog;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.ui.SaveRasterPanel;
+import org.gvsig.raster.util.ExtendedFileFilter;
+
+/**
+ * Panel encargado de manejar los eventos del los controles de Salvar a Raster
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DataInputListener implements ActionListener, MouseListener, FocusListener, KeyListener, DataInputContainerListener {
+	final private static long        serialVersionUID         = -3370601314380922368L;
+	private SaveRasterPanel          controlPanel             = null;
+	private SaveRasterDialog         dialog                   = null;
+	private String                   fName                    = null;
+	private double                   widthInPixels            = 0;
+	private double                   heightInPixels           = 0;
+	private double                   mtsPerPixel              = 0D;
+	private Object                   obj                      = null;
+	private double                   widthMts                 = 0D, heightMts = 0D;
+	private boolean                  enableEventValueChanged  = true;
+	private MathUtils                math                     = RasterLocator.getManager().getMathUtils();
+	/**
+	 * This method initializes
+	 *
+	 */
+	public DataInputListener(SaveRasterPanel controlPanel) {
+		super();
+		this.controlPanel = controlPanel;
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 *
+	 * @return void
+	 */
+	void initialize() {
+
+		//A�adimos gesti�n de eventos
+		controlPanel.getTScale().addValueChangedListener(this);
+		controlPanel.getTMtsPixel().addValueChangedListener(this);
+		controlPanel.getTWidth().addValueChangedListener(this);
+		controlPanel.getTHeight().addValueChangedListener(this);
+
+		controlPanel.getCbMeasureType().addActionListener(this);
+
+		controlPanel.getTInfDerX().addValueChangedListener(this);
+		controlPanel.getTInfDerY().addValueChangedListener(this);
+		controlPanel.getTSupIzqX().addValueChangedListener(this);
+		controlPanel.getTSupIzqY().addValueChangedListener(this);
+
+		controlPanel.getBSelect().addActionListener(this);
+		controlPanel.getBProperties().addActionListener(this);
+
+		controlPanel.getCbResolution().addActionListener(this);
+		controlPanel.getCbResolution().addKeyListener(this);
+	}
+
+	/**
+	 * Asigna un valor al panel padre
+	 * @param dialogPanel
+	 */
+	public void setDialogPanel(SaveRasterDialog dialog) {
+		this.dialog = dialog;
+	}
+
+	/**
+	 * Obtiene el Panel de Controles interior
+	 * @return
+	 */
+	public SaveRasterPanel getSaveParameters() {
+		if (controlPanel == null) {
+			controlPanel = new SaveRasterPanel();
+		}
+		return controlPanel;
+	}
+
+	/**
+	 * A partir del valor de tama�o de imagen de salida, comprueba el tipo de
+	 * dato seleccionado por el usuario (Pixels, mms, cms, mts, pulgadas) y devuelve
+	 * el valor en pixeles.
+	 * @param value Cadena introducida por el usuario
+	 */
+	private int getCorrectMeasure(String value){
+		if(controlPanel.getCbMeasureType().getSelectedItem().equals("Pixels"))
+			return (int)Double.parseDouble(value);
+
+		int ppp = Integer.parseInt((String)controlPanel.getCbResolution().getSelectedItem());
+		if(controlPanel.getCbMeasureType().getSelectedItem().equals("Mts"))
+			return math.convertMtsToPixels(Double.parseDouble(value), ppp);
+		if(controlPanel.getCbMeasureType().getSelectedItem().equals("Cms"))
+			return math.convertCmsToPixels(Double.parseDouble(value), ppp);
+		if(controlPanel.getCbMeasureType().getSelectedItem().equals("Mms"))
+			return math.convertMmsToPixels(Double.parseDouble(value), ppp);
+		if(controlPanel.getCbMeasureType().getSelectedItem().equals("Inches"))
+			return math.convertInchesToPixels(Double.parseDouble(value), ppp);
+
+		return 0;
+	}
+
+	/**
+	 * Asigna al JTextField pasado como par�metro el valor en pixels, cms, mms ,mtrs, pulgadas dependiendo
+	 * de la selecci�n del combo
+	 * @param pixel	Valor en pixels
+	 * @param field Campo donde se escribe el valor
+	 */
+	private void setCorrectMeasure(double pixel, DataInputContainer field){
+		if(controlPanel.getCbMeasureType().getSelectedItem().equals("Pixels")) {
+			field.setValue(String.valueOf(pixel));
+			return;
+		}
+
+		enableEventValueChanged = false;
+		int ppp = Integer.parseInt((String)controlPanel.getCbResolution().getSelectedItem());
+		if(controlPanel.getCbMeasureType().getSelectedItem().equals("Mts"))
+			field.setValue(String.valueOf(math.clipDecimals(math.convertPixelsToMts(pixel, ppp),5)));
+
+		if(controlPanel.getCbMeasureType().getSelectedItem().equals("Cms"))
+			field.setValue(String.valueOf(math.clipDecimals(math.convertPixelsToCms(pixel, ppp),5)));
+
+		if(controlPanel.getCbMeasureType().getSelectedItem().equals("Mms"))
+			field.setValue(String.valueOf(math.clipDecimals(math.convertPixelsToMms(pixel, ppp),5)));
+
+		if(controlPanel.getCbMeasureType().getSelectedItem().equals("Inches"))
+			field.setValue(String.valueOf(math.clipDecimals(math.convertPixelsToInches(pixel, ppp),5)));
+		enableEventValueChanged = true;
+
+	}
+
+		/**
+		 * Calculo del tama�o en pixels de la imagen a partir de las coordenadas del
+		 * mundo real, la escala y los puntos por pulgada
+		 */
+		private void recalcParams() {
+			validateFields();
+			try{
+				double[] size = calcSizeInMts();
+				if(size != null) {
+					widthMts = size[0];
+					heightMts = size[1];
+				} else {
+					return;
+				}
+			} catch (NumberFormatException e) {
+				return;
+			}
+
+			int resolution = Integer.parseInt((String)controlPanel.getCbResolution().getSelectedItem());
+
+			//Al variar la resoluci�n independientemente del m�todo seleccionado recalculamos el ancho y el alto
+			if (obj.equals(controlPanel.getCbResolution())) {
+				String escala = controlPanel.getTScale().getValue();
+				try{
+					if(controlPanel.getViewPort().getProjection().isProjected())
+						calcSizeMtsPixel(Double.parseDouble(escala), resolution);
+				}
+				catch(NumberFormatException exc){
+					calcSizeMtsPixel(0, resolution);
+				}
+				return;
+			}
+
+			//M�todo por escala seleccionado
+			if(	controlPanel.getRbScale().isSelected() &&
+				!controlPanel.getTScale().getValue().equals("")) {
+				double scale = Double.parseDouble(controlPanel.getTScale().getValue());
+				calcSizeMtsPixel(scale, resolution);
+			}
+
+			//M�todo por tama�o seleccionado
+			if(controlPanel.getRbSize().isSelected()) {
+				double rel = (widthMts / heightMts);
+
+				if(	obj != null && obj.equals(controlPanel.getTWidth().getDataInputField()) &&
+					!controlPanel.getTWidth().getValue().equals("")) {
+					this.widthInPixels = this.getCorrectMeasure(controlPanel.getTWidth().getValue());
+					this.heightInPixels = (int)Math.floor(this.widthInPixels / rel);
+					calcScaleMtsPixel(this.widthInPixels, this.heightInPixels, resolution);
+				}
+				if(	obj != null && obj.equals(controlPanel.getTHeight().getDataInputField()) &&
+							!controlPanel.getTHeight().getValue().equals("")) {
+					this.heightInPixels = this.getCorrectMeasure(controlPanel.getTHeight().getValue());
+					this.widthInPixels = (int)Math.ceil(this.heightInPixels * rel);
+					calcScaleMtsPixel(this.widthInPixels, this.heightInPixels, resolution);
+				}
+				if(	obj != null &&
+					obj.equals(controlPanel.getCbMeasureType())) {
+						calcScaleMtsPixel(this.widthInPixels, this.heightInPixels, resolution);
+				}
+			}
+
+			//M�todo metros por pixel seleccionado
+			if(	controlPanel.getRbMtsPixel().isSelected() &&
+				!controlPanel.getTMtsPixel().getValue().equals("")) {
+				double mtsPixel = Double.parseDouble(controlPanel.getTMtsPixel().getValue());
+				calcSizeScale(mtsPixel, resolution);
+			}
+		}
+
+		/**
+		 * Comprueba si un campo de texto tiene el tipo de dato entero o double y si no lo
+		 * tiene lo borra ya que su contenido es invalido para operar con el
+		 * @param field	Campo de texto a validar
+		 * @param isInt true si el valor a validar es entero y false si es double
+		 */
+		private void validateTextField(DataInputContainer field){
+			try {
+					Double.parseDouble(field.getValue());
+			} catch (NumberFormatException e) {
+					 field.setValue("0");
+			}
+		}
+
+		/**
+		 * Valida los campos de texto
+		 */
+		private void validateFields(){
+
+			//Validamos la escala si se ha introducido algo
+			if(!controlPanel.getTScale().getValue().equals(""))
+				validateTextField(controlPanel.getTScale());
+
+			//Validamos los mts por pixel si se ha introducido algo
+			if(!controlPanel.getTMtsPixel().getValue().equals(""))
+				validateTextField(controlPanel.getTMtsPixel());
+
+			//Validamos el ancho si se ha introducido algo
+			if(!controlPanel.getTWidth().getValue().equals(""))
+				validateTextField(controlPanel.getTWidth());
+
+			//Validamos el alto si se ha introducido algo
+			if(!controlPanel.getTHeight().getValue().equals(""))
+				validateTextField(controlPanel.getTHeight());
+		}
+		
+		/**
+		 * Calcula el tama�o en mtrs a partir de las coordenadas.
+		 * 
+		 * @return
+		 * @throws NumberFormatException
+		 */
+		private double[] calcSizeInMts()throws NumberFormatException {
+			double lrx = Double.parseDouble(controlPanel.getTInfDerX().getValue());
+			double lry = Double.parseDouble(controlPanel.getTInfDerY().getValue());
+			double ulx = Double.parseDouble(controlPanel.getTSupIzqX().getValue());
+			double uly = Double.parseDouble(controlPanel.getTSupIzqY().getValue());
+
+			double distWidth = 0;
+			double distHeight = 0;
+			if (ulx > lrx)
+				distWidth = ulx - lrx;
+			else
+				distWidth = lrx - ulx;
+
+			if (uly > lry)
+				distHeight = uly - lry;
+			else
+				distHeight = lry - uly;
+
+			//Point2D pUL = new Point2D.Double(ulx, uly);
+			//Point2D pUR = new Point2D.Double(lrx, uly);
+			//Point2D pLR = new Point2D.Double(lrx, lry);
+			//double distWidth = controlPanel.getViewPort().distanceWorld(pUL, pUR);
+			//double distHeight = controlPanel.getViewPort().distanceWorld(pUR, pLR);
+			//double[] trans2Meter = MapContext.getDistanceTrans2Meter();
+			//distWidth = distWidth / trans2Meter[controlPanel.getViewPort().getDistanceUnits()];
+			//distHeight = distHeight / trans2Meter[controlPanel.getViewPort().getDistanceUnits()];
+			
+			return new double[]{distWidth, distHeight};
+		}
+
+		/**
+		 * A partir de la escala y la resoluci�n calcula el tama�o en pixels y los metros por pixel
+		 * @param scale Escala
+		 * @param resolution Resoluci�n
+		 */
+		private void calcSizeMtsPixel(double scale, int resolution){
+			if ((widthMts <= 0) || (heightMts <= 0) || (scale == 0)){
+				controlPanel.getTWidth().setValue("0");
+				controlPanel.getTHeight().setValue("0");
+				return;
+			}
+
+			//Calculo del tama�o de la imagen definitiva en pulgadas
+			double widthInches = (widthMts / scale) * MathUtils.INCHESMTR;
+			double heightInches = (heightMts / scale) * MathUtils.INCHESMTR;
+
+			//Ancho en pixeles = ppp * widthpulgadas
+			this.widthInPixels = (int) (resolution * widthInches);
+			this.heightInPixels = (int) (resolution * heightInches);
+
+			mtsPerPixel = (double)(widthMts / this.widthInPixels);
+			//double mtsPixelH = wc_altomts/altoPixels;
+
+			//recortamos a 5 decimales
+			mtsPerPixel = math.clipDecimals(mtsPerPixel, 5);
+
+			enableEventValueChanged = false;
+			controlPanel.getTMtsPixel().setValue(String.valueOf(mtsPerPixel));
+			enableEventValueChanged = true;
+			setCorrectMeasure(this.widthInPixels, controlPanel.getTWidth());
+			setCorrectMeasure(this.heightInPixels, controlPanel.getTHeight());
+
+		}
+
+		/**
+		 * A partir de los metros por pixel y la resoluci�n calcula el tama�o en pixels y la escala
+		 * @param mtsPixel Metros por pixel
+		 * @param resolution Resoluci�n
+		 */
+		private void calcSizeScale(double mtsPixel, int resolution){
+				//N�mero de p�xeles de ancho y alto
+			this.widthInPixels = (int)(widthMts / mtsPixel);
+			this.heightInPixels = (int)(heightMts / mtsPixel);
+
+			//Obtenemos los mts/pixel reales ya que el n�mero de pixeles es entero deben redondearse
+			mtsPerPixel = (double)(widthMts / widthInPixels);
+
+			//recortamos a 5 decimales
+			mtsPerPixel = math.clipDecimals(mtsPerPixel, 5);
+
+			//Obtenemos el ancho y alto en pulgadas
+			double widthInches = (double)(widthInPixels / Integer.parseInt(controlPanel.getCbResolution().getSelectedItem().toString()));
+//			double heightInches = (double)(heightInPixels / Integer.parseInt(controlPanel.getCbResolution().getSelectedItem().toString()));
+
+			//Calculo de la escala
+			int scale = (int)((widthMts * MathUtils.INCHESMTR) / widthInches);
+
+			controlPanel.getTScale().setValue(String.valueOf(scale));
+			controlPanel.getTMtsPixel().setValue(String.valueOf(mtsPerPixel));
+			setCorrectMeasure(widthInPixels, controlPanel.getTWidth());
+			setCorrectMeasure(heightInPixels, controlPanel.getTHeight());
+		}
+
+		/**
+		 * A partir del tama�o en pixels de la imagen y la resoluci�n calcula los metros por pixel y la escala
+		 * @param widthPixels	Ancho de la imagen en pixels
+		 * @param heightPixels	Alto de la imagen en pixels
+		 * @param resolution Resoluci�n
+		 */
+		private void calcScaleMtsPixel(double widthPixels, double heightPixels, int resolution){
+			this.widthInPixels = widthPixels;
+			this.heightInPixels = heightPixels;
+
+			//Obtenemos los mts/pixel reales ya que el n�mero de pixeles es entero deben redondearse
+			mtsPerPixel = (double)(widthMts / widthPixels);
+
+			//recortamos a 5 decimales
+			mtsPerPixel = math.clipDecimals(mtsPerPixel, 5);
+
+			//Obtenemos el ancho y alto en pulgadas
+			double widthInches = (double)(widthPixels / Integer.parseInt(controlPanel.getCbResolution().getSelectedItem().toString()));
+//			double heightInches = (double)(heightPixels / Integer.parseInt(controlPanel.getCbResolution().getSelectedItem().toString()));
+
+			//Calculo de la escala
+			int scale = (int)((widthMts * MathUtils.INCHESMTR) / widthInches);
+
+			controlPanel.getTScale().setValue(String.valueOf(scale));
+			controlPanel.getTMtsPixel().setValue(String.valueOf(mtsPerPixel));
+			setCorrectMeasure(widthPixels, controlPanel.getTWidth());
+			setCorrectMeasure(heightPixels, controlPanel.getTHeight());
+		}
+
+	/**
+	 * Controla cuando se cumplen todos los requisitos en el formulario para
+	 * poder activar el bot�n de aceptar.
+	 */
+	public void enableButtons() {
+		try {
+			if (Double.parseDouble(controlPanel.getTWidth().getValue()) == 0 ||
+				Double.parseDouble(controlPanel.getTHeight().getValue()) == 0 ||
+				controlPanel.getTWidth().getValue().equals("") ||
+				controlPanel.getTHeight().getValue().equals("") ||
+				this.fName == null || this.fName.equals("")) {
+				if (dialog != null)
+					dialog.getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY).setEnabled(false);
+				return;
+			}
+		} catch (NumberFormatException e) {
+			dialog.getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY).setEnabled(false);
+			return;
+		}
+
+		if (dialog != null)
+			dialog.getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY).setEnabled(true);
+	}
+
+	/**
+	 * Gestiona los eventos del cambio de escala de la imagen y lla apertura del
+	 * dialogo de selecci�n del nombre del fichero.
+	 */
+	public void actionPerformed(ActionEvent e) {
+		obj = e.getSource();
+
+		// Selector de Fichero sobre el cual se va a salvar a raster
+		if (obj.equals(controlPanel.getBSelect())) {
+			JFileChooser chooser = new JFileChooser("DATA_INPUT_LISTENER", JFileChooser.getLastPath("DATA_INPUT_LISTENER", null));
+			chooser.setDialogTitle(PluginServices.getText(this, "seleccionar_fichero"));
+			chooser.setAcceptAllFileFilterUsed(false);
+
+			// A�adimos las extensiones que hayan sido registradas en el driver
+			String[] extList = RasterLocator.getManager().getProviderServices().getDriversExtensions();
+			ExtendedFileFilter selectedFilter = null;
+			for (int i = 0; i < extList.length; i++) {
+				ExtendedFileFilter fileFilter = new ExtendedFileFilter(extList[i]);
+				chooser.addChoosableFileFilter(fileFilter);
+				if (extList[i].toLowerCase().equals("tif"))
+					selectedFilter = fileFilter;
+			}
+			if (selectedFilter != null)
+				chooser.setFileFilter(selectedFilter);
+
+			int returnVal = chooser.showOpenDialog(controlPanel);
+
+			if (returnVal == JFileChooser.APPROVE_OPTION) {
+				ExtendedFileFilter fileFilter = ((ExtendedFileFilter) chooser.getFileFilter());
+
+				fName = chooser.getSelectedFile().toString();
+				fName = fileFilter.getNormalizedFilename(chooser.getSelectedFile());
+				String ext = RasterLocator.getManager().getFileUtils().getExtensionFromFileName(fName);
+
+				controlPanel.getBProperties().setText(
+						PluginServices.getText(this, "props") + " " + RasterLocator.getManager().getProviderServices().getWriteDriverType(ext));
+
+				controlPanel.getBProperties().setEnabled(true);
+				controlPanel.getLFileName().setText(
+						fName.substring(fName.lastIndexOf(File.separator) + 1, fName.length()));
+
+				enableButtons();
+				JFileChooser.setLastPath("DATA_INPUT_LISTENER", chooser.getSelectedFile());
+			}
+		}
+
+		// Al variar las unidades recalculamos el ancho y el alto
+		if (e.getSource().equals(controlPanel.getCbMeasureType())) {
+			setCorrectMeasure(this.widthInPixels, controlPanel.getTWidth());
+			setCorrectMeasure(this.heightInPixels, controlPanel.getTHeight());
+		}
+
+		if (!obj.equals(controlPanel.getBSelect()))
+			this.recalcParams();
+
+		this.enableButtons();
+
+	}
+
+	/**
+	 * Devuelve el nombre del fichero seleccionado
+	 *
+	 * @return Nombre del fichero seleccionado
+	 */
+	public String getFileName() {
+		return fName;
+	}
+
+	/**
+	 * Pone a null el valor de la variable con el valor del fichero de texto.
+	 */
+	public void resetFileName() {
+		fName = null;
+		controlPanel.getLFileName().setText("");
+	}
+
+	public void mouseClicked(MouseEvent e) {
+		if ((obj.equals(controlPanel.getTHeight()) && e.getSource().equals(
+				controlPanel.getTWidth()))
+				|| (obj.equals(controlPanel.getTWidth()) && e.getSource()
+						.equals(controlPanel.getTHeight())))
+			return;
+		obj = e.getSource();
+		this.recalcParams();
+		enableButtons();
+	}
+
+	/**
+	 * Recalcula el tama�o de la imagen con los datos existentes y activa o
+	 * desactiva los botones.
+	 */
+	public void focusLost(FocusEvent e) {
+		obj = e.getSource();
+		this.recalcParams();
+		enableButtons();
+	}
+
+	/**
+	 * Activa o Desactiva los botones a trav�s de la funci�n que valida los
+	 * campos
+	 */
+	public void keyTyped(KeyEvent e) {
+		enableButtons();
+	}
+
+	/**
+	 * Activa o Desactiva los botones a trav�s de la funci�n que valida los
+	 * campos
+	 */
+	public void keyPressed(KeyEvent e) {
+		enableButtons();
+	}
+
+	/**
+	 * Activa o Desactiva los botones a trav�s de la funci�n que valida los
+	 * campos
+	 */
+	public void keyReleased(KeyEvent e) {
+		enableButtons();
+	}
+
+	/**
+	 * Obtiene la altura en pixels de la imagen de salida
+	 *
+	 * @return entero con la altura en pixels
+	 */
+	public double getHeightInPixels() {
+		return heightInPixels;
+	}
+
+	/**
+	 * Obtiene la anchura en pixels de la imagen de salida
+	 *
+	 * @return entero con la anchura en pixels
+	 */
+	public double getWidthInPixels() {
+		return widthInPixels;
+	}
+
+	/**
+	 * Asigna el valor de ancho en pixels
+	 * @param value double
+	 */
+	public void setWidthInPixels(double value) {
+		this.widthInPixels = value;
+	}
+
+	/**
+	 * Asigna el valor de alto en pixels
+	 * @param value double
+	 */
+	public void setHeightInPixels(double value) {
+		this.heightInPixels = value;
+	}
+
+	public void actionValueChanged(EventObject e) {
+		if(enableEventValueChanged) {
+			obj = e.getSource();
+			this.recalcParams();
+			enableButtons();
+		}
+	}
+
+	public void mouseExited(MouseEvent e) {}
+	public void mouseReleased(MouseEvent e) {}
+	public void mouseEntered(MouseEvent e) {}
+	public void mousePressed(MouseEvent e) {}
+	public void focusGained(FocusEvent e) {}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/listener/DataInputListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/listener/WriterPropertiesListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/listener/WriterPropertiesListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/listener/WriterPropertiesListener.java	(revision 8183)
@@ -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.tools.app.basic.tool.saveraster.ui.listener;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
+import org.gvsig.gui.beans.propertiespanel.PropertiesComponent;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.ui.property.WriterPropertiesDialog;
+
+
+/**
+ * Listener para el dialogo de propiedades de los escritores.
+ * 
+ * @version 24/04/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class WriterPropertiesListener implements ButtonsPanelListener {
+
+	private WriterPropertiesDialog dialog = null;
+	private Params params = null;
+	private PropertiesComponent pComp = null;
+	
+	/**
+	 * Constructor
+	 * @param dialog
+	 */
+	public WriterPropertiesListener(WriterPropertiesDialog dialog, Params params) {
+		this.dialog = dialog;
+		this.params = params;
+		this.pComp = dialog.getPropertiesPanel().getPropertiesComponent();
+		RasterToolsUtil.loadPropertiesFromWriterParams(pComp, params, null);
+	}
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener#actionButtonPressed(org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent)
+	 */
+	public void actionButtonPressed(ButtonsPanelEvent e) {
+		switch (e.getButton()) {
+		case ButtonsPanel.BUTTON_APPLY:
+			RasterToolsUtil.loadWriterParamsFromPropertiesPanel(pComp, params);
+			break;
+		case ButtonsPanel.BUTTON_ACCEPT:
+			RasterToolsUtil.loadWriterParamsFromPropertiesPanel(pComp, params);
+		case ButtonsPanel.BUTTON_CANCEL:
+			PluginServices.getMDIManager().closeWindow(dialog);
+			break;
+		}
+		
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/listener/WriterPropertiesListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/listener/SaveRasterDialogListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/listener/SaveRasterDialogListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/listener/SaveRasterDialogListener.java	(revision 8183)
@@ -0,0 +1,290 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.saveraster.ui.listener;
+
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.io.File;
+
+import javax.swing.JOptionPane;
+
+import org.gvsig.andami.PluginServices;
+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.datastruct.Params;
+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.fmap.geom.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
+import org.gvsig.gui.beans.propertiespanel.PropertiesPanel;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.mainplugin.config.Configuration;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.operation.RasterizerLayer;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.operation.SaveRasterActions;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.operation.SaveRasterProcess;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.ui.SaveRasterDialog;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.ui.SaveRasterPanel;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.ui.property.WriterPropertiesDialog;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Clase que gestiona los eventos de los botones del dialogo de Salvar a raster.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class SaveRasterDialogListener implements ButtonsPanelListener {
+	private static final GeometryManager 	geomManager	= GeometryLocator.getGeometryManager();
+	private Logger                          log         = LoggerFactory.getLogger(SaveRasterDialogListener.class);
+	private SaveRasterDialog 				dialog 		= null;
+	private FLayers							layers		= null;
+	private MapControl						mapCtrl 	= null;
+	private RasterWriter                    writer 		= null;
+
+	/**
+	 * Constructor
+	 * @param dialog
+	 */
+	public SaveRasterDialogListener(SaveRasterDialog dialog, FLayers layers, MapControl mapCtrl) {
+		this.dialog = dialog;
+		this.layers = layers;
+		this.mapCtrl = mapCtrl;
+
+		dialog.addButtonPressedListener(this);
+
+		//Captura de eventos para el bot�n de propiedades
+		(dialog.getControlsPanel()).getBProperties().addActionListener(new java.awt.event.ActionListener() {
+			public void actionPerformed(java.awt.event.ActionEvent evt) {
+				propsButtonActionPerformed(evt);
+			}
+		});
+	}
+
+	/**
+	 * Eventos para los botones de aplicar, aceptar y cancelar
+	 * @param e
+	 */
+	public void actionButtonPressed(ButtonsPanelEvent e) {
+		switch (e.getButton()) {
+		case ButtonsPanel.BUTTON_APPLY:
+			acceptButtonActionPerformed(e);
+			break;
+		case ButtonsPanel.BUTTON_CLOSE:
+			dialog.closeJDialog();
+			break;
+		}
+	}
+
+	/**
+	 * Acciones realizadas al aceptar.
+	 * @param e
+	 * @return true si se ha completado la operaci�n de escritura y false si no se ha hecho
+	 */
+	private boolean acceptButtonActionPerformed(ButtonsPanelEvent e) {
+		SaveRasterPanel controlPanel = dialog.getControlsPanel();
+
+		String fName = dialog.getDataInputListener().getFileName();
+		Dimension dimension = new Dimension((int)dialog.getDataInputListener().getWidthInPixels(),
+				(int)dialog.getDataInputListener().getHeightInPixels() );
+
+		//Limitamos el tama�o
+		if(dialog.getDataInputListener().getWidthInPixels() > 20000 || dialog.getDataInputListener().getHeightInPixels() > 20000) {
+			if(!RasterSwingLibrary.messageBoxYesOrNot("output_file_too_big", null))
+				return false;
+		}
+		
+		//Comprobamos que el en la ruta de destino tengamos permisos de escritura
+		File f = new File(fName);
+		if(f.exists())
+			if(!RasterSwingLibrary.messageBoxYesOrNot("raster_error_file_exists", dialog))
+				return false;
+
+		f = new File(fName.substring(0, fName.lastIndexOf(File.separator)));
+
+		if(f.exists() && f.isDirectory() && !f.canWrite()) {
+			RasterSwingLibrary.messageBoxError("error_file_not_writable", dialog);
+			return false;
+		}
+
+		dialog.getDataInputListener().resetFileName();
+		dialog.getDataInputListener().enableButtons();
+
+		double lrX = Double.parseDouble(controlPanel.getTInfDerX().getValue());
+		double lrY = Double.parseDouble(controlPanel.getTInfDerY().getValue());
+		double ulX = Double.parseDouble(controlPanel.getTSupIzqX().getValue());
+		double ulY = Double.parseDouble(controlPanel.getTSupIzqY().getValue());
+		/*double width = 0;
+		if(ulX > lrX) width = (ulX - lrX);
+		else width = (lrX - ulX);
+		double height = 0;
+		if(ulY > lrY) height = (ulY - lrY);
+		else height = (lrY - ulY);*/
+		Envelope ext = null;
+
+		try{
+			ext = geomManager.createEnvelope(ulX, lrY, lrX, ulY, SUBTYPES.GEOM2D);
+		}catch(CreateEnvelopeException e1){
+			log.debug("Error creating the envelope", null, e1);
+		}
+		
+		// Controlamos el tama�o en caso de un jpeg2000
+		long bytes = RasterLocator.getManager().getRasterUtils().getBytesFromRaster((int)dimension.getWidth(),
+				(int)dimension.getHeight(), 0, 3);	
+		
+		long maxJp2 = 13000 * 12500 * 3;
+		if (fName.endsWith(".jp2")) {
+			if (bytes > maxJp2) {
+				if(!RasterSwingLibrary.messageBoxYesOrNot("output_file_too_big_jpeg2000", null))
+					return false;
+			}
+		}
+		
+		
+		Params params = getWriterParams(fName);
+		int blockSize = getBlockSize(params, layers);
+
+		ViewPort viewPort = new ViewPort(mapCtrl.getViewPort().getProjection());
+		viewPort.setBackColor(mapCtrl.getViewPort().getBackColor());
+		viewPort.setImageSize(dimension);
+		viewPort.setEnvelope(ext);
+
+		//Creamos el servidor de datos de la vista
+		RasterizerLayer rasterizerLayer = new RasterizerLayer(layers, viewPort, blockSize);
+
+		//Creamos la clase con el proceso y lo lanzamos
+		SaveRasterProcess saveRasterProcess = new SaveRasterProcess();
+		saveRasterProcess.setActions(new SaveRasterActions());
+		saveRasterProcess.addParam("viewport", viewPort);
+		saveRasterProcess.addParam("dimension", dimension);
+		saveRasterProcess.addParam("rasterizerlayer", rasterizerLayer);
+		saveRasterProcess.addParam("filename", fName);
+		saveRasterProcess.addParam("writerparams", params);
+		saveRasterProcess.start();
+
+		return true;
+	}
+
+	/**
+	 * Funci�n a ejecutar cuando se pulsa el bot�n de propiedades.
+	 * @param e ActionEvent
+	 */
+	private void propsButtonActionPerformed(ActionEvent e){
+		String name = dialog.getDataInputListener().getFileName();
+
+		//Si no se ha seleccionado ning�n fichero salimos
+		if(name == null || name.equals(""))
+			return;
+
+		Params params = getWriterParams(name);
+		PropertiesPanel panel = new PropertiesPanel();
+		WriterPropertiesDialog dialog = new WriterPropertiesDialog(panel, params);
+		PluginServices.getMDIManager().addWindow(dialog);
+	}
+
+	/**
+	 * Obtiene los par�metros del driver de escritura. Si el driver no se ha creado a�n se obtienen
+	 * unos par�metros con la inicializaci�n por defecto. Si se ha creado ya y se han modificado se
+	 * devuelven los par�metros con las modificaciones. Si se cambia de driver se devolver� un WriterParams
+	 * como si fuera la primera vez que se abre.
+	 * @param name Nombre del fichero sobre el que se salva.
+	 * @return WriterParams
+	 */
+	private Params getWriterParams(String name) {
+		RasterManager rManager = RasterLocator.getManager();
+		String ext = rManager.getFileUtils().getExtensionFromFileName(name);
+		try {
+			if(writer == null) //La primera vez que se obtiene el driver
+				writer = rManager.createWriter(name);
+			else {
+				String newType = rManager.getProviderServices().getWriteDriverType(ext);
+				String oldType = writer.getDriverName();
+				if(!newType.equals(oldType))  //Cambio de driver despu�s de haber seleccionado y modificado las propiedades de uno
+					writer = rManager.createWriter(name);
+			}
+
+			if(writer == null)
+				JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), PluginServices.getText(this, "no_driver_escritura"));
+
+			return writer.getParams();
+
+		} catch (NotSupportedExtensionException e1) {
+			JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), PluginServices.getText(this, "no_driver_escritura"));
+			return null;
+		} catch (RasterDriverException e1) {
+			JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), PluginServices.getText(this, "no_driver_escritura"));
+			return null;
+		}
+	}
+
+	/**
+	 * Calculo del tama�o de bloque. Para ello comprueba si el raster est� siendo tileado. Si est� siendo
+	 * tileado se aplica el alto del tile menor para no pedir un bloque mayor que lo que un servidor puede
+	 * devolver. Si no est� siendo tileado se devuelve el tama�o de bloque de los par�metros.
+	 * @param flyrs Capas
+	 * @param params Par�metros del driver de escritura
+	 * @return tama�o de bloque
+	 */
+	private int getBlockSize(Params params, FLayers flyrs) {
+
+		int blockSize = Configuration.getValue("cache_blockheight", Integer.valueOf(RasterLibrary.blockHeight)).intValue();
+		blockSize = RasterLibrary.blockHeight;
+
+		//Recorremos todas las capas comprobando si alguna de ellas implementa RasterOperations y tilea.
+		//En ese caso se obtiene el ancho de bloque. El ancho de bloque total ser� el menor obtenido.
+		//Esto lo hacemos para que las capas que tilean WebMapService, WebCoverageService, ... no hagan demasiadas peticiones al servidor
+		//por tener un ancho de bloque muy peque�o de modo que el ancho del bloque se ajuste al Tile menor
+		//soportado por los servidores que intervienen en el salvado.
+		int[] wBlock = null;
+		boolean isTiling = false;
+		int block = Integer.MAX_VALUE;
+		for(int i = 0; i < flyrs.getLayersCount(); i++)
+			if(flyrs.getLayer(i) instanceof FLyrRaster)
+				if(((FLyrRaster)flyrs.getLayer(i)).isTiled()){
+					wBlock = ((FLyrRaster)flyrs.getLayer(i)).getTileSize();
+					if((wBlock[0] - 1)< block){
+						block = wBlock[0] - 1;
+						isTiling = true;
+					}
+				}
+		if(isTiling) {
+			params.changeParamValue("blocksize", String.valueOf(block));
+			return block;
+		}
+
+		return blockSize;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/listener/SaveRasterDialogListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/listener/MethodSelectorListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/listener/MethodSelectorListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/listener/MethodSelectorListener.java	(revision 8183)
@@ -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.tools.app.basic.tool.saveraster.ui.listener;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+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 javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+import org.gvsig.raster.tools.app.basic.tool.saveraster.ui.panel.MethodSelectorPanel;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.ui.panel.SelectionParamsPanel;
+
+/**
+ * Listener para la gesti�n del m�todo de selecci�n del tama�o de la salida. Este
+ * listener se encarga de que cuando se varia el JRadioButton se activen y desactiven
+ * los controles correspondientes.
+ *  
+ * @version 18/04/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class MethodSelectorListener implements ActionListener, ChangeListener, MouseListener, FocusListener,
+KeyListener {
+
+	private SelectionParamsPanel            selectionParamsPanel = null;
+	private MethodSelectorPanel             methodSelectorPanel = null;
+		
+	/**
+	 * This is the default constructor
+	 */
+	public MethodSelectorListener(SelectionParamsPanel panel) {
+		this.selectionParamsPanel = panel;
+		methodSelectorPanel = panel.getSelectorPanel();
+		methodSelectorPanel.getRbScale().addActionListener(this);
+		methodSelectorPanel.getRbSize().addActionListener(this);
+		methodSelectorPanel.getRbMtsPixel().addActionListener(this);
+	}
+
+	//*******************************
+	//ChangeListener
+	
+	public void focusGained(FocusEvent e) {		
+	}
+
+	public void focusLost(FocusEvent e) {
+	}
+	
+	public void stateChanged(ChangeEvent e) {
+	}
+	
+	//*******************************
+	//MouseListener
+	public void mouseClicked(MouseEvent e) {
+	}
+
+	public void mouseEntered(MouseEvent e) {
+	}
+
+	public void mouseExited(MouseEvent e) {
+	}
+
+	public void mousePressed(MouseEvent e) {		
+	}
+
+	public void mouseReleased(MouseEvent e) {		
+	}
+
+	public void keyPressed(KeyEvent e) {		
+	}
+
+	public void keyReleased(KeyEvent e) {		
+	}
+
+	public void keyTyped(KeyEvent e) {		
+	}
+
+	//*******************************
+	//ActionListener
+	
+	public void actionPerformed(ActionEvent e) {
+		if(e.getSource() == methodSelectorPanel.getRbScale()) {
+			selectionParamsPanel.getInputScalePanel().setActiveScale(0);
+			selectionParamsPanel.getInputSizePanel().setActive(false);
+		}
+		
+		if(e.getSource() == methodSelectorPanel.getRbMtsPixel()) {
+			selectionParamsPanel.getInputScalePanel().setActiveScale(1);
+			selectionParamsPanel.getInputSizePanel().setActive(false);
+		}
+		
+		if(e.getSource() == methodSelectorPanel.getRbSize()) {
+			selectionParamsPanel.getInputScalePanel().setActiveScale(2);
+			selectionParamsPanel.getInputSizePanel().setActive(true);
+		}
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/listener/MethodSelectorListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/listener
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/SaveRasterDialog.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/SaveRasterDialog.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/SaveRasterDialog.java	(revision 8183)
@@ -0,0 +1,152 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.saveraster.ui;
+
+import java.awt.BorderLayout;
+import java.awt.Container;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.andami.ui.mdiManager.WindowInfo;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.defaultbuttonspanel.DefaultButtonsPanel;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.DriverProperties;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.ui.listener.DataInputListener;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.ui.listener.SaveRasterDialogListener;
+
+/**
+ * Panel que contiene los botones de Aceptar, Cancelar y Aplicar heredando de
+ * DefaultDialogPanel. Dentro de este estar� el panel con los controles de
+ * salvar a raster.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SaveRasterDialog extends DefaultButtonsPanel implements IWindow {
+	final private static long 			serialVersionUID = -3370601314380922368L;
+	private DataInputListener			listener =  null;
+	public DriverProperties				driverProps = null;
+	private SaveRasterPanel				controlsPanel = null;
+	private FLayers				 		layers = null;
+
+	/**
+	 * Constructor de la ventana de dialogo para gvSIG.
+	 */
+	public SaveRasterDialog(FLayers layers, MapControl mapCtrl) {
+		super(ButtonsPanel.BUTTONS_APPLYCLOSE);
+		driverProps = new DriverProperties();
+		this.layers = layers;
+		init(mapCtrl);
+	}
+
+	/**
+	 * Constructor generico para poder visualizar la ventana desde
+	 * una funci�n main.
+	 */
+	public SaveRasterDialog() {
+		super(ButtonsPanel.BUTTONS_NONE);
+			init(null);
+	}
+
+
+	/**
+	 * Inicializaci�n del panel.
+	 * @return void
+	 */
+	public void init(MapControl mapCtrl) {
+		setLayout(new BorderLayout());
+		add(getControlsPanel(), BorderLayout.CENTER);
+
+		if (layers != null && mapCtrl != null)
+			new SaveRasterDialogListener(this, layers, mapCtrl);
+
+		setSize(new java.awt.Dimension(405, 410));
+		getDataInputListener();
+
+		// Ocultamos el bot�n de aplicar
+		getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY).setEnabled(false);
+
+		setName("saveRaster");
+	}
+
+	/**
+	 * Cierra esta ventana a trav�s de andami
+	 */
+	public void closeJDialog() {
+		this.setVisible(false);
+		for(int i = 0; i < layers.getLayersCount(); i++){
+			layers.getLayer(i).getMapContext().invalidate();
+		}
+		PluginServices.getMDIManager().closeWindow(SaveRasterDialog.this);
+	}
+
+	/**
+	 * Obtiene el panel con los controles de Salvar a Raster.
+	 * @return
+	 */
+	public SaveRasterPanel getControlsPanel() {
+		if (controlsPanel == null) {
+			controlsPanel = new SaveRasterPanel();
+			controlsPanel.setPreferredSize(new java.awt.Dimension(379, 317));
+		}
+		return controlsPanel;
+	}
+
+	public DataInputListener getDataInputListener() {
+		if (listener == null) {
+			listener = new DataInputListener(getControlsPanel());
+			listener.setDialogPanel(this);
+		}
+		return listener;
+	}
+
+	/**
+	 * This method initializes jContentPane	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */    
+	public Container getContentPane() {
+		return this;
+	}
+
+	/**
+	 * Asigna la lista de capas
+	 * @param layers
+	 */
+	public void setLayerList(FLayers layers){
+		this.layers = layers;
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.IWindow#getWindowInfo()
+	 */
+	public WindowInfo getWindowInfo() {
+		WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODELESSDIALOG | WindowInfo.RESIZABLE);
+		m_viewinfo.setTitle(PluginServices.getText(this, "salvar_raster_geo"));
+		return m_viewinfo;
+	}
+
+	public Object getWindowProfile() {
+		return WindowInfo.PROPERTIES_PROFILE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/SaveRasterDialog.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/SaveRasterPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/SaveRasterPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/SaveRasterPanel.java	(revision 8183)
@@ -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.raster.tools.app.basic.tool.saveraster.ui;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.gui.beans.datainput.DataInputContainer;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.ui.panel.SelectFilePanel;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.ui.panel.SelectionParamsPanel;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.ui.panel.WCCoordsInputPanel;
+
+/**
+ * Panel General de salvar a raster.
+ * 
+ * 05/10/2007
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class SaveRasterPanel extends JPanel {
+	private static final long       serialVersionUID = 1L;
+	private WCCoordsInputPanel      wcCoordsPanel = null;
+	private SelectionParamsPanel    paramsPanel = null;
+	private SelectFilePanel         filePanel = null;
+	private ViewPort				viewPort = null;
+	  
+	/**
+	 * This is the default constructor
+	 */
+	public SaveRasterPanel() {
+		super();
+		initialize();
+	}
+	
+	/**
+	 * This method initializes this
+	 * 
+	 * @return void
+	 */
+	private void initialize() {
+		GridBagConstraints gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.weightx = 1.0;
+				
+		setLayout(new GridBagLayout());
+		
+		gridBagConstraints.gridy = 0;
+		add(getWCCoordsPanel(), gridBagConstraints);
+		
+		gridBagConstraints.weighty = 1.0;
+		gridBagConstraints.fill = GridBagConstraints.BOTH;
+		gridBagConstraints.gridy = 1;
+		add(getSelectionParamsPanel(), gridBagConstraints);
+		
+		gridBagConstraints.gridy = 2;
+		add(getSelectFilePanel(), gridBagConstraints);
+	}
+	
+	/**
+	 * Obtiene el panel de selecci�n de coordenadas
+	 * @return WCCoordsInputPanel
+	 */
+	public WCCoordsInputPanel getWCCoordsPanel() {
+		if(wcCoordsPanel == null)
+			wcCoordsPanel = new WCCoordsInputPanel();
+		return wcCoordsPanel;
+	}
+	
+	/**
+	 * Obtiene el panel de selecci�n de par�metros
+	 * @return SelectionParamsPanel
+	 */
+	public SelectionParamsPanel getSelectionParamsPanel() {
+		if(paramsPanel == null)
+			paramsPanel = new SelectionParamsPanel();
+		return paramsPanel;
+	}
+	
+	/**
+	 * Obtiene el panel de selecci�n de ficheros
+	 * @return SelectFilePanel
+	 */
+	public SelectFilePanel getSelectFilePanel() {
+		if(filePanel == null)
+			filePanel = new SelectFilePanel();
+		return filePanel;
+	}
+	
+//-------------------------------------------
+	/**
+	 * Obtiene la etiqueta del nombre de fichero seleccionado
+	 * return JLabel
+	 */
+	public JLabel getLFileName() {
+		return getSelectFilePanel().getLabelText();
+	}
+	
+	/**
+	 * Obtiene el bot�n de propiedades 
+	 * @return JButton
+	 */
+	public JButton getBProperties() {
+		return getSelectFilePanel().getBProperties();
+	}
+	
+	/**
+	 * Obtiene la entrada de texto correspondiente a la X de la esquina superior izquierda
+	 * @return DataInputContainer
+	 */
+	public DataInputContainer getTSupIzqX() {
+		return getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer11();
+	}
+	
+	/**
+	 * Obtiene la entrada de texto correspondiente a la Y de la esquina superior izquierda
+	 * @return DataInputContainer
+	 */
+	public DataInputContainer getTSupIzqY() {
+		return getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer12();
+	}
+	
+	/**
+	 * Obtiene la entrada de texto correspondiente a la X de la esquina inferior derecha
+	 * @return DataInputContainer
+	 */
+	public DataInputContainer getTInfDerX() {
+		return getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer21();
+	}
+	
+	/**
+	 * Obtiene la entrada de texto correspondiente a la Y de la esquina inferior derecha
+	 * @return DataInputContainer
+	 */
+	public DataInputContainer getTInfDerY() {
+		return getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer22();
+	}
+	
+	/**
+	 * Obtiene el bot�n de selecci�n de fichero 
+	 * @return JButton
+	 */
+	public JButton getBSelect() {
+		return getSelectFilePanel().getBSelect();
+	}
+		
+	/**
+	 * Obtiene la entrada de texto correspondiente al ancho
+	 * @return DataInputContainer
+	 */
+	public DataInputContainer getTWidth() {
+		return getSelectionParamsPanel().getInputSizePanel().getTWidth();
+	}
+	
+	/**
+	 * Obtiene la entrada de texto correspondiente al alto
+	 * @return DataInputContainer
+	 */
+	public DataInputContainer getTHeight() {
+		return getSelectionParamsPanel().getInputSizePanel().getTHeight();
+	}
+	
+	public JComboBox getCbMeasureType() {
+		return getSelectionParamsPanel().getInputSizePanel().getCbMeasureType();
+	}
+	
+	/**
+	 * Obtiene la entrada de texto correspondiente a la escala
+	 * @return DataInputContainer
+	 */
+	public DataInputContainer getTScale() {
+		return getSelectionParamsPanel().getInputScalePanel().getTScale();
+	}
+	
+	/**
+	 * Obtiene el combo que informa de la resoluci�n seleccionada
+	 * @return JComboBox
+	 */
+	public JComboBox getCbResolution() {
+		return getSelectionParamsPanel().getInputScalePanel().getCbResolution();
+	}
+	
+	/**
+	 * Obtiene la entrada de texto correspondiente a los metros por pixel
+	 * @return DataInputContainer
+	 */
+	public DataInputContainer getTMtsPixel() {
+		return getSelectionParamsPanel().getInputScalePanel().getTMtsPixel();
+	}
+	
+	/**
+	 * Obtiene el RadioButton correspondiente a la escala
+	 * @return JRadioButton
+	 */
+	public JRadioButton getRbScale() {
+		return getSelectionParamsPanel().getSelectorPanel().getRbScale();
+	}
+	
+	/**
+	 * Obtiene el RadioButton correspondiente a los metros por pixel
+	 * @return JRadioButton
+	 */
+	public JRadioButton getRbMtsPixel() {
+		return getSelectionParamsPanel().getSelectorPanel().getRbMtsPixel();
+	}
+	
+	/**
+	 * Obtiene el RadioButton correspondiente al tama�o
+	 * @return JRadioButton
+	 */
+	public JRadioButton getRbSize() {
+		return getSelectionParamsPanel().getSelectorPanel().getRbSize();
+	}
+	
+	/**
+	 * Sets the <code>ViewPort</code> 
+	 * @param vp <code>ViewPort</code>
+	 */
+	public void setViewPort(ViewPort vp) {
+		this.viewPort = vp;
+	}
+	
+	/**
+	 * Gets the <code>ViewPort</code>
+	 * @return <code>ViewPort</code>
+	 */
+	public ViewPort getViewPort() {
+		return viewPort;
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/SaveRasterPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/SelectFilePanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/SelectFilePanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/SelectFilePanel.java	(revision 8183)
@@ -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.tools.app.basic.tool.saveraster.ui.panel;
+
+import java.awt.FlowLayout;
+import java.awt.GridLayout;
+
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.gvsig.i18n.Messages;
+
+
+
+/**
+ * Panel con los botones de selecci�n de formato y fichero de salida y variaci�n
+ * de propiedades de guardado.
+ * 
+ * @version 18/04/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class SelectFilePanel extends JPanel {
+	private static final long serialVersionUID = 1L;
+	private JPanel pFileName = null;
+	private JPanel pButtons = null;
+	private JLabel lFileTag = null;
+	private JLabel lFileName = null;
+	private JButton bSelect = null;
+	private JButton bProperties = null;
+
+	/**
+	 * This is the default constructor
+	 */
+	public SelectFilePanel() {
+		super();
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 * 
+	 * @return void
+	 */
+	private void initialize() {
+		this.setLayout(new GridLayout(2, 1));
+		setBorder(javax.swing.BorderFactory.createTitledBorder(null, Messages.getText("file"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10), null));
+		this.add(getPanelLabel());
+		this.add(getPanelButtons());
+	}
+
+	/**
+	 * This method initializes jPanel	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	private JPanel getPanelLabel() {
+		if (pFileName == null) {
+			FlowLayout flowLayout1 = new FlowLayout();
+			flowLayout1.setHgap(1);
+			flowLayout1.setAlignment(java.awt.FlowLayout.LEFT);
+			flowLayout1.setVgap(2);
+			lFileName = new JLabel();
+			lFileName.setText("");
+			lFileTag = new JLabel();
+			lFileTag.setText(Messages.getText("file") + ":");
+			pFileName = new JPanel();
+			pFileName.setLayout(flowLayout1);
+			pFileName.setPreferredSize(new java.awt.Dimension(347,20));
+			pFileName.add(lFileTag, null);
+			pFileName.add(lFileName, null);
+		}
+		return pFileName;
+	}
+
+	/**
+	 * This method initializes jPanel1	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	public JPanel getPanelButtons() {
+		if (pButtons == null) {
+			FlowLayout flowLayout = new FlowLayout();
+			flowLayout.setAlignment(java.awt.FlowLayout.RIGHT);
+			flowLayout.setHgap(2);
+			flowLayout.setVgap(2);
+			pButtons = new JPanel();
+			pButtons.setLayout(flowLayout);
+			pButtons.setPreferredSize(new java.awt.Dimension(347,22));
+			pButtons.add(getBSelect(), null);
+			pButtons.add(getBProperties(), null);
+		}
+		return pButtons;
+	}
+
+	/**
+	 * This method initializes jButton	
+	 * 	
+	 * @return javax.swing.JButton	
+	 */
+	public JButton getBSelect() {
+		if (bSelect == null) {
+			bSelect = new JButton();
+			bSelect.setPreferredSize(new java.awt.Dimension(110,20));
+			bSelect.setText("Seleccionar");
+		}
+		return bSelect;
+	}
+
+	/**
+	 * This method initializes jButton1	
+	 * 	
+	 * @return javax.swing.JButton	
+	 */
+	public JButton getBProperties() {
+		if (bProperties == null) {
+			bProperties = new JButton();
+			bProperties.setPreferredSize(new java.awt.Dimension(160,20));
+			bProperties.setText("Propiedades GTiff");
+		}
+		return bProperties;
+	}
+
+	/**
+	 * Asigna el valor del texto de la etiqueta
+	 * @param text cadena con el texto
+	 */
+	public void setLabelText(String text){
+		lFileName.setText(text);
+	}
+	
+	/**
+	 * Obtiene el valor del texto de la etiqueta
+	 * @return text cadena con el texto
+	 */
+	public JLabel getLabelText(){
+		return lFileName;
+	}
+	
+	/**
+	 * Asigna el valor del texto de la etiqueta
+	 * @param text cadena con el texto
+	 */
+	public void setTag(String tag){
+		lFileTag.setText(tag);
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/SelectFilePanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/InputScaleDataPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/InputScaleDataPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/InputScaleDataPanel.java	(revision 8183)
@@ -0,0 +1,178 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.saveraster.ui.panel;
+
+import java.awt.FlowLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.gui.beans.datainput.DataInputContainer;
+
+
+/**
+ * Entrada de datos de Escala y tama�o por pixel.
+ * 
+ * @version 18/04/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class InputScaleDataPanel extends JPanel {
+	private static final long    serialVersionUID = 1L;
+	private JPanel               pResolution = null;
+	private JLabel               lResolution = null;
+	private DataInputContainer   inputMtsPixel = null;
+	private DataInputContainer   inputScale = null;
+	private JComboBox            cResolution = null;
+	
+	/**
+	 * This is the default constructor
+	 */
+	public InputScaleDataPanel() {
+		super();
+		initialize();
+		setActiveScale(0);
+	}
+
+	/**
+	 * This method initializes this
+	 * 
+	 * @return void
+	 */
+	private void initialize() {
+		setLayout(new GridBagLayout());
+
+		GridBagConstraints gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.insets = new Insets(5, 0, 0, 0);
+		gridBagConstraints.weightx = 1.0;
+		//gridBagConstraints.weighty = 1.0;		
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 0;
+		this.add(getTScale(), gridBagConstraints);
+		
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		this.add(getPResolution(), gridBagConstraints);
+		
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 2;
+		this.add(getTMtsPixel(), gridBagConstraints);
+	}
+
+	/**
+	 * Obtiene la entrada de datos de metros por pixel
+	 * @return DataInputContainer
+	 */
+	public DataInputContainer getTMtsPixel() {
+		if (inputMtsPixel == null) {
+			inputMtsPixel = new DataInputContainer(6);
+			inputMtsPixel.setLabelText(PluginServices.getText(this, "mtspixel"));
+		}
+		return inputMtsPixel;
+	}
+	
+	/**
+	 * Obtiene la entrada de datos de escala
+	 * @return DataInputContainer
+	 */
+	public DataInputContainer getTScale() {
+		if (inputScale == null) {
+			inputScale = new DataInputContainer(6);
+			inputScale.setLabelText(PluginServices.getText(this, "escale"));
+		}
+		return inputScale;
+	}
+	
+	/**
+	 * This method initializes jPanel1	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	private JPanel getPResolution() {
+		if (pResolution == null) {
+			FlowLayout flowLayout1 = new FlowLayout();
+			flowLayout1.setAlignment(java.awt.FlowLayout.RIGHT);
+			flowLayout1.setVgap(0);
+			flowLayout1.setHgap(0);
+			lResolution = new JLabel();
+			lResolution.setText(PluginServices.getText(this, "resolucion_espacial") + ":");
+			pResolution = new JPanel();
+			pResolution.setLayout(flowLayout1);
+			pResolution.add(lResolution, null);
+			pResolution.add(getCbResolution(), null);
+		}
+		return pResolution;
+	}
+
+	/**
+	 * This method initializes jComboBox	
+	 * 	
+	 * @return javax.swing.JComboBox	
+	 */
+	public JComboBox getCbResolution() {
+		if (cResolution == null) {
+			cResolution = new JComboBox();
+			cResolution.addItem(75 + "");
+			cResolution.addItem(150 + "");
+			cResolution.addItem(300 + "");
+			cResolution.addItem(600 + "");
+		}
+		return cResolution;
+	}
+
+	/**
+	 * Pone como activo el input scale o mts por pixel dependiendo del
+	 * valor del par�metro. 
+	 * @param active Si vale 0 activa la Escala y desactiva mts/pixel.
+	 * 	Si vale 1 activa mts/pixel y desactiva la Escala.
+	 * 	Si vale 2 desactiva ambos.
+	 */
+	public void setActiveScale(int active){
+		this.getCbResolution().setEnabled(true);
+		
+		if(active == 0){
+			getTScale().setControlEnabled(true);
+			getTMtsPixel().setControlEnabled(false);
+		}else if(active == 1){
+			getTScale().setControlEnabled(false);
+			getTMtsPixel().setControlEnabled(true);
+		}else if(active == 2){
+			getTScale().setControlEnabled(false);
+			getTMtsPixel().setControlEnabled(false);
+		}
+	}
+
+	/**
+	 * Obtiene la etiqueta de la Resoluci�n
+	 * @return
+	 */
+	public JLabel getLResolution() {
+		return lResolution;
+	}	
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/InputScaleDataPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/MethodSelectorPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/MethodSelectorPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/MethodSelectorPanel.java	(revision 8183)
@@ -0,0 +1,147 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.saveraster.ui.panel;
+
+import java.awt.BorderLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+
+/**
+ * Panel con el selector de m�todo de escalado. Por escala, tama�o de raster
+ * de salida o tama�o de pixel.
+ * 
+ * @version 18/04/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class MethodSelectorPanel extends JPanel {
+	private static final long           serialVersionUID = 1L;
+	private JPanel 			            pMethodSelector = null;
+	private JRadioButton 	            rbScale = null;
+	private JRadioButton 	            rbMtsPixel = null;
+	private JRadioButton 	            rbSize = null;
+	private ButtonGroup 	            group = null;
+	
+	/**
+	 * This is the default constructor
+	 */
+	public MethodSelectorPanel() {
+		super();
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 * 
+	 * @return void
+	 */
+	private void initialize() {
+		BorderLayout layout = new BorderLayout();
+		this.setLayout(layout);
+		setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray,1));
+		
+		group = new ButtonGroup();
+		this.add(getPMethodSelector(), BorderLayout.CENTER);
+	}
+
+	/**
+	 * This method initializes jPanel	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	public JPanel getPMethodSelector() {
+		if (pMethodSelector == null) {
+			pMethodSelector = new JPanel();
+			pMethodSelector.setLayout(new GridBagLayout());
+			pMethodSelector.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray,1));
+			pMethodSelector.setPreferredSize(new java.awt.Dimension(105,77));
+			group.add(getRbScale());
+			group.add(getRbMtsPixel());
+			group.add(getRbSize());
+			
+			GridBagConstraints gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+			gridBagConstraints.insets = new Insets(0, 5, 0, 5);
+			gridBagConstraints.weightx = 1.0;
+			gridBagConstraints.weighty = 1.0;
+			
+			gridBagConstraints.gridx = 0;
+			gridBagConstraints.gridy = 2;
+			pMethodSelector.add(getRbSize(), gridBagConstraints);
+			
+			gridBagConstraints.gridx = 0;
+			gridBagConstraints.gridy = 0;
+			pMethodSelector.add(getRbScale(), gridBagConstraints);
+			
+			gridBagConstraints.gridx = 0;
+			gridBagConstraints.gridy = 1;
+			pMethodSelector.add(getRbMtsPixel(), gridBagConstraints);
+		}
+		return pMethodSelector;
+	}
+
+	/**
+	 * This method initializes jRadioButton	
+	 * 	
+	 * @return javax.swing.JRadioButton	
+	 */
+	public JRadioButton getRbScale() {
+		if (rbScale == null) {
+			rbScale = new JRadioButton();
+			rbScale.setText("Escala");
+			rbScale.setSelected(true);
+		}
+		return rbScale;
+	}
+
+	/**
+	 * This method initializes jRadioButton1	
+	 * 	
+	 * @return javax.swing.JRadioButton	
+	 */
+	public JRadioButton getRbMtsPixel() {
+		if (rbMtsPixel == null) {
+			rbMtsPixel = new JRadioButton();
+			rbMtsPixel.setText("Mts/Pixel");
+		}
+		return rbMtsPixel;
+	}
+
+	/**
+	 * This method initializes jRadioButton2	
+	 * 	
+	 * @return javax.swing.JRadioButton	
+	 */
+	public JRadioButton getRbSize() {
+		if (rbSize == null) {
+			rbSize = new JRadioButton();
+			rbSize.setText("Tama�o");
+		}
+		return rbSize;
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/MethodSelectorPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/WCCoordsInputPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/WCCoordsInputPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/WCCoordsInputPanel.java	(revision 8183)
@@ -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.tools.app.basic.tool.saveraster.ui.panel;
+
+import java.awt.BorderLayout;
+
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.gui.beans.coordinatespanel.CoordinatesPanel;
+
+
+/**
+ * Panel para la selecci�n de coordenadas reales.
+ * 
+ * 04/10/2007
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class WCCoordsInputPanel extends JPanel {
+	private static final long serialVersionUID = 2294445086139039312L;
+	private CoordinatesPanel   coordinatesPanel   = null;
+	
+	/**
+	 * Constructor. Crea los paneles y a�adel el objeto CoordinatesPanel.
+	 */
+	public WCCoordsInputPanel() {
+		BorderLayout layout = new BorderLayout();
+		this.setLayout(layout);
+		setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this, "coordenadas_reales"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10), null));
+		
+		coordinatesPanel = new CoordinatesPanel(6);
+		this.add(coordinatesPanel);
+	}
+	
+	/**
+	 * Obtiene el panel con las coordenadas de la selecci�n en la vista
+	 * @return
+	 */
+	public CoordinatesPanel getCoordinatesPanel() {
+		return coordinatesPanel;
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/WCCoordsInputPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/SelectionParamsPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/SelectionParamsPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/SelectionParamsPanel.java	(revision 8183)
@@ -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.tools.app.basic.tool.saveraster.ui.panel;
+
+import java.awt.BorderLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.raster.tools.app.basic.tool.saveraster.ui.listener.MethodSelectorListener;
+
+
+/**
+ * Selecci�n de par�metros del cuadro de salvar a raster.
+ * 
+ * 04/10/2007
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class SelectionParamsPanel extends JPanel{
+	private static final long serialVersionUID = -5868836652528932347L;
+	private MethodSelectorPanel      selectorPanel = null;
+	private InputScaleDataPanel      inputScalePanel = null;
+	private InputSizePanel           inputSizePanel = null;
+	private JPanel                   northPanel = null;
+	private MethodSelectorListener   listener = null;
+	
+	/**
+	 * Constructor
+	 */
+	public SelectionParamsPanel() {
+		BorderLayout layout = new BorderLayout();
+		layout.setHgap(4);
+		layout.setVgap(4);
+		setLayout(layout);
+		add(getCenterPanel(), BorderLayout.CENTER);
+		add(getInputSizePanel(), BorderLayout.SOUTH);
+		setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this, "metodo"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("metodo", java.awt.Font.PLAIN, 10), null));
+		listener = new MethodSelectorListener(this);
+	}
+
+	/**
+	 * Obtiene el listener que controla el sincronismo entre los componentes
+	 * @return MethodSelectorListener
+	 */
+	public MethodSelectorListener getMethodSelectorListener() {
+		return listener;
+	}
+	
+	/**
+	 * Obtiene el panel con el selector de m�todo y la selecci�n
+	 * de escala
+	 * @return JPanel
+	 */
+	public JPanel getCenterPanel() {
+		if(northPanel == null) {
+			northPanel = new JPanel();
+			GridBagConstraints gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.insets = new Insets(0, 10, 0, 5);
+
+			northPanel.setLayout(new GridBagLayout());
+
+			gridBagConstraints.fill = GridBagConstraints.BOTH;
+			gridBagConstraints.weightx = 1.0;
+			gridBagConstraints.weighty = 1.0;
+			
+			gridBagConstraints.gridx = 0;
+			gridBagConstraints.gridy = 0;
+			northPanel.add(getSelectorPanel(), gridBagConstraints);
+
+			gridBagConstraints.gridx = 1;
+			gridBagConstraints.gridy = 0;
+			northPanel.add(getInputScalePanel(), gridBagConstraints);
+		}
+		return northPanel;
+	}
+
+	/**
+	 * Obtiene el panel con la selecci�n de escala y tama�o de pixel
+	 * @return InputScaleDataPanel
+	 */
+	public InputScaleDataPanel getInputScalePanel() {
+		if(inputScalePanel == null)
+			inputScalePanel = new InputScaleDataPanel();
+		return inputScalePanel;
+	}
+
+	/**
+	 * Obtiene el panel con la selecci�n de tama�o de salida
+	 * del raster
+	 * @return InputSizePanel
+	 */
+	public InputSizePanel getInputSizePanel() {
+		if(inputSizePanel == null)
+			inputSizePanel = new InputSizePanel();
+		return inputSizePanel;
+	}
+
+	/**
+	 * Obtiene el panel con el selector de m�todo de selecci�n. Por escala,
+	 * tama�o de pixel o tama�o de imagen
+	 * @return MethodSelectorPanel
+	 */
+	public MethodSelectorPanel getSelectorPanel() {
+		if(selectorPanel == null)
+			selectorPanel = new MethodSelectorPanel();
+		return selectorPanel;
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/SelectionParamsPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/InputSizePanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/InputSizePanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/InputSizePanel.java	(revision 8183)
@@ -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.tools.app.basic.tool.saveraster.ui.panel;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.JComboBox;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.gui.beans.datainput.DataInputContainer;
+
+
+/**
+ * Panel de entrada de datos de ancho y alto.
+ * @version 18/04/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class InputSizePanel extends JPanel {
+	private static final long  serialVersionUID = 1L;
+	private DataInputContainer inputWidth = null;
+	private DataInputContainer inputHeight = null;
+	private JComboBox          cbMeasureType = null;
+
+	/**
+	 * This is the default constructor
+	 */
+	public InputSizePanel() {
+		super();
+		initialize();
+		this.setActive(false);
+	}
+
+	/**
+	 * This method initializes this
+	 * 
+	 * @return void
+	 */
+	private void initialize() {
+		setLayout(new GridBagLayout());
+
+		GridBagConstraints gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.insets = new Insets(0, 0, 0, 5);
+		gridBagConstraints.fill = GridBagConstraints.BOTH;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.weighty = 1.0;
+		
+		add(getTWidth(), gridBagConstraints);
+		
+		gridBagConstraints.gridx = 1;
+		add(getTHeight(), gridBagConstraints);
+		
+		gridBagConstraints.gridx = 2;
+		add(getCbMeasureType(), gridBagConstraints);
+	}
+
+	/**
+	 * This method initializes jTextField	
+	 * 	
+	 * @return javax.swing.JTextField	
+	 */
+	public DataInputContainer getTWidth() {
+		if (inputWidth == null) {
+			inputWidth = new DataInputContainer();
+			inputWidth.setLabelText(PluginServices.getText(this, "ancho"));
+		}
+		return inputWidth;
+	}
+
+	/**
+	 * This method initializes jTextField1	
+	 * 	
+	 * @return javax.swing.JTextField	
+	 */
+	public DataInputContainer getTHeight() {
+		if (inputHeight == null) {
+			inputHeight = new DataInputContainer();
+			inputHeight.setLabelText(PluginServices.getText(this, "alto"));
+		}
+		return inputHeight;
+	}
+
+	/**
+	 * This method initializes jComboBox	
+	 * 	
+	 * @return javax.swing.JComboBox	
+	 */
+	public JComboBox getCbMeasureType() {
+		if (cbMeasureType == null) {
+			cbMeasureType = new JComboBox();
+			cbMeasureType.addItem("Pixels");
+			cbMeasureType.addItem("Cms");
+			cbMeasureType.addItem("Mms");
+			cbMeasureType.addItem("Mts");
+			cbMeasureType.addItem("Inches");
+		}
+		return cbMeasureType;
+	}
+
+	/**
+	 * Activa o desactiva las cajas de texto con los datos
+	 * ancho y alto.
+	 * @param active true activa los JTextBox y false los desactiva
+	 */
+	public void setActive(boolean active){		
+		this.getTWidth().setControlEnabled(active);
+		this.getTHeight().setControlEnabled(active);
+		this.getCbMeasureType().setEnabled(active);
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel/InputSizePanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui/panel
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster/ui
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveraster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveas/SaveAsTocMenuEntry.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveas/SaveAsTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveas/SaveAsTocMenuEntry.java	(revision 8183)
@@ -0,0 +1,315 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.saveas;
+import java.awt.Component;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.util.ArrayList;
+
+import javax.swing.Icon;
+import javax.swing.JOptionPane;
+import javax.swing.filechooser.FileFilter;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+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.Params;
+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.coverage.util.ProviderServices;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.gui.beans.propertiespanel.PropertiesComponent;
+import org.gvsig.gui.beans.swing.JFileChooser;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.algorithm.process.DataProcess;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.layers.ILayerState;
+import org.gvsig.raster.fmap.layers.IRasterLayerActions;
+import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.raster.process.ClippingProcess;
+import org.gvsig.raster.util.ExtendedFileFilter;
+
+
+/**
+ * <p>
+ * Entrada del TOC que corresponde con la opci�n "Salvar Como" de raster. Esta se apoya
+ * en el proceso de recorte de raster para salvar datos.
+ * </p>
+ * <p>
+ * Cuando se abre el dialogo de "Salvar como" se cargan las extensiones soportadas en el
+ * selector. Cada tipo de datos de la fuente soporta unas extensiones de escritura u otras.
+ * Por ejemplo, si la capa de entrada  es FLOAT no podremos escribir a JPG2000 porque no
+ * lo soporta, tendriamos que convertila primero a RGB.
+ * </p>
+ * <p>
+ * Cambiando el tipo de extensi�n en el selector cambian el panel de propiedades asociado.
+ * El fichero de salidad se salvar� con las propiedades ajustadas.
+ * </P>
+ * @version 30/05/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class SaveAsTocMenuEntry extends AbstractTocContextMenuAction implements PropertyChangeListener, IGenericToolBarMenuItem {
+	static private SaveAsTocMenuEntry singleton     = null;
+	private JFileChooser              chooser       = null;
+	private PropertiesComponent       panelProperty = null;
+
+	/**
+	 * Nadie puede crear una instancia a esta clase �nica, hay que usar el
+	 * getSingleton()
+	 */
+	private SaveAsTocMenuEntry() {}
+
+	/**
+	 * Devuelve un objeto unico a dicha clase
+	 * @return
+	 */
+	static public SaveAsTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new SaveAsTocMenuEntry();
+		return singleton;
+
+	}
+
+	public String getGroup() {
+		return "RasterExport";
+	}
+
+	public int getGroupOrder() {
+		return 50;
+	}
+
+	public int getOrder() {
+		return 1;
+	}
+
+	public String getText() {
+		return Messages.getText("saveas");
+	}
+
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof ILayerState))
+			return false;
+
+		if (!((ILayerState) selectedItems[0]).isOpen())
+			return false;
+
+		return true;
+	}
+
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof IRasterLayerActions))
+			return false;
+
+		return (((IRasterLayerActions) selectedItems[0]).isActionEnabled(IRasterLayerActions.SAVEAS));
+	}
+
+	public void execute(ITocItem item, FLayer[] selectedItems) {
+		FLayer lyr = null;
+		IWindow w = PluginServices.getMDIManager().getActiveWindow();
+		RasterManager rManager = RasterLocator.getManager();
+
+		if (selectedItems.length != 1)
+			return;
+
+		lyr = selectedItems[0];
+
+		if (!(lyr instanceof FLyrRaster))
+			return;
+		
+		FLyrRaster fLayer = (FLyrRaster)lyr;
+		
+		chooser = new JFileChooser("SAVE_AS_TOC_MENU_ENTRY",JFileChooser.getLastPath("SAVE_AS_TOC_MENU_ENTRY", null));
+		chooser.addPropertyChangeListener(this);
+		chooser.setDialogTitle(Messages.getText("seleccionar_fichero"));
+
+		// Cargamos las extensiones en la lista
+		ArrayList<String> extList = new ArrayList<String>();
+		try {
+			ProviderServices serv = rManager.getProviderServices();
+			extList = serv.getExtensionsSupported(fLayer.getDataStore().getDataType()[0], fLayer.getDataStore().getBandCount());
+		} catch (RasterDriverException e2) {
+			RasterSwingLibrary.messageBoxError("error_extensiones_soportadas", chooser, e2);
+			e2.printStackTrace();
+			return;
+		}
+
+		int selected_id = extList.size() - 1;
+		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;
+				selected_id = i;
+			}
+			chooser.addChoosableFileFilter(filter);
+		}
+		if (selected != null)
+			chooser.setFileFilter(selected);
+
+		// Cargamos el panel de propiedades en el selector
+		panelProperty = loadPanelProperties((String) extList.get(selected_id));
+		chooser.setAccessory(panelProperty);
+		chooser.setAcceptAllFileFilterUsed(false);
+
+		if (w instanceof AbstractViewPanel) {
+			if (chooser.showSaveDialog(((AbstractViewPanel) w).getComponent(0)) == JFileChooser.APPROVE_OPTION) {
+				// Creaci�n de par�metros
+				String tit = PluginServices.getMDIManager().getWindowInfo(w).getTitle();
+				RasterDataStore datastore = ((FLyrRaster)fLayer).getDataStore();
+				int[] drawableBands = new int[fLayer.getDataStore().getBandCount()];
+				for (int i = 0; i < fLayer.getDataStore().getBandCount(); i++)
+					drawableBands[i] = i;
+				JFileChooser.setLastPath("SAVE_AS_TOC_MENU_ENTRY", chooser.getCurrentDirectory());
+				String file =  ((ExtendedFileFilter) chooser.getFileFilter()).getNormalizedFilename(chooser.getSelectedFile());
+				
+				long bytes = rManager.getRasterUtils().getBytesFromRaster((int)fLayer.getDataStore().getWidth(),
+						(int) fLayer.getDataStore().getHeight(),
+						fLayer.getDataStore().getDataType()[0],
+						fLayer.getDataStore().getBandCount());
+				
+				long maxJp2 = 13000 * 12500 * 3;
+				if (bytes > (20000 * 20000 * 3)) {
+					if(!RasterSwingLibrary.messageBoxYesOrNot("output_file_too_big", null))
+						return;
+				}
+				
+				if(new File(file).exists()) {
+					if(!RasterSwingLibrary.messageBoxYesOrNot("raster_error_file_exists", null))
+						return;
+				}
+				
+				if (file.endsWith(".jp2")) {
+					if (bytes > maxJp2) {
+						if(!RasterSwingLibrary.messageBoxYesOrNot("output_file_too_big_jpeg2000", null))
+							return;
+					}
+				}
+				
+				if (!RasterToolsUtil.canWrite(chooser.getCurrentDirectory().toString()))
+					return;
+				Params params = null;
+				try {
+					params = rManager.createWriter(file).getParams();
+				} catch (NotSupportedExtensionException e1) {
+					RasterSwingLibrary.messageBoxError("no_driver_escritura", this, e1);
+				} catch (RasterDriverException e1) {
+					RasterSwingLibrary.messageBoxError("no_driver_escritura", this, e1);
+				}
+
+				// Lanzamiento del proceso de guardado
+				DataProcess clippingProcess = new ClippingProcess();
+				clippingProcess.setActions(new SaveAsActions());
+				clippingProcess.addParam("viewname", tit);
+				if(fLayer.isRemote()) {
+					Envelope env = ((AbstractViewPanel)w).getMapControl().getViewPort().getEnvelope();
+					clippingProcess.addParam("realcoordinates", new double[] { env.getMinimum(0), env.getMaximum(1), env.getMaximum(0), env.getMinimum(1)});
+					clippingProcess.addParam("resolution", new int[]{(int) fLayer.getDataStore().getWidth(),
+							 										 (int) fLayer.getDataStore().getHeight()});
+				} else {
+					clippingProcess.addParam("pixelcoordinates", new int[] { 0, (int) fLayer.getDataStore().getHeight(), (int) fLayer.getDataStore().getWidth(), 0 });
+					clippingProcess.addParam("resolution", new int[]{(int) fLayer.getDataStore().getWidth(),
+							 										 (int) fLayer.getDataStore().getHeight()});
+				}
+				int index = file.lastIndexOf(".");
+				if(index > 0) {
+					String suffix = file.substring(index, file.length());
+					if(suffix.length() == 4)
+						clippingProcess.addParam("suffix", suffix);
+				}
+				clippingProcess.addParam("filename", file);
+				clippingProcess.addParam("layer", fLayer.getDataStore());
+				clippingProcess.addParam("drawablebands", drawableBands);
+				clippingProcess.addParam("colorInterpretation", datastore.getColorInterpretation());
+				clippingProcess.addParam("onelayerperband", new Boolean(false));
+				clippingProcess.addParam("interpolationmethod", new Integer(Buffer.INTERPOLATION_NearestNeighbour));
+				clippingProcess.addParam("affinetransform", datastore.getAffineTransform());
+				clippingProcess.addParam("viewProjection", ((AbstractViewPanel) w).getMapControl().getProjection());
+
+				if (params != null)
+					RasterToolsUtil.loadWriterParamsFromPropertiesPanel(panelProperty, params);
+				clippingProcess.addParam("driverparams", params);
+				clippingProcess.start();
+			}
+		}
+	}
+
+	/**
+	 * Evento que se produce al cambiar el driver de escritura. Esto
+	 * sustituye el panel properties por el del nuevo driver seleccionado
+	 */
+	public void propertyChange(PropertyChangeEvent evt) {
+		if (evt.getNewValue() instanceof ExtendedFileFilter) {
+			String ext = ((ExtendedFileFilter) evt.getNewValue()).getExtensions().get(0).toString();
+			panelProperty = loadPanelProperties(ext);
+			chooser.setAccessory(panelProperty);
+			chooser.revalidate();
+		}
+	}
+
+	/**
+	 * Obtiene el objeto PropertiesComponent para una extensi�n concreta de fichero
+	 * sobre el que se va a escribir.
+	 * @param file Fichero raster sobre el que se escribir�
+	 * @return PropertiesComponent
+	 */
+	private PropertiesComponent loadPanelProperties(String file) {
+		PropertiesComponent panelProperty = new PropertiesComponent();
+		Params params = null;
+		try {
+			params = RasterLocator.getManager().createWriter(file).getParams();
+		} catch (NotSupportedExtensionException e1) {
+			JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), PluginServices.getText(this, "no_driver_escritura"));
+			return null;
+		} catch (RasterDriverException e1) {
+			JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), PluginServices.getText(this, "no_driver_escritura"));
+			return null;
+		}
+		RasterToolsUtil.loadPropertiesFromWriterParams(panelProperty, params, null);
+		return panelProperty;
+	}
+
+	public Icon getIcon() {
+		return IconThemeHelper.getImageIcon("layer-saveas");
+	}
+	
+	public boolean isEnableEvents() {
+		return true;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveas/SaveAsTocMenuEntry.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveas/SaveAsActions.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveas/SaveAsActions.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveas/SaveAsActions.java	(revision 8183)
@@ -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.tools.app.basic.tool.saveas;
+
+import org.gvsig.raster.algorithm.process.IProcessActions;
+import org.gvsig.raster.swing.RasterSwingLocator;
+/**
+ * Acciones que ejecuta el proceso de salvado.
+ *
+ * @version 26/09/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SaveAsActions implements IProcessActions {
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.IProcessActions#end(java.lang.Object)
+	 */
+	public void end(Object params) {
+		if (params instanceof Object[] &&
+				((Object[]) params).length == 2 &&
+				((Object[]) params)[0] instanceof String &&
+				((Object[]) params)[1] instanceof Long) {
+
+			String fName = (String) ((Object[]) params)[0];
+			long milis = ((Long) ((Object[]) params)[1]).longValue();
+
+			RasterSwingLocator.getSwingManager().showSummaryProcessDialog(fName, milis);
+		}
+	}
+
+	public void interrupted() {
+
+	}
+
+	public void updateProgress(int current, int total) {
+		
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveas/SaveAsActions.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/saveas
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/setviewprojection/SetViewProjectionTocMenuEntry.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/setviewprojection/SetViewProjectionTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/setviewprojection/SetViewProjectionTocMenuEntry.java	(revision 8183)
@@ -0,0 +1,114 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.setviewprojection;
+
+import javax.swing.Icon;
+
+import org.cresques.Messages;
+import org.cresques.cts.IProjection;
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.layers.IRasterLayerActions;
+import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SetViewProjectionTocMenuEntry extends AbstractTocContextMenuAction implements IGenericToolBarMenuItem {
+	static private SetViewProjectionTocMenuEntry singleton  = null;
+	FLayer lyr = null;
+
+	public String getGroup() {
+		return "GeoRaster";
+	}
+
+	public int getGroupOrder() {
+		return 10;
+	}
+
+	public int getOrder() {
+		return 20;
+	}
+
+	public String getText() {
+		return RasterToolsUtil.getText(this, "set_view_projection");
+	}
+	
+	/**
+	 * Devuelve un objeto unico a dicha clase
+	 * @return
+	 */
+	static public SetViewProjectionTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new SetViewProjectionTocMenuEntry();
+		return singleton;
+	}
+
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		return true;
+	}
+
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof IRasterLayerActions))
+			return false;
+
+		return ((IRasterLayerActions) selectedItems[0]).isActionEnabled(IRasterLayerActions.SELECT_LAYER);
+	}
+
+	/**
+	 * M�todo que se ejecuta cuando se pulsa la entrada en el men� contextual del TOC 
+	 * correspondiente a "Zoom a la resoluci�n del raster". Aqu� se crear� el mapTool si 
+	 * no se ha hecho antes y se cargar�.
+	 */
+	public void execute(ITocItem item, FLayer[] selectedItems) {
+		FLayer fLayer = null;
+
+		if (selectedItems.length != 1)
+			return;
+
+		fLayer = selectedItems[0];
+
+		if (!(fLayer instanceof FLyrRaster))
+			return;
+		FLyrRaster inputLayer = (FLyrRaster)fLayer;
+		
+		IProjection viewProjection = inputLayer.getMapContext().getProjection();
+		
+		if(RasterSwingLibrary.messageBoxYesOrNot(Messages.getText("overwrite_projection"), null)) {
+			inputLayer.setProjection(viewProjection);
+		}
+	}
+	
+	public Icon getIcon() {
+		return IconThemeHelper.getImageIcon("setviewprojection-raster-icon");
+	}
+	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/setviewprojection/SetViewProjectionTocMenuEntry.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/setviewprojection
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/rasterresolution/ZoomPixelCursorListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/rasterresolution/ZoomPixelCursorListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/rasterresolution/ZoomPixelCursorListener.java	(revision 8183)
@@ -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.tools.app.basic.tool.rasterresolution;
+
+import java.awt.Cursor;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.Toolkit;
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.messages.NotificationManager;
+import org.gvsig.fmap.dal.exception.ReadException;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.BehaviorException;
+import org.gvsig.fmap.mapcontrol.tools.Events.PointEvent;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.PointListener;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+
+/**
+ * Listener para la tool de zoom a la resoluci�n del raster. Este es el encargado de recibir
+ * la petici�n desde la vista y calcular las coordenadas del raster.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ZoomPixelCursorListener implements PointListener {
+	private static final GeometryManager 	geomManager 	= GeometryLocator.getGeometryManager();
+	private static final Logger 			logger 			= LoggerFactory.getLogger(ZoomPixelCursorListener.class);
+	private Image 					        img 			= null;
+	private Cursor 							cur 			= null;
+	private MapControl 						mapCtrl;
+
+
+	/**
+	 * Constructor. Asigna el MapControl
+	 * @param mc
+	 */
+	public ZoomPixelCursorListener(MapControl mc) {
+		this.mapCtrl = mc;
+	}
+
+	/**
+	 * Evento de selecci�n de punto sobre la vista. Aquin se calcular�n las coordenadas
+	 * y dimensiones de la petici�n centrando la petici�n en el punto pinchado en la vista.
+	 */
+	@SuppressWarnings("deprecation")
+	public void point(PointEvent event) throws BehaviorException {
+		Point2D pReal = mapCtrl.getMapContext().getViewPort().toMapPoint(event.getPoint());
+		//Point imagePoint = new Point((int) event.getPoint().getX(), (int) event.getPoint().getY());
+		ViewPort v = mapCtrl.getMapContext().getViewPort();
+
+		FLayer[] actives = mapCtrl.getMapContext().getLayers().getActives();
+		Envelope ext = null;
+		try {
+			ext = actives[0].getFullEnvelope();
+		} catch (ReadException e1) {
+			NotificationManager.addError("Error al obtener el extent", e1);
+		}
+
+		ArrayList<Object> attr = ((FLyrRaster)actives[0]).getAttributes();
+		int width = 0, height = 0;
+		for (int i=0; i<attr.size(); i++) {
+			Object[] a = (Object []) attr.get(i);
+			if (a[0].toString().equals("Width"))
+				width = ((Integer)a[1]).intValue();
+			if (a[0].toString().equals("Height"))
+				height = ((Integer)a[1]).intValue();
+		}
+
+
+		if(	ext != null &&
+				width != 0 &&
+				height != 0){
+
+			double wcOriginCenterX = pReal.getX();
+			double wcOriginCenterY = pReal.getY();
+
+			//Hallamos la relaci�n entre el pixel y las WC a partir de la imagen de la capa
+			double relacionPixelWcWidth =  (ext.getMaximum(0) - ext.getMinimum(0))/width;
+			double relacionPixelWcHeight = (ext.getMaximum(1) - ext.getMinimum(1))/height;
+			//double desplazamientoX = ext.getMinX();
+			//double desplazamientoY = ext.getMinY();
+
+			double wcOriginX = wcOriginCenterX - ((v.getImageWidth()*relacionPixelWcWidth)/2);
+			double wcOriginY = wcOriginCenterY - ((v.getImageHeight()*relacionPixelWcHeight)/2);
+
+			double wcDstMinX = wcOriginX;
+			double wcDstMinY = wcOriginY;
+			double wcDstMaxX = wcDstMinX + (v.getImageWidth()*relacionPixelWcWidth);
+			double wcDstMaxY = wcDstMinY + (v.getImageHeight()*relacionPixelWcHeight);
+
+			double wcDstWidth = wcDstMaxX - wcDstMinX;
+			double wcDstHeight = wcDstMaxY - wcDstMinY;
+
+			try {
+				ext = geomManager.createEnvelope(wcDstMinX, wcDstMinY, wcDstMinX
+						+ wcDstWidth, wcDstMinY + wcDstHeight, SUBTYPES.GEOM2D);
+			} catch (CreateEnvelopeException e) {
+				logger.error("Error creating the Envelope", e);
+			}
+			mapCtrl.getMapContext().getViewPort().setEnvelope(ext);
+		}
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#getCursor()
+	 */
+	public Cursor getCursor() {
+		if(cur == null)
+			cur = Toolkit.getDefaultToolkit().createCustomCursor(getImageCursor(), new Point(16, 16), "");
+		return cur;
+	}
+
+	public boolean cancelDrawing() {
+		return false;
+	}
+
+	public void pointDoubleClick(PointEvent event) throws BehaviorException {
+
+	}
+
+	public Image getImageCursor() {
+		if(img == null)
+			img = IconThemeHelper.getImage("zoom-pixel-cursor");
+		return img;
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/rasterresolution/ZoomPixelCursorListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/rasterresolution/ZoomPixelCursorTocMenuEntry.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/rasterresolution/ZoomPixelCursorTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/rasterresolution/ZoomPixelCursorTocMenuEntry.java	(revision 8183)
@@ -0,0 +1,147 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.rasterresolution;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.app.project.Project;
+import org.gvsig.app.project.ProjectManager;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.app.project.documents.view.toolListeners.StatusBarListener;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseMovementBehavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.PointBehavior;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.layers.ILayerState;
+import org.gvsig.raster.fmap.layers.IRasterLayerActions;
+
+
+/**
+ * Entrada de men� para la activaci�n de la funcionalidad de zoom a un
+ * pixel centrado en el cursor.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ZoomPixelCursorTocMenuEntry extends AbstractTocContextMenuAction {
+	private static ZoomPixelCursorTocMenuEntry  singleton              = null;
+	public static final int                     ZOOM_TO_IMAGE_CENTER   = 0x1;
+	public static final int                     ZOOM_TO_VIEW_CENTER    = 0x2;
+	public int                                  zoomType               = ZOOM_TO_VIEW_CENTER;
+
+	/**
+	 * Gets a unique object of this class
+	 * @return
+	 */
+	public static ZoomPixelCursorTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new ZoomPixelCursorTocMenuEntry();
+		return singleton;
+
+	}
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see com.iver.cit.gvsig.project.documents.IContextMenuAction#getGroup()
+	 */
+	public String getGroup() {
+		return "group2"; //FIXME
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see com.iver.cit.gvsig.project.documents.IContextMenuAction#getGroupOrder()
+	 */
+	public int getGroupOrder() {
+		return 20;
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see com.iver.cit.gvsig.project.documents.IContextMenuAction#getOrder()
+	 */
+	public int getOrder() {
+		return 2;
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see com.iver.cit.gvsig.project.documents.IContextMenuAction#getText()
+	 */
+	public String getText() {
+		return PluginServices.getText(this, "Zoom_pixel");
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see com.iver.cit.gvsig.project.documents.view.toc.AbstractTocContextMenuAction#isEnabled(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
+	 */
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		if(getNodeLayer(item) instanceof ILayerState)
+			if(!((ILayerState)getNodeLayer(item)).isOpen()) 
+				return false;
+		return true;
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see com.iver.cit.gvsig.project.documents.view.toc.AbstractTocContextMenuAction#isVisible(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
+	 */
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		if (isTocItemBranch(item)) {
+			if(selectedItems == null || selectedItems.length != 1)
+				return false;
+			if((getNodeLayer(item) instanceof IRasterLayerActions) && 
+			   ((IRasterLayerActions)getNodeLayer(item)).isActionEnabled(IRasterLayerActions.ZOOM_PIXEL_RESOLUTION))
+				return getNodeLayer(item) instanceof FLyrRaster;
+		}
+		return false;
+
+	}
+
+	/**
+	 * M�todo que se ejecuta cuando se pulsa la entrada en el men� contextual del TOC 
+	 * correspondiente a "Zoom a la resoluci�n del raster". Aqu� se crear� el mapTool si 
+	 * no se ha hecho antes y se cargar�.
+	 */
+	public void execute(ITocItem item, FLayer[] selectedItems) {
+		if(selectedItems.length == 1) {
+	        AbstractViewPanel vista = (AbstractViewPanel) PluginServices.getMDIManager().getActiveWindow();
+	    	MapControl mapCtrl = vista.getMapControl();
+	    	//Si no se ha cargado el listener a�n lo cargamos.
+	        if(mapCtrl.getNamesMapTools().get("zoom_pixel_cursor_SE") == null) {
+		        //Crea el listener del zoom a la resoluci�n del raster
+	        	StatusBarListener sbl = new StatusBarListener(mapCtrl);
+		        ZoomPixelCursorListener zp = new ZoomPixelCursorListener(mapCtrl);
+		        mapCtrl.addBehavior("zoom_pixel_cursor_SE", new Behavior[]{
+		        					new PointBehavior(zp), new MouseMovementBehavior(sbl)});
+	        }
+	    	mapCtrl.setTool("zoom_pixel_cursor_SE");
+	    	//Project project = ((ProjectExtension)PluginServices.getExtension(ProjectExtension.class)).getProject();
+			Project project = ProjectManager.getInstance().getCurrentProject();
+			project.setModified(true);
+
+		}
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/rasterresolution/ZoomPixelCursorTocMenuEntry.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/rasterresolution
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/FilterListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/FilterListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/FilterListener.java	(revision 8183)
@@ -0,0 +1,381 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2006 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.tools.app.basic.tool.filter;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.EventObject;
+import java.util.Hashtable;
+import java.util.List;
+
+import javax.swing.ListModel;
+
+import org.gvsig.andami.PluginServices;
+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.exception.FilterManagerException;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.FilterUIListener;
+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.RegistrableFilterListener;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.gui.beans.propertiespanel.PropertiesComponent;
+import org.gvsig.gui.beans.propertiespanel.PropertiesComponentListener;
+import org.gvsig.gui.beans.propertiespanel.PropertyStruct;
+import org.gvsig.gui.beans.treelist.event.TreeListChangeEvent;
+import org.gvsig.gui.beans.treelist.event.TreeListEvent;
+import org.gvsig.gui.beans.treelist.listeners.TreeListChangeListener;
+import org.gvsig.gui.beans.treelist.listeners.TreeListComponentListener;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.raster.bean.previewbase.ParamStruct;
+import org.gvsig.raster.tools.app.basic.raster.process.FilterProcess;
+import org.gvsig.raster.tools.app.basic.raster.process.IProcessActions;
+import org.gvsig.raster.tools.app.basic.tool.filter.ui.FilterPanel;
+import org.gvsig.raster.util.RasterNotLoadException;
+
+/**
+ * <code>FilterListener</code> es la clase donde se procesar� gran parte del
+ * c�digo que controla el panel para el manejo de un layer en la aplicaci�n de
+ * filtros.
+ *
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public class FilterListener implements ActionListener, TreeListComponentListener, TreeListChangeListener, PropertiesComponentListener, FilterUIListener, IProcessActions {
+	private FilterPanel               filterPanel  = null;
+	private int                       actualParam  = -1;
+	private ArrayList<ParamStruct>    paramsList   = new ArrayList<ParamStruct>();
+
+	/**
+	 * Construye un FilterListener especificando el FilterPanel asociado
+	 * @param filterDialog
+	 */
+	public FilterListener(FilterPanel filterPanel) {
+		this.filterPanel = filterPanel;
+	}
+	
+	/**
+	 * Asignamos los valores del PropertiesComponent al Params seleccionado
+	 */
+	@SuppressWarnings("unchecked")
+	public void refreshDataProperties() {
+		if (actualParam == -1)
+			return;
+
+		ArrayList<PropertyStruct> listValues = getFilterPanel().getPropertiesComponent().getValues();
+
+		Params params = ((ParamStruct) paramsList.get(actualParam)).getFilterParam();
+		for (int j = 0; j < listValues.size(); j++) {
+			PropertyStruct ps = (PropertyStruct) listValues.get(j);
+			params.changeParamValue(ps.getKey(), ps.getNewValue());
+		}
+	}
+
+	/**
+	 * Obtener la posici�n del Param seleccionado en el ArrayList
+	 * @param filterName
+	 * @return
+	 */
+	private int getParamSelected(String filterName) {
+		for (int i = 0; i < paramsList.size(); i++) {
+			if (((ParamStruct) paramsList.get(i)).getFilterName().equals(filterName))
+				return i;
+		}
+		return -1;
+	}
+
+	/**
+	 * Cambiar el panel de propiedades central por el nuevo panel, segun el filtro
+	 * seleccionado que se pasa por par�metro.
+	 * @param filter
+	 */
+	public void changePanel(String filter) {
+		int posParam = getParamSelected(filter);
+
+		refreshDataProperties();
+		actualParam = posParam;
+
+		PropertiesComponent propertiesComponent = new PropertiesComponent();
+
+		if (posParam != -1) {
+			Params params = ((ParamStruct) paramsList.get(actualParam)).getFilterParam();
+			if (params != null) {
+				Param paramPanel = params.getParamById("Panel");
+				if(	paramPanel != null && 
+					paramPanel.getDefaultValue() instanceof RegistrableFilterListener)
+					((RegistrableFilterListener)paramPanel.getDefaultValue()).addFilterUIListener(this);
+				RasterToolsUtil.loadPropertiesFromWriterParams(propertiesComponent, params, new String[]{"FilterName"});
+			}
+		}
+		getFilterPanel().setNewPropertiesComponent(propertiesComponent, filter);
+	}
+
+	/**
+	 * A�adir un nuevo Params a la lista de Params que podemos manejar. Un Params
+	 * equivale a un filtro cargado. El hecho de trabajar con Params y no con
+	 * filtros, simplifica totalmente el panel. Sin tener que depender de los
+	 * filtros nada m�s que para el momento de dibujado o guardado.
+	 * @param name
+	 * @param params
+	 * @param classFilter
+	 */
+	public void addNewParam(String name, Params params, Class<?> classFilter) {
+		ParamStruct param = new ParamStruct();
+		param.setFilterName(name);
+		param.setFilterParam(params);
+		param.setFilterClass(classFilter);
+		paramsList.add(param);
+	}
+
+	public void actionChangeProperties(EventObject e) {
+		refreshDataProperties();
+		getFilterPanel().refreshPreview();
+	}
+
+	public void actionChangeSelection(TreeListChangeEvent e) {
+		changePanel(e.getItem());
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		getFilterPanel().refreshPreview();
+	}
+
+	public void elementAdded(TreeListEvent e) {
+		getFilterPanel().refreshPreview();
+	}
+
+	public void elementMoved(TreeListEvent e) {
+		getFilterPanel().refreshPreview();
+	}
+
+	public void elementRemoved(TreeListEvent e) {
+		getFilterPanel().refreshPreview();
+	}
+
+	/**
+	 * @return the paramsList
+	 */
+	public ArrayList<ParamStruct> getParamsList() {
+		return paramsList;
+	}
+
+	/**
+	 * Aqui se seleccionan que filtros se van a aplicar y se devuelven en forma
+	 * de ArrayList tanto para el dibujado como cuando aceptan o aplican el panel.
+	 * @param layerRaster
+	 * @return
+	 */
+	public ArrayList<ParamStruct> applyFilters(FLyrRaster layerRaster) {
+		ArrayList<ParamStruct> listFilterUsed = new ArrayList<ParamStruct>();
+
+		int initDataType = layerRaster.getRender().getFilterList().getInitDataType();
+		RasterFilterList filterList = RasterLocator.getManager().createEmptyFilterList(initDataType);
+		filterList.setEnv(layerRaster.getRender().getFilterList().getEnv());
+		filterList.setInitDataType(initDataType);
+		List<Class<?>> registeredFilters = filterList.getRegisteredFilterList();
+
+		// Conservamos filtros no visibles ya existentes
+		List<RasterFilter> filtersInit =  getFilterPanel().getLayerVisualStatus().getLast().getFilterStatus();
+		for (int i = 0; i < filtersInit.size(); i++) {
+			// Si es visible no hacemos nada
+			if (((RasterFilter) filtersInit.get(i)).isVisible())
+				continue;
+
+			RasterFilter obj = null;
+			for (int j = 0; j < registeredFilters.size(); j++) {
+				Class<?> classFilter = (Class<?>) registeredFilters.get(j);
+				try {
+					obj = (RasterFilter) classFilter.newInstance();
+					if (obj.getName().equals(((RasterFilter) filtersInit.get(i)).getName()))
+						break;
+				} catch (InstantiationException e) {
+					RasterSwingLibrary.messageBoxError("error_creando_filtro", this, e);
+				} catch (IllegalAccessException e) {
+					RasterSwingLibrary.messageBoxError("error_creando_filtro", this, e);
+				}
+			}
+
+			// Si no encontramos el filtro apropiado, nos olvidamos de el
+			if (obj == null)
+				continue;
+
+			// Si no es visible tenemos que conservar el filtro
+			try {
+				Params params = (Params) ((RasterFilter) filtersInit.get(i)).getUIParams(((RasterFilter) filtersInit.get(i)).getName()).clone();
+				// A�ado el parametro RenderBands a los parametros del filtro
+				int[] renderBands = layerRaster.getRender().getRenderColorInterpretation().buildRenderBands();
+				String rgb = renderBands[0] + " " + renderBands[1] + " " + renderBands[2];
+				params.setParam("RenderBands", rgb, 0, null);
+				params.setParam("alphaBand", new Integer(layerRaster.getAlphaBandNumber()), 0, null);
+				
+				ParamStruct newParam = new ParamStruct();
+				newParam.setFilterClass(obj.getClass());
+				newParam.setFilterName(((RasterFilter) filtersInit.get(i)).getName());
+				newParam.setFilterParam(params);
+				listFilterUsed.add(newParam);
+			} catch (CloneNotSupportedException e) {
+			}
+		}
+
+		// Metemos los filtros seleccionados en el panel
+		ListModel list = getFilterPanel().getMainPanel().getTreeListContainer().getListModel();
+		for (int i = 0; i < list.getSize(); i++) {
+			Hashtable<?, ?> hastTable = getFilterPanel().getMainPanel().getTreeListContainer().getMap();
+			for (int j = 0; j < paramsList.size(); j++) {
+				boolean active = true;
+				Param param = ((ParamStruct) paramsList.get(j)).getFilterParam().getParamById("enabled");
+				if ((param != null) &&
+					param.getDefaultValue() instanceof Boolean &&
+					((((Boolean)param.getDefaultValue()).booleanValue()) == false))
+					active = false;
+				if (active) {
+					if (((ParamStruct) paramsList.get(j)).getFilterName().equals(hastTable.get(list.getElementAt(i)))) {
+						try {
+							Params params = (Params) ((ParamStruct) paramsList.get(j)).getFilterParam().clone();
+							// A�ado el parametro RenderBands a los parametros del filtro
+							int[] renderBands = layerRaster.getRender().getRenderColorInterpretation().buildRenderBands();
+							String rgb = renderBands[0] + " " + renderBands[1] + " " + renderBands[2];
+							params.setParam("RenderBands", rgb, 0, null);
+							params.setParam("alphaBand", new Integer(layerRaster.getAlphaBandNumber()), 0, null);
+
+							ParamStruct newParam = new ParamStruct();
+							newParam.setFilterClass(((ParamStruct) paramsList.get(j)).getFilterClass());
+							newParam.setFilterName(((ParamStruct) paramsList.get(j)).getFilterName());
+							newParam.setFilterParam(params);
+							listFilterUsed.add(newParam);
+						} catch (CloneNotSupportedException e) {
+						}
+					}
+				}
+			}
+		}
+		return listFilterUsed;
+	}
+
+	public void drawImage(FLyrRaster rendering) {
+		rendering.getRender().getFilterList().clear();
+
+		if (getFilterPanel().getCBShowFilters().isSelected()) {
+			RasterFilterList filterList = rendering.getRender().getFilterList();
+
+			ArrayList<ParamStruct> listFilterUsed = applyFilters(rendering);
+			ArrayList<Exception> exc = new ArrayList<Exception>();
+			for (int i = 0; i < listFilterUsed.size(); i++) {
+				try {
+					RasterFilterListManager filterManager = filterList.getManagerByFilterClass(((ParamStruct) listFilterUsed.get(i)).getFilterClass());
+					filterManager.addFilter(((ParamStruct) listFilterUsed.get(i)).getFilterClass(), ((ParamStruct) listFilterUsed.get(i)).getFilterParam());
+				} catch (FilterTypeException e) {
+					exc.add(e);
+				} catch (FilterManagerException e1) {
+					exc.add(e1);
+				}
+			}
+			if(exc.size() != 0) {
+				RasterSwingLibrary.messageBoxError(PluginServices.getText(this, "error_adding_filters"), this, exc);
+				exc.clear();
+			}
+		}
+	}
+
+	/**
+	 * Que acciones se ejecutaran al haber presionado el bot�n aceptar o aplicar
+	 */
+	public void accept() {
+		RasterDataStore raster = ((FLyrRaster) getFilterPanel().getLayer()).getDataStore();
+		if (raster == null)
+			return;
+
+		String path = null;
+		if (!getFilterPanel().getNewLayerPanel().isOnlyViewSelected()) {
+			path = getFilterPanel().getNewLayerPanel().getFileSelected();
+			if (path == null)
+				return;
+		}
+
+		FLyrRaster rendering = (FLyrRaster) getFilterPanel().getLayer();
+
+		// Array para guardar los filtros que se van a usar en forma de ParamStruct
+		ArrayList<ParamStruct> listFilterUsed = applyFilters(rendering);
+
+		if (filterPanel.getNewLayerPanel().isOnlyViewSelected()) {
+			try {
+				ParamStruct.addSelectedFilters(rendering.getRender().getFilterList(), listFilterUsed);
+				((FLyrRaster) getFilterPanel().getLayer()).getRender().setFilterList(rendering.getRender().getFilterList());
+				getFilterPanel().getLayer().getMapContext().invalidate();
+			} catch (FilterTypeException e) {
+				RasterSwingLibrary.messageBoxError(PluginServices.getText(this, "error_adding_filters"), this, e);
+			} catch (FilterManagerException e) {
+				RasterSwingLibrary.messageBoxError(PluginServices.getText(this, "error_adding_filters"), this, e);
+			}
+		} else {
+			FilterProcess filterProcess = new FilterProcess();
+			filterProcess.setActions(this);
+			filterProcess.addParam("rendering", rendering);
+			filterProcess.addParam("filename", path);
+			filterProcess.addParam("rasterdatasource", raster);
+			filterProcess.addParam("layer", ((FLyrRaster) getFilterPanel().getLayer()));
+			filterProcess.addParam("listfilterused", listFilterUsed);
+			filterProcess.start();
+			filterProcess = null;
+		}
+	}
+
+	/**
+	 * Devuelve el FilterPanel asociado al FilterListener
+	 * @return
+	 */
+	public FilterPanel getFilterPanel() {
+		return filterPanel;
+	}
+
+	/**
+	 * Acciones que se realizan al finalizar de crear los recortes de imagen.
+	 * Este m�todo es llamado por el thread TailRasterProcess al finalizar.
+	 */
+	public void loadLayerInToc(String fileName) {
+		if (!getFilterPanel().getNewLayerPanel().isNewLayerSelected())
+			return;
+		if(!new File(fileName).exists())
+			return;
+		try {
+			RasterToolsUtil.loadLayer(getFilterPanel().getViewName(), fileName, null);
+		} catch (RasterNotLoadException e) {
+			RasterSwingLibrary.messageBoxError("error_cargar_capa", this, e);
+		}
+
+		if(filterPanel != null)
+			filterPanel.updateNewLayerText();
+	}
+
+	public void actionValuesCompleted(EventObject e) {
+		actionChangeProperties(e);
+	}
+
+	public void end(Object param) {
+		loadLayerInToc((String) param);
+	}
+
+	public void interrupted() {}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/FilterListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskDoubleFilter.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskDoubleFilter.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskDoubleFilter.java	(revision 8183)
@@ -0,0 +1,95 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.app.basic.tool.filter.mask;
+
+import java.awt.image.DataBuffer;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.raster.roi.ROI;
+
+/**
+ * Filtro que aplica una m�scara con la lista de ROIS. Los p�xeles dentro
+ * de la ROI se ponen al valor de la imagen de origen. Los p�xeles fuera
+ * de la ROI se ponen a NoData. Esta clase es la gestiona los datos para los
+ * raster de tipo double.
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class MaskDoubleFilter extends MaskFilter {
+	private double nodata     = RasterLibrary.defaultDoubleNoDataValue;
+	
+	public void pre() throws FilterAddException {
+		super.pre();
+		noData = (NoData)params.get("nodata");
+		if(noData != null && noData.isDefined())
+			nodata = noData.getValue().doubleValue();
+	}
+	
+	public void process(int x, int y) {
+		if(bufferExtent == null) {
+			for (int j = 0; j < raster.getBandCount(); j++) 
+				rasterResult.setElem(y, x, j, raster.getElemDouble(y, x, j));
+			return;
+		}
+		double wcX = bufferExtent.minX() + ((((double) x) * bufferExtent.width()) / ((double) raster.getWidth()));
+		double wcY = bufferExtent.minY() + ((((double) (raster.getHeight() - (y))) * bufferExtent.height()) / ((double) raster.getHeight()));
+
+		
+		if(inverse) {
+			for (int i = 0; i < rois.size(); i++) {
+				if (((ROI) rois.get(i)).isInside(wcX, wcY, cellsize, cellsize)) {
+					for (int j = 0; j < numberOfBandsToProcess(); j++) 
+						rasterResult.setElem(y, x, j, (double)nodata);
+					return;
+				}
+			}
+			
+			for (int j = 0; j < numberOfBandsToProcess(); j++) 
+				rasterResult.setElem(y, x, j, raster.getElemDouble(y, x, j));
+			
+			return;
+		}
+		
+		for (int i = 0; i < rois.size(); i++) {
+			if (((ROI) rois.get(i)).isInside(wcX, wcY, cellsize, cellsize)) {
+				for (int j = 0; j < numberOfBandsToProcess(); j++) 
+					rasterResult.setElem(y, x, j, raster.getElemDouble(y, x, j));
+				return;
+			}
+		}
+		
+		for (int j = 0; j < numberOfBandsToProcess(); j++) 
+			rasterResult.setElem(y, x, j, (double)nodata);
+		
+		return;
+	}
+	
+	public int getInRasterDataType() {
+		return DataBuffer.TYPE_DOUBLE;
+	}
+	
+	public int getOutRasterDataType() { 
+		return DataBuffer.TYPE_DOUBLE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskDoubleFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskIntegerFilter.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskIntegerFilter.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskIntegerFilter.java	(revision 8183)
@@ -0,0 +1,95 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.app.basic.tool.filter.mask;
+
+import java.awt.image.DataBuffer;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.raster.roi.ROI;
+
+/**
+ * Filtro que aplica una m�scara con la lista de ROIS. Los p�xeles dentro
+ * de la ROI se ponen al valor de la imagen de origen. Los p�xeles fuera
+ * de la ROI se ponen a NoData. Esta clase es la gestiona los datos para los
+ * raster de tipo integer.
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class MaskIntegerFilter extends MaskFilter {
+	private int nodata     = RasterLibrary.defaultIntegerNoDataValue;
+	
+	public void pre() throws FilterAddException {
+		super.pre();
+		noData = (NoData)params.get("nodata");
+		if(noData != null && noData.isDefined())
+			nodata = noData.getValue().intValue();
+	}
+	
+	public void process(int x, int y) {
+		if(bufferExtent == null) {
+			for (int j = 0; j < raster.getBandCount(); j++) 
+				rasterResult.setElem(y, x, j, raster.getElemInt(y, x, j));
+			return;
+		}
+		double wcX = bufferExtent.minX() + ((((double) x) * bufferExtent.width()) / ((double) raster.getWidth()));
+		double wcY = bufferExtent.minY() + ((((double) (raster.getHeight() - (y))) * bufferExtent.height()) / ((double) raster.getHeight()));
+
+		
+		if(inverse) {
+			for (int i = 0; i < rois.size(); i++) {
+				if (((ROI) rois.get(i)).isInside(wcX, wcY, cellsize, cellsize)) {
+					for (int j = 0; j < numberOfBandsToProcess(); j++) 
+						rasterResult.setElem(y, x, j, (int)nodata);
+					return;
+				}
+			}
+			
+			for (int j = 0; j < numberOfBandsToProcess(); j++) 
+				rasterResult.setElem(y, x, j, raster.getElemInt(y, x, j));
+			
+			return;
+		}
+		
+		for (int i = 0; i < rois.size(); i++) {
+			if (((ROI) rois.get(i)).isInside(wcX, wcY, cellsize, cellsize)) {
+				for (int j = 0; j < numberOfBandsToProcess(); j++) 
+					rasterResult.setElem(y, x, j, raster.getElemInt(y, x, j));
+				return;
+			}
+		}
+		
+		for (int j = 0; j < numberOfBandsToProcess(); j++) 
+			rasterResult.setElem(y, x, j, (int)nodata);
+		
+		return;
+	}
+	
+	public int getInRasterDataType() {
+		return DataBuffer.TYPE_INT;
+	}
+	
+	public int getOutRasterDataType() { 
+		return DataBuffer.TYPE_INT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskIntegerFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskFilter.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskFilter.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskFilter.java	(revision 8183)
@@ -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.tools.app.basic.tool.filter.mask;
+
+import java.util.ArrayList;
+
+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.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.roi.ROI;
+
+/**
+ * Filtro que aplica una m�scara con la lista de ROIS. Los p�xeles dentro
+ * de la ROI se ponen al valor de la imagen de origen. Los p�xeles fuera
+ * de la ROI se ponen a NoData.
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ * @deprecated Exists a plugin with a process which include this functionality
+ */
+public class MaskFilter extends BaseRasterFilter {
+	public static String[]         names            = new String[] { MaskListManager.ID };
+	protected MaskUI               maskUI           = null;
+	protected ArrayList<ROI>       rois             = null;
+	protected boolean              inverse          = false;
+	
+	//Extent de la ventana de datos y de la imagen completa.
+	protected Extent               bufferExtent     = null;
+	protected NoData               noData           = null;
+	protected double               cellsize         = 0D;
+	
+	/**
+	 * Constructor
+	 */
+	public MaskFilter() {
+		super();
+		setName(names[0]);
+	}
+
+	public String getGroup() {
+		return "mascaras";
+	}
+
+	public String[] getNames() {
+		return names;
+	}
+
+	public Params getUIParams(String nameFilter) {
+		Params params = RasterLocator.getManager().createParams(
+				"Panel", 
+				getMaskUI(), 
+				-1, 
+				null);
+		params.setParam(
+				"FilterName", 
+				nameFilter, 
+				-1, 
+				null);
+		return params;
+	}
+	
+	/**
+	 * Obtiene el interfaz gr�fico para el filtro de m�scara.
+	 * @return MaskUI
+	 */
+	private MaskUI getMaskUI() {
+		if (maskUI == null) {
+			maskUI = new MaskUI();
+			FLyrRaster raster = (FLyrRaster) getEnv().get("initRaster");
+			maskUI.setRois(rois);
+			maskUI.setLayer(raster);
+		}
+		return maskUI;
+	}
+
+	@SuppressWarnings("unchecked")
+	public void pre() throws FilterAddException {
+		super.pre();
+		Boolean inverseBoolean = (Boolean)params.get("inverse");
+		if(inverseBoolean != null)
+			inverse = inverseBoolean.booleanValue();
+		
+		rois = (ArrayList<ROI>) params.get("rois");
+		
+		if(raster.getDataExtent() == null)
+			throw new FilterAddException("Buffer extension cannot be null");
+		
+		bufferExtent = RasterLocator.getManager().getDataStructFactory().createExtent(raster.getDataExtent());
+		cellsize = raster.getDataExtent().getWidth() / raster.getWidth();
+		
+		createBufferResult(raster.getDataType(), raster.getBandCount());
+	}
+		
+	public void process(int x, int y) {
+	}
+
+	public void post() {
+		rasterResult.setNoDataValue(noData);
+	}
+  
+	public int getInRasterDataType() {return 0;}
+	public int getOutRasterDataType() {return 0;}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskShortFilter.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskShortFilter.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskShortFilter.java	(revision 8183)
@@ -0,0 +1,95 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.app.basic.tool.filter.mask;
+
+import java.awt.image.DataBuffer;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.raster.roi.ROI;
+
+/**
+ * Filtro que aplica una m�scara con la lista de ROIS. Los p�xeles dentro
+ * de la ROI se ponen al valor de la imagen de origen. Los p�xeles fuera
+ * de la ROI se ponen a NoData. Esta clase es la gestiona los datos para los
+ * raster de tipo short.
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class MaskShortFilter extends MaskFilter {
+	private short nodata     = RasterLibrary.defaultShortNoDataValue;
+	
+	public void pre() throws FilterAddException {
+		super.pre();
+		noData = (NoData)params.get("nodata");
+		if(noData != null && noData.isDefined())
+			nodata = noData.getValue().shortValue();
+	}
+	
+	public void process(int x, int y) {
+		if(bufferExtent == null) {
+			for (int j = 0; j < raster.getBandCount(); j++) 
+				rasterResult.setElem(y, x, j, raster.getElemShort(y, x, j));
+			return;
+		}
+		double wcX = bufferExtent.minX() + ((((double) x) * bufferExtent.width()) / ((double) raster.getWidth()));
+		double wcY = bufferExtent.minY() + ((((double) (raster.getHeight() - (y))) * bufferExtent.height()) / ((double) raster.getHeight()));
+
+		
+		if(inverse) {
+			for (int i = 0; i < rois.size(); i++) {
+				if (((ROI) rois.get(i)).isInside(wcX, wcY, cellsize, cellsize)) {
+					for (int j = 0; j < numberOfBandsToProcess(); j++) 
+						rasterResult.setElem(y, x, j, (short)nodata);
+					return;
+				}
+			}
+			
+			for (int j = 0; j < numberOfBandsToProcess(); j++) 
+				rasterResult.setElem(y, x, j, raster.getElemShort(y, x, j));
+			
+			return;
+		}
+		
+		for (int i = 0; i < rois.size(); i++) {
+			if (((ROI) rois.get(i)).isInside(wcX, wcY, cellsize, cellsize)) {
+				for (int j = 0; j < numberOfBandsToProcess(); j++) 
+					rasterResult.setElem(y, x, j, raster.getElemShort(y, x, j));
+				return;
+			}
+		}
+		
+		for (int j = 0; j < numberOfBandsToProcess(); j++) 
+			rasterResult.setElem(y, x, j, (short)nodata);
+		
+		return;
+	}
+	
+	public int getInRasterDataType() {
+		return DataBuffer.TYPE_SHORT;
+	}
+	
+	public int getOutRasterDataType() { 
+		return DataBuffer.TYPE_SHORT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskShortFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskListManager.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskListManager.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskListManager.java	(revision 8183)
@@ -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.tools.app.basic.tool.filter.mask;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+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.roi.ROI;
+
+/**
+ * Gestor de los filtros de mascara. Los filtros de m�scara generan una
+ * capa enmascarando con regiones de inter�s. Las zonas fuera del ROI se
+ * pondr�n a NoData.
+ *
+ * @author Nacho Brodin nachobrodin@gmail.com
+ * @deprecated Exists a plugin with a process which include this functionality
+ */
+public class MaskListManager extends AbstractRasterFilterManager {
+	public static String   ID = "Mask";
+	
+	/**
+	 * Default constructor. Sets the filter list.
+	 * @param filterList
+	 */
+	public MaskListManager(RasterFilterList filterList) {
+		super(filterList);
+	}
+	
+	public String getManagerID() {
+		return ID;
+	}
+
+	public static void register() {
+		AbstractRasterFilterManager.register(ID, MaskListManager.class, MaskUI.class);
+	}
+	
+	public boolean isDataTypeSupported(int dataType) {
+		return true;
+	}
+	
+	public Class<?> getFilterClassByID(String id) {
+		if( id.compareTo("mask") == 0)
+			return MaskFilter.class;
+		return null;
+	}
+
+	/**
+	 * A�ade un filtro de m�scara
+	 * @param rois Lista de ROIs
+	 * @param noData Valor a asignar fuera de las ROI
+	 * @param inverse Inversa
+	 * @throws FilterTypeException
+	 */
+	public void addMaskFilter(List<ROI> rois, NoData noData, Boolean inverse, Boolean transp) throws FilterTypeException {
+		RasterFilter filter = new MaskByteFilter();
+
+		//Cuando el filtro esta creado, tomamos los valores y lo a�adimos a la pila
+		if (filter != null) {
+			filter.addParam("rois", rois);
+			filter.addParam("nodata", noData);
+			filter.addParam("inverse", inverse);
+			filter.addParam("transparency", transp);
+			getFilterList().add(filter);
+		}
+	}
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		filters.add(MaskFilter.class);
+		return filters;
+	}
+	
+	@SuppressWarnings("unchecked")
+	public RasterFilter createFilter(Params params) {
+		ArrayList<ROI> rois = ((ArrayList<ROI>) params.getParamById("rois").getDefaultValue());
+		NoData nodata = ((NoData) params.getParamById("nodata").getDefaultValue());
+		Boolean inverse = ((Boolean) params.getParamById("inverse").getDefaultValue());
+		Boolean transparency = ((Boolean) params.getParamById("transparency").getDefaultValue());
+		
+		RasterFilter filter = new MaskByteFilter();
+		filter.addParam("rois", rois);
+		filter.addParam("inverse", inverse);
+		filter.addParam("transparency", transparency);
+		filter.addParam("nodata", nodata);
+		return filter;
+	}
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		addFilter(MaskFilter.class, params);
+	}
+
+	@SuppressWarnings("unchecked")
+	public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException {
+		if (classFilter.equals(MaskFilter.class)) {
+			ArrayList<ROI> rois = new ArrayList<ROI>();
+			Boolean inverse = new Boolean(false);
+			Boolean transp = new Boolean(false);
+			NoData nodata = RasterLocator.getManager().getDataStructFactory().createNoData(null, null, null, 1);
+
+			Params paramsUI = null;
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (params.getParam(i).getId().equals("Panel") &&
+					params.getParam(i).getDefaultValue() instanceof RegistrableFilterListener) {
+					paramsUI = ((RegistrableFilterListener) params.getParam(i).getDefaultValue()).getParams();
+				}
+			}
+
+			if (paramsUI != null) {
+				for (int i = 0; i < paramsUI.getNumParams(); i++) {
+					if (paramsUI.getParam(i).getId().equals("rois"))
+						rois = (ArrayList<ROI>) paramsUI.getParam(i).getDefaultValue();
+					if (paramsUI.getParam(i).getId().equals("inverse"))
+						inverse = (Boolean) paramsUI.getParam(i).getDefaultValue();
+					if (paramsUI.getParam(i).getId().equals("nodata"))
+						nodata = (NoData) paramsUI.getParam(i).getDefaultValue();
+					if (paramsUI.getParam(i).getId().equals("transparency"))
+						transp = (Boolean) paramsUI.getParam(i).getDefaultValue();
+				}
+			}
+			addMaskFilter(rois, nodata, inverse, transp);
+		}
+	}
+
+	public int createFilterListFromStrings(List<String> filters, String fil, int filteri) throws FilterTypeException {
+		return filteri;
+	}
+
+	public List<String> getStringsFromFilterList(List<String> filterList, RasterFilter rf) {
+		return filterList;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskListManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskByteFilter.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskByteFilter.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskByteFilter.java	(revision 8183)
@@ -0,0 +1,104 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.app.basic.tool.filter.mask;
+
+import java.awt.image.DataBuffer;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.raster.roi.ROI;
+
+/**
+ * Filtro que aplica una m�scara con la lista de ROIS. Los p�xeles dentro
+ * de la ROI se ponen al valor de la imagen de origen. Los p�xeles fuera
+ * de la ROI se ponen a NoData. Esta clase es la gestiona los datos para los
+ * raster de tipo byte.
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class MaskByteFilter extends MaskFilter {
+	private byte nodata     = RasterLibrary.defaultByteNoDataValue;
+	
+	public void pre() throws FilterAddException {
+		super.pre();
+		noData = (NoData)params.get("nodata");
+		if(noData != null && noData.isDefined())
+			nodata = noData.getValue().byteValue();
+	}
+	
+	public void process(int x, int y) {
+		if(bufferExtent == null || rois == null || rois.size() == 0) {
+			for (int j = 0; j < raster.getBandCount(); j++) 
+				rasterResult.setElem(y, x, j, raster.getElemByte(y, x, j));
+			return;
+		}
+		double wcX = bufferExtent.minX() + ((((double) x) * bufferExtent.width()) / ((double) raster.getWidth()));
+		double wcY = bufferExtent.minY() + ((((double) (raster.getHeight() - (y))) * bufferExtent.height()) / ((double) raster.getHeight()));
+		
+		
+		for (int iBand = 0; iBand < numberOfBandsToProcess(); iBand++) {
+			rasterResult.setElem(y, x, iBand, raster.getElemByte(y, x, iBand));
+		}
+		
+		for (int i = 0; i < rois.size(); i++) {
+			if (((ROI) rois.get(i)).isInside(wcX, wcY, cellsize, cellsize)) {
+				if(inverse) {
+					drawPixelNoData(x, y);
+				} else {
+					drawPixelFill(x, y);
+				}
+				return;
+			}
+		}
+		
+		if(inverse) {
+			drawPixelFill(x, y);
+		} else {
+			drawPixelNoData(x, y);
+		}
+		
+		return;
+	}
+	
+	private void drawPixelFill(int x, int y) {
+		for (int j = 0; j < numberOfBandsToProcess(); j++) 
+			rasterResult.setElem(y, x, j, raster.getElemByte(y, x, j));
+		writeAlphaBand(y, x);
+	}
+	
+	private void drawPixelNoData(int x, int y) {
+		for (int j = 0; j < numberOfBandsToProcess(); j++) 
+			rasterResult.setElem(y, x, j, (byte)nodata);
+
+		if(hasInputTransparency())
+			rasterResult.setElem(y, x, rasterResult.getBandCount() - 1, (byte)255);
+	}
+	
+	public int getInRasterDataType() {
+		return DataBuffer.TYPE_BYTE;
+	}
+	
+	public int getOutRasterDataType() { 
+		return DataBuffer.TYPE_BYTE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskFloatFilter.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskFloatFilter.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskFloatFilter.java	(revision 8183)
@@ -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.tools.app.basic.tool.filter.mask;
+
+import java.awt.image.DataBuffer;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.raster.roi.ROI;
+
+/**
+ * Filtro que aplica una m�scara con la lista de ROIS. Los p�xeles dentro
+ * de la ROI se ponen al valor de la imagen de origen. Los p�xeles fuera
+ * de la ROI se ponen a NoData. Esta clase es la gestiona los datos para los
+ * raster de tipo float.
+ * 
+ * 14/03/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class MaskFloatFilter extends MaskFilter {
+	private float nodata     = RasterLibrary.defaultFloatNoDataValue;
+	
+	public void pre() throws FilterAddException {
+		super.pre();
+		noData = (NoData)params.get("nodata");
+		if(noData != null && noData.isDefined())
+			nodata = noData.getValue().floatValue();
+	}
+	
+	public void process(int x, int y) {
+		if(bufferExtent == null) {
+			for (int j = 0; j < raster.getBandCount(); j++) 
+				rasterResult.setElem(y, x, j, raster.getElemFloat(y, x, j));
+			return;
+		}
+		double wcX = bufferExtent.minX() + ((((double) x) * bufferExtent.width()) / ((double) raster.getWidth()));
+		double wcY = bufferExtent.minY() + ((((double) (raster.getHeight() - (y))) * bufferExtent.height()) / ((double) raster.getHeight()));
+
+		
+		if(inverse) {
+			for (int i = 0; i < rois.size(); i++) {
+				if (((ROI) rois.get(i)).isInside(wcX, wcY, cellsize, cellsize)) {
+					for (int j = 0; j < numberOfBandsToProcess(); j++) 
+						rasterResult.setElem(y, x, j, (float)nodata);
+					return;
+				}
+			}
+			
+			for (int j = 0; j < numberOfBandsToProcess(); j++) 
+				rasterResult.setElem(y, x, j, raster.getElemFloat(y, x, j));
+			
+			return;
+		}
+		
+		for (int i = 0; i < rois.size(); i++) {
+			if (((ROI) rois.get(i)).isInside(wcX, wcY, cellsize, cellsize)) {
+				for (int j = 0; j < numberOfBandsToProcess(); j++) 
+					rasterResult.setElem(y, x, j, raster.getElemFloat(y, x, j));
+				return;
+			}
+		}
+		
+		for (int j = 0; j < numberOfBandsToProcess(); j++) 
+			rasterResult.setElem(y, x, j, (float)nodata);
+		
+		return;
+	}
+	
+	public int getInRasterDataType() {
+		return DataBuffer.TYPE_FLOAT;
+	}
+	
+	public int getOutRasterDataType() { 
+		return DataBuffer.TYPE_FLOAT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskFloatFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskUI.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskUI.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskUI.java	(revision 8183)
@@ -0,0 +1,395 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.app.basic.tool.filter.mask;
+
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.util.ArrayList;
+import java.util.EventObject;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.JCheckBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+
+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.NoData;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.ROIException;
+import org.gvsig.fmap.dal.coverage.grid.FilterUIListener;
+import org.gvsig.fmap.dal.coverage.grid.RegistrableFilterListener;
+import org.gvsig.gui.beans.datainput.DataInputContainer;
+import org.gvsig.gui.beans.datainput.DataInputContainerListener;
+import org.gvsig.gui.beans.table.TableContainer;
+import org.gvsig.gui.beans.table.exceptions.NotInitializeException;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.roi.ROI;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+/**
+ * Interfaz gr�fico para los filtros de mascara.
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class MaskUI extends JPanel implements RegistrableFilterListener, TableModelListener, ChangeListener, DataInputContainerListener {
+	private static final long   serialVersionUID            = 4525736825113598035L;
+	private TableContainer      tableContainer              = null;
+	private FLyrRaster          layer                       = null;
+	private ArrayList<ROI>      rois                        = null;
+	private DataInputContainer  valueNoData                 = null;
+	private JCheckBox           negative                    = null;
+	private JCheckBox           transp                      = null;
+	private JLabel              warning                     = null;
+	private boolean             lastTransp                  = false;
+	private boolean             lastInv                     = false;
+	private ArrayList<FilterUIListener>          
+                                actionCommandListeners      = new ArrayList<FilterUIListener>();
+	protected Params            params                      = null;
+
+	/**
+	 * Constructor. Inicializa los elementos gr�ficos.
+	 */
+	public MaskUI() {
+		init(null);
+	}
+	
+	/**
+	 * Inicializa los elementos gr�ficos.
+	 */
+	public void init(Object obj) {
+		setLayout(new GridBagLayout());
+		GridBagConstraints gridBagConstraints;
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(0, 0, 2, 0);
+		add(getWarning(), gridBagConstraints);
+		
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(0, 0, 2, 0);
+		add(getInverse(), gridBagConstraints);
+		
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 2;
+		gridBagConstraints.fill = GridBagConstraints.BOTH;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.weighty = 1.0;
+		gridBagConstraints.insets = new Insets(0, 0, 2, 0);
+		add(getTableContainer(), gridBagConstraints);
+		
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 3;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(0, 0, 2, 0);
+
+		add(getValueNoData(), gridBagConstraints);
+		
+	}
+	
+	/**
+	 * Obtiene el checkbox que informa de si asigna valor noData a los
+	 * pixeles del interior de las ROIs o a los del exterior.
+	 * @return JCheckBox
+	 */
+	private JCheckBox getInverse() {
+		if(negative == null) {
+			negative = new JCheckBox();
+			negative.setText(RasterToolsUtil.getText(this, "inversa"));
+			negative.addChangeListener(this);
+		}
+		return negative;
+	}
+	
+	/**
+	 * Obtiene el checkbox que informa de si se activa la generaci�n de capa
+	 * de transparencia o no.
+	 * @return JCheckBox
+	 */
+	private JCheckBox getTransparencyActive() {
+		if(transp == null) {
+			transp = new JCheckBox();
+			transp.setText(RasterToolsUtil.getText(this, "transparencia"));
+			transp.addChangeListener(this);
+		}
+		return transp;
+	}
+	
+	/**
+	 * Gets the NoData value
+	 * @return DataInputContainer
+	 */
+	private DataInputContainer getValueNoData() {
+		if(valueNoData == null) {
+			valueNoData = new DataInputContainer();
+			valueNoData.setLabelText(RasterToolsUtil.getText(this, "value"));
+			valueNoData.setValue(RasterLibrary.defaultByteNoDataValue + "");
+			valueNoData.getDataInputField().addValueChangedListener(this);
+		}
+		return valueNoData;
+	}
+	
+	/**
+	 * Obtiene el mensaje de aviso de que no hay rois en la lista. Esta etiqueta solo
+	 * es mostrada en caso en que la capa no tenga ROIs asociadas.
+	 * @return JLabel Etiqueta con el mensaje de aviso.
+	 */
+	public JLabel getWarning() {
+		if(warning == null) {
+			warning = new JLabel(RasterToolsUtil.getText(this, "rois_needed"));
+			warning.setVisible(false);
+		}
+		return warning;
+	}
+	
+	/**
+	 * Obtiene el contenedor con la tabla.
+	 * @return
+	 */
+	private TableContainer getTableContainer() {
+		if (tableContainer == null) {
+			String[] columnNames = {" ", "Nombre", ""};
+			int[] columnWidths = {22, 334, 0};
+			tableContainer = new TableContainer(columnNames, columnWidths);
+			tableContainer.setPreferredSize(new Dimension(0, 130));
+			tableContainer.setModel("CheckBoxModel");
+			tableContainer.initialize();
+			tableContainer.setControlVisible(false);
+			tableContainer.setMoveRowsButtonsVisible(false);
+			tableContainer.getTable().getJTable().getColumnModel().getColumn(0).setMinWidth(22);
+			tableContainer.getTable().getJTable().getColumnModel().getColumn(0).setMaxWidth(22);
+			tableContainer.getTable().getJTable().getColumnModel().getColumn(2).setMinWidth(0);
+			tableContainer.getTable().getJTable().getColumnModel().getColumn(2).setMaxWidth(0);
+			tableContainer.getModel().addTableModelListener(this);
+		}
+		return tableContainer;
+	}
+	
+	/**
+	 * Asigna la lista de regiones de inter�s.
+	 * @param rois Lista de ROIs
+	 */
+	public void setRois(ArrayList<ROI> rois) {
+		this.rois = rois;
+	}
+	
+	/**
+	 * Asigna la capa.
+	 * @param layer
+	 */
+	public void setLayer(FLyrRaster layer) {
+		this.layer = layer;
+		if (layer == null)
+			return;
+		
+		List<ROI> roisArray = null;
+		try {
+			roisArray = ((FLyrRaster) layer).getRois();
+		} catch (ROIException e1) {
+			RasterSwingLibrary.messageBoxError(Messages.getText("problems_loading_rois"), null);
+		}
+		
+		if(roisArray == null || roisArray.size() == 0)
+			getWarning().setVisible(true);
+		
+		if (roisArray != null) {
+			for (int i = 0; i < roisArray.size(); i++) {
+				ROI roi = (ROI) roisArray.get(i);
+	
+				Object row[] = {"", "", ""};
+				
+				boolean active = false;
+				
+				if (rois != null) {
+					for (int r = 0; r < rois.size(); r++) {
+						if (((ROI) rois.get(r)) == roi) {
+							active = true;
+							break;
+						}
+					}
+				}
+				
+				row[0] = new Boolean(active);
+				row[1] = roi.getName(); 
+				row[2] = new Integer(i);
+				try {
+					getTableContainer().addRow(row);
+				} catch (NotInitializeException e) {
+				}
+			}
+		}
+		
+		if(layer != null) {
+			getValueNoData().setValue(RasterLibrary.defaultByteNoDataValue + "");
+		}
+	}
+	
+	/**
+	 * Obtiene la lista de ROIs seleccionadas
+	 * @return ArrayList con la lista de ROIs
+	 */
+	private List<ROI> getSelectedROIs() {
+		if (layer == null)
+			return null;
+
+		List<ROI> roisArray = null;
+		try {
+			roisArray = ((FLyrRaster) layer).getRois();
+		} catch (ROIException e1) {
+		}
+		List<ROI> selected = new ArrayList<ROI>();
+		if (roisArray != null) {
+			for (int i = 0; i < roisArray.size(); i++) {
+				try {
+					if (((Boolean) tableContainer.getModel().getValueAt(i, 0)).booleanValue()) {
+						selected.add(roisArray.get(i));
+					}
+				} catch (ArrayIndexOutOfBoundsException e) {
+					//Entra aqu� si se han a�adido ROIs con el cuadro abierto. Pasamos de hacer nada
+				}
+			}
+		}
+		return selected;
+	}
+	
+	/**
+	 * Sobrecargamos el m�todo getParams para que siempre devuelva
+	 * algo.
+	 */
+	public Params getParams() {
+		NoData noData = null;
+		Number n = null;
+		Double d = new Double(getValueNoData().getValue());
+		if(layer != null) {
+			switch (layer.getDataStore().getDataType()[0]) {
+			case Buffer.TYPE_BYTE:
+				n = new Byte(d.byteValue());
+				break;
+			case Buffer.TYPE_SHORT:
+				n = new Short(d.shortValue());
+				break;
+			case Buffer.TYPE_INT:
+				n = new Integer(d.intValue());
+				break;
+			case Buffer.TYPE_FLOAT:
+				n = new Float(getValueNoData().getValue());
+				break;
+			case Buffer.TYPE_DOUBLE:
+				n = d;
+				break;
+			}
+		}
+		noData = RasterLocator.getManager().getDataStructFactory().createNoData(n, n, null);
+		
+		params = RasterLocator.getManager().createParams(
+							"rois",
+							getSelectedROIs(),
+							-1,
+							null);
+		params.setParam("inverse",
+				new Boolean(getInverse().isSelected()),
+				-1,
+				null);
+		try {
+			params.setParam("nodata",
+					noData,
+					-1,
+					null);
+		} catch (NumberFormatException e) {
+			params.setParam("nodata", 
+					RasterLocator.getManager().getDataStructFactory().createDefaultNoData(1, layer.getDataStore().getDataType()[0]), 
+					-1, 
+					null);
+		}
+		return params;
+	}
+	
+	public void setParams(Params params) {
+		this.params = params;
+	}
+
+	public void tableChanged(TableModelEvent e) {
+		callStateChanged();
+	}
+
+	/**
+	 * Cambio de estado para el check de inversa
+	 * @param e
+	 */
+	public void stateChanged(ChangeEvent e) {
+		if(e.getSource().equals(getTransparencyActive())) {
+			if(((JCheckBox)e.getSource()).isSelected() != lastTransp) {
+				callStateChanged();
+				lastTransp = ((JCheckBox)e.getSource()).isSelected();
+			}
+		}
+		if(e.getSource().equals(getInverse())) {
+			if(((JCheckBox)e.getSource()).isSelected() != lastInv) {
+				callStateChanged();
+				lastInv = ((JCheckBox)e.getSource()).isSelected();
+			}
+		}
+	}
+
+	/**
+	 * Cambio de valor para la entrada de texto para el valor de fondo
+	 * @param e
+	 */
+	public void actionValueChanged(EventObject e) {
+		callStateChanged();
+	}
+	
+	public void addFilterUIListener(FilterUIListener listener) {
+		if (!actionCommandListeners.contains(listener))
+			actionCommandListeners.add(listener);
+	}
+
+	public void callStateChanged() {
+		Iterator<FilterUIListener> acIterator = actionCommandListeners.iterator();
+		while (acIterator.hasNext()) {
+			FilterUIListener listener = (FilterUIListener) acIterator.next();
+			listener.actionValuesCompleted(new EventObject(this));
+		}
+	}
+
+	public void removeStateChangedListener(FilterUIListener listener) {
+		actionCommandListeners.remove(listener);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask/MaskUI.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/mask
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/ui/FilterDialog.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/ui/FilterDialog.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/ui/FilterDialog.java	(revision 8183)
@@ -0,0 +1,130 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ */
+package org.gvsig.raster.tools.app.basic.tool.filter.ui;
+
+import java.awt.BorderLayout;
+
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.andami.ui.mdiManager.IWindowListener;
+import org.gvsig.andami.ui.mdiManager.WindowInfo;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+
+/**
+ * Dialogo para los filtros de raster.
+ *
+ * @version 25/02/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class FilterDialog extends JPanel implements IWindow, IWindowListener, ButtonsPanelListener {
+	private static final long serialVersionUID  = 818691082984915388L;
+	private FLyrRaster        layer             = null;
+	private FilterPanel       filterPanel       = null;
+
+	/**
+	 * Constructor
+	 * @param width Ancho
+	 * @param height Alto
+	 */
+	public FilterDialog(FLyrRaster layer, int width, int height) {
+		this.layer = layer;
+		setSize(width, height);
+		setLayout(new BorderLayout(5, 5));
+		add(getFilterPanel(), java.awt.BorderLayout.CENTER);
+	}
+
+	/**
+	 * Obtiene el panel con el histograma
+	 * @return HistogramPanel
+	 */
+	private FilterPanel getFilterPanel() {
+		if (filterPanel == null) {
+			filterPanel = new FilterPanel(layer, this);
+		}
+		return filterPanel;
+	}
+
+	/**
+	 * Acciones a ejecutar cuando se cancela
+	 */
+	private void close() {
+		try {
+			RasterLocator.getManager().getFileUtils().removeOnlyLayerNameListener(getFilterPanel().getNewLayerPanel().getPanelNewLayer());
+			PluginServices.getMDIManager().closeWindow(this);
+		} catch (ArrayIndexOutOfBoundsException e) {
+			//Si la ventana no se puede eliminar no hacemos nada
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.andami.ui.mdiManager.IWindow#getWindowInfo()
+	 */
+	public WindowInfo getWindowInfo() {
+		WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODELESSDIALOG | WindowInfo.RESIZABLE | WindowInfo.MAXIMIZABLE);
+		if (layer != null)
+			m_viewinfo.setAdditionalInfo(layer.getName());
+		m_viewinfo.setTitle(PluginServices.getText(this, "filtros"));
+		m_viewinfo.setHeight(this.getHeight());
+		m_viewinfo.setWidth(this.getWidth());
+		return m_viewinfo;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.andami.ui.mdiManager.IWindowListener#windowClosed()
+	 */
+	public void windowClosed() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener#actionButtonPressed(org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent)
+	 */
+	public void actionButtonPressed(ButtonsPanelEvent e) {
+		// Al pulsar Aceptar o Aplicar se ejecuta el aceptar del panel
+		if (e.getButton() == ButtonsPanel.BUTTON_APPLY /*|| e.getButton() == ButtonsPanel.BUTTON_ACCEPT*/) {
+			getFilterPanel().getLayerVisualStatus().restoreVisualStatus(layer);
+			getFilterPanel().apply();
+		}
+
+		// Al pulsar Cancelar la ventana se cierra y se refresca la vista
+		if (e.getButton() == ButtonsPanel.BUTTON_CANCEL) {
+			getFilterPanel().getLayerVisualStatus().restoreVisualStatus(layer);
+			getFilterPanel().cancel();
+		}
+
+		if (e.getButton() == ButtonsPanel.BUTTON_ACCEPT) {
+			getFilterPanel().getPreviewBasePanel().closePreviewLayer();
+			close();
+		}
+	}
+
+	public void windowActivated() {}
+
+	public Object getWindowProfile() {
+		return WindowInfo.PROPERTIES_PROFILE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/ui/FilterDialog.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/ui/FilterPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/ui/FilterPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/ui/FilterPanel.java	(revision 8183)
@@ -0,0 +1,535 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2006 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.tools.app.basic.tool.filter.ui;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultListModel;
+import javax.swing.JCheckBox;
+import javax.swing.JPanel;
+import javax.swing.border.TitledBorder;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Param;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.ROIException;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.imagenavigator.ImageUnavailableException;
+import org.gvsig.gui.beans.propertiespanel.PropertiesComponent;
+import org.gvsig.gui.beans.treelist.TreeListContainer;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.mainplugin.beans.createlayer.CreateLayerPanel;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.swing.RasterSwingLocator;
+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;
+import org.gvsig.raster.tools.app.basic.raster.bean.previewbase.ParamStruct;
+import org.gvsig.raster.tools.app.basic.raster.bean.previewbase.RasterDataSourcePreview;
+import org.gvsig.raster.tools.app.basic.tool.filter.FilterListener;
+import org.gvsig.raster.util.LayerVisualStatusList;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Dialogo para los filtros de raster.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ * @author BorSanZa - Borja S�nchez Zamorano
+ */
+public class FilterPanel extends JPanel implements PreviewRenderProcess {
+	private static final long      serialVersionUID    = 7152780112689637266L;
+	private Logger                 log                 = LoggerFactory.getLogger(FilterPanel.class);
+
+	private PreviewPanel           previewBasePanel    = null;
+	private FLyrRaster             layer               = null;
+	private FilterListener         filterListener      = null;
+	private PropertiesComponent    propertiesComponent = null;
+
+	private LayerVisualStatusList  status              = new LayerVisualStatusList();
+	private JCheckBox              jCBShowFilters      = null;
+	private String                 viewName            = null;
+	private JPanel                 jPanelOptions       = null;
+	private FilterMainPanel        filterMain          = null;
+	private FilterDialog           filterDialog        = null;
+	private CreateLayerPanel       newLayerPanel       = null;
+	private boolean                showPreview         = true;
+
+	/**
+	 * Constructor
+	 * @param width Ancho del panel
+	 * @param height Alto del panel
+	 */
+	public FilterPanel(FLyrRaster layer, FilterDialog filterDialog) {
+		this.filterDialog = filterDialog;
+		setLayer(layer);
+		initialize();
+	}
+
+	private void initialize() {
+		translate();
+		setLayout(new BorderLayout());
+		add((Component)getPreviewBasePanel(), BorderLayout.CENTER);
+	}
+
+	/**
+	 * Seccion donde ir�n todas las traducciones invariables del componente
+	 */
+	private void translate() {
+		getCBShowFilters().setText(PluginServices.getText(this, "aplicar_vista_previa"));
+	}
+
+	/**
+	 * Obtiene el panel con el histograma
+	 * @return HistogramPanel
+	 */
+	public PreviewPanel getPreviewBasePanel() {
+		if (previewBasePanel == null) {
+			ArrayList<PreviewBasePanelTab> list = new ArrayList<PreviewBasePanelTab>();
+			list.add(getMainPanel());
+
+			IProjection viewProj = null;
+			if(layer.getMapContext() != null)
+				viewProj = layer.getMapContext().getProjection();
+			RasterDataSourcePreview source = new RasterDataSourcePreview((FLyrRaster)layer, viewProj);
+			previewBasePanel = RasterSwingLocator.getSwingManager().createPreviewPanel(
+					ButtonsPanel.BUTTONS_ACCEPTCANCELAPPLY,
+					list,
+					null,
+					panelOptions(),
+					this,
+					source);
+			previewBasePanel.setPreviewSize(new Dimension(230, 215));
+			previewBasePanel.addButtonPressedListener(filterDialog);
+		}
+		return previewBasePanel;
+	}
+
+	/**
+	 * Devuelve el componente <code>FilterListener</code>, que contendr� el
+	 * proceso en si del panel
+	 */
+	private FilterListener getFilterListener() {
+		if (filterListener == null) {
+			filterListener = new FilterListener(this);
+		}
+
+		return filterListener;
+	}
+
+	/**
+	 * Devuelve el panel de Opciones, en caso de no existir, lo crea.
+	 * @return
+	 */
+	private JPanel panelOptions() {
+		if (jPanelOptions == null) {
+			jPanelOptions = new JPanel();
+
+			GridBagConstraints gridBagConstraints;
+
+			jPanelOptions.setLayout(new GridBagLayout());
+
+			gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.gridx = 0;
+			gridBagConstraints.gridy = 1;
+			gridBagConstraints.anchor = GridBagConstraints.WEST;
+			gridBagConstraints.insets = new Insets(2, 2, 2, 2);
+			jPanelOptions.add(getCBShowFilters(), gridBagConstraints);
+
+			gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.gridx = 0;
+			gridBagConstraints.gridy = 4;
+			gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+			gridBagConstraints.insets = new Insets(3, 3, 3, 3);
+			jPanelOptions.add(getNewLayerPanel().getJPanel(), gridBagConstraints);
+
+			gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.gridx = 0;
+			gridBagConstraints.gridy = 5;
+			gridBagConstraints.weightx = 1.0;
+			gridBagConstraints.weighty = 1.0;
+			jPanelOptions.add(new JPanel(), gridBagConstraints);
+		}
+
+		return jPanelOptions;
+	}
+
+	public CreateLayerPanel getNewLayerPanel() {
+		if (newLayerPanel == null) {
+			newLayerPanel = new CreateLayerPanel(layer);
+			 if(layer.isRemote())
+				 newLayerPanel.disableNewLayer();
+		}
+		return newLayerPanel;
+	}
+
+	/**
+	 * Construye el arbol para el men� de filtros disponibles
+	 */
+	private void menuBuild() {
+		Hashtable<String, RasterFilter> keys = new Hashtable<String, RasterFilter>();
+		RasterFilterList filterList = layer.getRender().getFilterList();
+
+		int dataType = layer.getDataStore().getDataType()[0];
+		if( filterList.getByName("enhanced_stretch") != null ||
+			filterList.getByName("enhanced") != null ||
+			filterList.getByName("colortable") != null)
+			dataType = Buffer.TYPE_BYTE;
+		List<Class<?>>  registeredFilters = filterList.getRegisteredFilterListByDataType(dataType);
+
+		int count = 0;
+		RasterFilter obj = null;
+
+		for (int i = 0; i < registeredFilters.size(); i++) {
+			Class<?> classFilter = (Class<?>) registeredFilters.get(i);
+
+			try {
+				obj = (RasterFilter) classFilter.newInstance();
+
+				initFilter(obj);
+
+				if (!obj.isVisible())
+					continue;
+
+				// Crear grupos de los filtros
+				if (!keys.containsKey(Messages.getText(new String(obj.getGroup())))) {
+					keys.put(Messages.getText(new String(obj.getGroup())), obj);
+					getMainPanel().getTreeListContainer().addClass(Messages.getText(new String(obj.getGroup())), count);
+					count++;
+
+				}
+				// Crear cada entrada de los filtro
+				String[] names = obj.getNames();
+				for (int j = 0; j < names.length; j++) {
+					obj.setName(names[j]);
+					getFilterListener().addNewParam(names[j], initFilterParam(obj.getUIParams(names[j])), classFilter);
+					getMainPanel().getTreeListContainer().addEntry(Messages.getText(names[j]), Messages.getText(obj.getGroup()), names[j]);
+				}
+			} catch (InstantiationException e) {
+				log.debug("Error: the filter cannot be added to the list", this, e);
+			} catch (IllegalAccessException e) {
+				log.debug("Error: the filter cannot be added to the list", this, e);
+			}
+		}
+
+		getMainPanel().getTreeListContainer().getTree().expandRow(0);
+	}
+
+	/**
+	 * Pasamos los parametros basicos a un filtro
+	 * @param filter
+	 */
+	private void initFilter(RasterFilter filter) {
+		if (layer != null) {
+			filter.getEnv().put("SrcDataType", layer.getDataStore().getDataType()[0]);
+			filter.getEnv().put("SrcBandCount", layer.getDataStore().getBandCount());
+			filter.getEnv().put("SrcStatistics", layer.getDataStore().getStatistics());
+			filter.getEnv().put("Transparency", layer.getDataStore().getTransparency());
+			try {
+				filter.getEnv().put("SrcROI", layer.getRois());
+			} catch (ROIException e1) {
+				log.debug("Error reading ROI from the layer", this, e1);
+			}
+		}
+	}
+
+	/**
+	 * Sirve para a�adir mas parametros genericos por defecto al panel, de momento
+	 * solo he puesto para activar o desactivar un filtro.
+	 * @param params
+	 * @return
+	 */
+	private Params initFilterParam(Params params) {
+		params.setParam("enabled", new Boolean(true), Params.CHECK, null);
+		Param param = params.getParamById("enabled");
+		params.getParams().remove(params.getParams().size() - 1);
+		params.getParams().add(0, param);
+		return params;
+	}
+
+	/**
+	 * Comprueba que el nombre del filtro esta cargado en las extensiones
+	 * @param filter
+	 * @return
+	 */
+	private boolean hasThisFilter(String filter) {
+		RasterFilterList filterList = RasterLocator.getManager().createEmptyFilterList(Buffer.TYPE_BYTE);
+		List<Class<?>> registeredFilters = filterList.getRegisteredFilterList();
+
+		boolean error;
+		RasterFilter obj = null;
+
+		for (int i = 0; i < registeredFilters.size(); i++) {
+			Class<?> classFilter = (Class<?>) registeredFilters.get(i);
+			error = true;
+
+			try {
+				obj = (RasterFilter) classFilter.newInstance();
+				error = false;
+			} catch (InstantiationException e) {
+			} catch (IllegalAccessException e) {
+			}
+
+			if (!error) {
+				String[] names = obj.getNames();
+				for (int j = 0; j < names.length; j++)
+					if (filter.equals(names[j]))
+						return true;
+			}
+		}
+		return false;
+	}
+
+	/**
+	 * Definir el FLayer del panel, haciendo todas las cargas necesarias despues
+	 * de especificarlo.
+	 * @param layer
+	 */
+	private void setLayer(FLyrRaster layer) {
+		if (layer == null)
+			return;
+
+		this.layer = layer;
+
+		IProjection viewProj = null;
+		if(layer.getMapContext() != null)
+			viewProj = layer.getMapContext().getProjection();
+		RasterDataSourcePreview source = new RasterDataSourcePreview(layer, viewProj);
+		getPreviewBasePanel().setLayer(source);
+
+		// Construimos el arbol de filtros
+		menuBuild();
+
+		IWindow win = PluginServices.getMDIManager().getActiveWindow();
+		AbstractViewPanel view = null;
+		if(win instanceof AbstractViewPanel)
+			view = (AbstractViewPanel) win;
+		else {
+			RasterSwingLibrary.messageBoxInfo("view_not_active", this);
+			return;
+		}
+
+		viewName = PluginServices.getMDIManager().getWindowInfo(view).getTitle();
+
+		//Comprobamos que el raster de salida no exceda los 4GB que es el m�ximo
+		//admisible por un TIFF. Si es as� se hace un setCompress para salvar en JPEG2000
+		long sizeB = (long)(( layer.getDataStore().getWidth() * layer.getDataStore().getWidth() * layer.getDataStore().getBandCount()));
+		int sizeMB = (int)(sizeB / 1048576);
+		if(sizeMB >= 4096) {
+			RasterSwingLibrary.messageBoxInfo("file_too_big", this);
+			getNewLayerPanel().setCompress(true);
+		}
+
+		RasterFilterList rfl = layer.getRender().getFilterList();
+		status.getVisualStatus(layer);
+
+		//Carga el listado de filtros que ya estaban aplicados en la capa al abrir
+
+		int i = 0;
+		boolean filters = false;
+		while (rfl.get(i) != null) {
+			DefaultListModel list = (DefaultListModel) getMainPanel().getTreeListContainer().getListModel();
+			if (rfl.get(i).isVisible() && hasThisFilter(rfl.get(i).getName())) {
+				list.addElement(PluginServices.getText(this, rfl.get(i).getName()));
+				for (int j = 0; j < getFilterListener().getParamsList().size(); j++) {
+					if (((ParamStruct) getFilterListener().getParamsList().get(j)).getFilterName().equals(rfl.get(i).getName())) {
+						filters = true;
+						initFilter(rfl.get(i));
+						((ParamStruct) getFilterListener().getParamsList().get(j)).setFilterParam(initFilterParam(rfl.get(i).getUIParams(rfl.get(i).getName())));
+					}
+				}
+			}
+			i++;
+		}
+
+		// Si existen filtros ya en la capa, pondremos los RadioButton para que
+		// los cambios se hagan sobre la visualizaci�n
+		if (filters)
+			getNewLayerPanel().setOnlyView(true);
+
+		// Selecciona el primer item del arbol
+		TreeListContainer lc = getMainPanel().getTreeListContainer();
+		lc.getTree().expandRow(1);
+		lc.getTree().setSelectionInterval(2, 2);
+	}
+
+	public FilterMainPanel getMainPanel() {
+		if (filterMain == null) {
+			filterMain = new FilterMainPanel(getFilterListener());
+			JPanel panel = getNewLayerPanel().getFileNamePanel();
+			panel.setBorder(BorderFactory.createTitledBorder(null, PluginServices.getText(this, "nombre_capa"), TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));
+			filterMain.getCentralPanel().add(panel, BorderLayout.SOUTH);
+		}
+		return filterMain;
+	}
+
+	/**
+	 * Volvemos todo a la normalidad cuando se cancela
+	 */
+	public void cancel() {
+		if (layer != null)
+			layer.getMapContext().invalidate();
+	}
+
+	/**
+	 * Cuando se aceptan los cambios en el panel ejecutaremos el aceptar del
+	 * listener
+	 */
+	public void apply() {
+		filterListener.accept();
+	}
+
+	/**
+	 * Obtener el PropertiesComponent del panel de filtros, en caso de no existir,
+	 * lo crea.
+	 * @return
+	 */
+	public PropertiesComponent getPropertiesComponent() {
+		if (propertiesComponent == null) {
+			propertiesComponent = new PropertiesComponent();
+			getMainPanel().getCentralPanel().add(propertiesComponent, BorderLayout.CENTER);
+
+			propertiesComponent.addStateChangedListener(getFilterListener());
+		}
+		return propertiesComponent;
+	}
+
+	/**
+	 * Asignar un nuevo componente de PropertiesComponent, eliminando el anterior
+	 * que hubiera.
+	 * @param component
+	 * @param name
+	 */
+	public void setNewPropertiesComponent(PropertiesComponent component, String name) {
+		getPropertiesComponent().setVisible(false);
+		this.remove(propertiesComponent);
+		propertiesComponent = null;
+		propertiesComponent = component;
+		getMainPanel().getCentralPanel().add(propertiesComponent, BorderLayout.CENTER);
+		propertiesComponent.addStateChangedListener(getFilterListener());
+		setTitle(name);
+		this.validate();
+	}
+
+	/**
+	 * Asigna el t�tulo al panel
+	 * @param title T�tulo del panel
+	 */
+	public void setTitle(String title) {
+		getPropertiesComponent().setBorder(BorderFactory.createTitledBorder(null, PluginServices.getText(this, "filtro_de") + " " + PluginServices.getText(this, title), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+	}
+
+	/**
+	 * Devuelve el estado de los filtros inicial
+	 * @return VisualStatusLayerStack
+	 */
+	public LayerVisualStatusList getLayerVisualStatus() {
+		return status;
+	}
+
+
+	/**
+	 * Actualizamos la vista previa
+	 */
+	public void refreshPreview() {
+		getPreviewBasePanel().refreshPreview();
+	}
+
+	/**
+	 * Devuelve el FLayer asignado al panel
+	 * @return
+	 */
+	public FLyrRaster getLayer() {
+		return layer;
+	}
+
+
+	/**
+	 * @return the jLabelShowFilters
+	 */
+	public JCheckBox getCBShowFilters() {
+		if (jCBShowFilters == null) {
+			jCBShowFilters = new JCheckBox();
+			jCBShowFilters.addActionListener(getFilterListener());
+			jCBShowFilters.setSelected(true);
+		}
+		return jCBShowFilters;
+	}
+
+	/**
+	 * Obtiene el nombre de la vista
+	 * @return
+	 */
+	public String getViewName() {
+		return viewName;
+	}
+
+	/**
+	 * Especificar el nombre de la nueva capa para el recuadro de texto asign�ndo
+	 * en cada llamada un nombre consecutivo.
+	 */
+	public void updateNewLayerText() {
+		getNewLayerPanel().updateNewLayerText();
+	}
+
+	public void process(DataSourcePreview rendering) throws ImageUnavailableException {
+		if(!showPreview)
+			throw new ImageUnavailableException(Messages.getText("panel_preview_not_available"));
+
+		getFilterListener().drawImage((FLyrRaster)rendering.getSource());
+	}
+
+	/**
+	 * Obtiene el flag que informa de si se est� mostrando la previsualizaci�n o no.
+	 * En caso de no mostrarse se lanza una excepci�n ImageUnavailableExcepcion con el
+	 * mensaje "La previsualizaci�n no est� disponible para este panel"
+	 * @return
+	 */
+	public boolean isShowPreview() {
+		return showPreview;
+	}
+
+	/**
+	 * Asigna el flag para mostrar u ocultar la preview. En caso de no mostrarse se lanza una
+	 * excepci�n ImageUnavailableExcepcion con el mensaje "La previsualizaci�n no est� disponible para
+	 * este panel"
+	 * @param showPreview
+	 */
+	public void setShowPreview(boolean showPreview) {
+		this.showPreview = showPreview;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/ui/FilterPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/ui/FilterMainPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/ui/FilterMainPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/ui/FilterMainPanel.java	(revision 8183)
@@ -0,0 +1,89 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ */
+package org.gvsig.raster.tools.app.basic.tool.filter.ui;
+
+import java.awt.BorderLayout;
+
+import javax.swing.JPanel;
+
+import org.gvsig.gui.beans.treelist.TreeListContainer;
+import org.gvsig.raster.swing.preview.PreviewBasePanelTab;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.tool.filter.FilterListener;
+/**
+ * Es el panel central del panel de filtros. Se compone de dos partes.
+ * El lateral izquierdo contiene la lista de filtros posibles y filtros seleccionados
+ * La parte derecha contiene las opciones de los filtros
+ * En la parte de abajo tenemos el fichero de salida.
+ * 
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public class FilterMainPanel extends JPanel implements PreviewBasePanelTab {
+	private static final long serialVersionUID = -406089078173595028L;
+	private TreeListContainer treeListContainer = null;
+	private JPanel            centralPanel      = null;
+	private FilterListener    filterListener    = null;
+
+	public FilterMainPanel(FilterListener filterListener) {
+		this.filterListener = filterListener;
+		initialize();
+	}
+	
+	private void initialize() {
+		setLayout(new BorderLayout(5, 5));
+		add(getTreeListContainer(), BorderLayout.WEST);
+		add(getCentralPanel(), BorderLayout.CENTER);
+	}
+	
+	public JPanel getPanel() {
+		return this;
+	}
+
+	/**
+	 * This method initializes jPanel
+	 * @return javax.swing.JPanel
+	 */
+	public TreeListContainer getTreeListContainer() {
+		if (treeListContainer == null) {
+			treeListContainer = new TreeListContainer();
+			treeListContainer.getTree().expandRow(0);
+			treeListContainer.addTreeListListener(filterListener);
+			treeListContainer.addChangeSelectionListener(filterListener);
+			treeListContainer.setAddToolTipText(RasterToolsUtil.getText(this, "anadir_filtro"));
+			treeListContainer.setDelToolTipText(RasterToolsUtil.getText(this, "eliminar_filtro"));
+		}
+		return treeListContainer;
+	}
+
+	/**
+	 * Obtener y generar el JPanel central que contendr� las propiedades
+	 * @return
+	 */
+	public JPanel getCentralPanel() {
+		if (centralPanel == null) {
+			centralPanel = new JPanel();
+			centralPanel.setLayout(new BorderLayout());
+		}
+		return centralPanel;
+	}
+	
+	public String getTitle() {
+		return "Filtros";
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/ui/FilterMainPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/ui
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/FilterTocMenuEntry.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/FilterTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/FilterTocMenuEntry.java	(revision 8183)
@@ -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.tools.app.basic.tool.filter;
+
+import javax.swing.Icon;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.layers.ILayerState;
+import org.gvsig.raster.fmap.layers.IRasterLayerActions;
+import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.tool.filter.ui.FilterDialog;
+
+/**
+ * Punto de entrada del menu para los filtros
+ *
+ * @version 02/05/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class FilterTocMenuEntry extends AbstractTocContextMenuAction implements IGenericToolBarMenuItem {
+	static private FilterTocMenuEntry singleton  = null;
+
+	/**
+	 * Nadie puede crear una instancia a esta clase �nica, hay que usar el
+	 * getSingleton()
+	 */
+	private FilterTocMenuEntry() {}
+
+	/**
+	 * Devuelve un objeto unico a dicha clase
+	 * @return
+	 */
+	static public FilterTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new FilterTocMenuEntry();
+		return singleton;
+	}
+	
+	public String getGroup() {
+		return "Enhanced";
+	}
+
+	public int getGroupOrder() {
+		return 55;
+	}
+
+	public int getOrder() {
+		return 0;
+	}
+
+	public String getText() {
+		return RasterToolsUtil.getText(this, "filtros");
+	}
+
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof ILayerState))
+			return false;
+
+		if (!((ILayerState) selectedItems[0]).isOpen())
+			return false;
+
+		FLyrRaster lyr = (FLyrRaster)selectedItems[0];
+		if(lyr.getDataStore().getDataType()[0] != Buffer.TYPE_BYTE) {
+			RasterFilterList filterList = lyr.getRender().getFilterList();
+			if(filterList != null) {
+				if(filterList.get("enhanced_stretch") != null)
+					return true;
+				else
+					return false;
+			}
+		}
+		return true;
+	}
+
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof IRasterLayerActions))
+			return false;
+		
+		return ((IRasterLayerActions) selectedItems[0]).isActionEnabled(IRasterLayerActions.FILTER);
+	}
+
+	public void execute(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1) || (!(selectedItems[0] instanceof FLyrRaster)))
+			return;
+
+		FilterDialog rasterFilterDialog = new FilterDialog((FLyrRaster) selectedItems[0], 740, 400);
+		PluginServices.getMDIManager().addCentredWindow(rasterFilterDialog);
+	}
+	
+	public Icon getIcon() {
+		return RasterToolsUtil.getIcon("layer-filter-raster");
+	}
+	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/FilterTocMenuEntry.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/grayscale/GrayScaleFilter.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/grayscale/GrayScaleFilter.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/grayscale/GrayScaleFilter.java	(revision 8183)
@@ -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.tools.app.basic.tool.filter.grayscale;
+
+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.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/grayscale/GrayScaleFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/grayscale/GrayScaleByteFilter.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/grayscale/GrayScaleByteFilter.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/grayscale/GrayScaleByteFilter.java	(revision 8183)
@@ -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.tools.app.basic.tool.filter.grayscale;
+
+
+/**
+ * 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.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/grayscale/GrayScaleByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/grayscale/GrayScaleManager.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/grayscale/GrayScaleManager.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/grayscale/GrayScaleManager.java	(revision 8183)
@@ -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.tools.app.basic.tool.filter.grayscale;
+
+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.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);
+		}
+	}
+
+	@SuppressWarnings("unchecked")
+	public ArrayList getRasterFilterList() {
+		ArrayList filters = new ArrayList();
+		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.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/grayscale/GrayScaleManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/grayscale
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/data/ColorTableData.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/data/ColorTableData.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/data/ColorTableData.java	(revision 8183)
@@ -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.tools.app.basic.tool.colortable.data;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Iterator;
+
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.fmap.dal.coverage.util.PropertyEvent;
+import org.gvsig.fmap.dal.coverage.util.PropertyListener;
+/**
+ * Clase para intentar centralizar los datos del panel de Color. La idea es que
+ * cada subpanel solo tenga acceso a este centro de datos y desde aqui se lancen
+ * eventos
+ * 
+ * @version 27/09/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class ColorTableData {
+	private ArrayList<PropertyListener>  
+						actionCommandListeners = new ArrayList<PropertyListener>();
+	private Hashtable<String, Object> 
+	                    options = new Hashtable<String, Object>();
+
+	/**
+	 * @return the colorTable
+	 */
+	public ColorTable getColorTable() {
+		return (ColorTable) options.get("colorTable");
+	}
+
+	/**
+	 * @param colorTable the colorTable to set
+	 */
+	public void setColorTable(ColorTable colorTable) {
+		setOption("colorTable", colorTable);
+	}
+
+	/**
+	 * Devuelve el minimo valor de una tabla de color
+	 * @return
+	 */
+	public double getMinim() {
+		Double d = (Double) options.get("minim");
+		if (d != null)
+			return d.doubleValue();
+		return 0;
+	} 
+
+	/**
+	 * Devuelve el maximo valor de una tabla de color
+	 * @return
+	 */
+	public double getMaxim() {
+		Double d = (Double) options.get("maxim");
+		if (d != null)
+			return d.doubleValue();
+		return 255;
+	}
+	
+	/**
+	 * Devuelve si esta activado el checkbox de limites
+	 * @return
+	 */
+	public boolean isLimitsEnabled() {
+		Boolean b = (Boolean) options.get("limits");
+		if (b != null)
+			return b.booleanValue();
+		return false;
+	}
+	
+	/**
+	 * Establece el minimo de una tabla de color
+	 * @param value
+	 */
+	public void setMinim(double value) {
+		setOption("minim", new Double(value));
+	}
+	
+	/**
+	 * Establece el maximo de una tabla de color
+	 * @param value
+	 */
+	public void setMaxim(double value) {
+		setOption("maxim", new Double(value));
+	}
+	
+	/**
+	 * Establece si se ha cambiado el valor activo de los limites
+	 * @param value
+	 */
+	public void setLimitsEnabled(boolean value) {
+		setOption("limits", new Boolean(value));
+	}
+
+	/**
+	 * Devuelve si esta interpolado la tabla de color
+	 * @return
+	 */
+	public boolean isInterpolated() {
+		Boolean n = (Boolean) options.get("interpolated");
+		if (n != null)
+			return n.booleanValue();
+		return true;
+	}
+
+	/**
+	 * Define si ha cambiado la interpolacion
+	 * @param value
+	 */
+	public void setInterpolated(boolean value) {
+		setOption("interpolated", new Boolean(value));
+	}
+
+	/**
+	 * Devuelve si esta activo el panel
+	 * @return
+	 */
+	public boolean isEnabled() {
+		Boolean n = (Boolean) options.get("enabled");
+		if (n != null)
+			return n.booleanValue();
+		return true;
+	}
+
+	/**
+	 * Define si el panel esta activo
+	 * @param value
+	 */
+	public void setEnabled(boolean value) {
+		setOption("enabled", new Boolean(value));
+	}
+
+	/**
+	 * Refresca la vista previa
+	 */
+	public void refreshPreview() {
+		setOption("refreshPreview", new Boolean(true));
+	}
+
+	/**
+	 * Especifica el valor de una variable
+	 * @param name
+	 * @param value
+	 */
+	private void setOption(String name, Object value) {
+		options.put(name, value);
+		callValueChangedListeners(name, value);
+	}
+
+	/**
+	 * A�adir un listener a la lista de eventos
+	 * @param listener
+	 */
+	public void addValueChangedListener(PropertyListener listener) {
+		if (!actionCommandListeners.contains(listener))
+			actionCommandListeners.add(listener);
+	}
+
+	/**
+	 * Borrar un listener de la lista de eventos
+	 * @param listener
+	 */
+	public void removeValueChangedListener(PropertyListener listener) {
+		actionCommandListeners.remove(listener);
+	}
+
+	/**
+	 * Invocar a los eventos asociados al componente
+	 */
+	private void callValueChangedListeners(String name, Object value) {
+		Iterator<PropertyListener> acIterator = actionCommandListeners.iterator();
+		while (acIterator.hasNext()) {
+			PropertyListener listener = (PropertyListener) acIterator.next();
+			listener.actionValueChanged(new PropertyEvent(this, name, value, null));
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/data/ColorTableData.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/data
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/AddLibraryPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/AddLibraryPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/AddLibraryPanel.java	(revision 8183)
@@ -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.tools.app.basic.tool.colortable.ui.library;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.raster.bean.stretchselector.StretchSelectorPanel;
+import org.gvsig.raster.util.BasePanel;
+
+/**
+ * Ventana que contiene el panel de a�adir librer�a de tablas de color.
+ * 
+ * 06/08/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class AddLibraryPanel extends BasePanel {
+	private static final long serialVersionUID  = 1L;
+	private StretchSelectorPanel  stretchListPanel  = null;
+	private JPanel            libraryName       = null;
+	private JTextField        jTextName         = null;
+	private JLabel            jLabelName        = null;
+	
+	/**
+	 * Constructor. Llama al inicializador de componentes gr�ficos
+	 */
+	public AddLibraryPanel() {
+		init();
+		translate();
+	}
+	
+	/**
+	 * Inicializa los componentes gr�ficos
+	 */
+	protected void init() {
+		GridBagConstraints gridBagConstraints = new GridBagConstraints();
+	    setLayout(new GridBagLayout());
+	    gridBagConstraints.weightx = 1;
+	    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+	    add(getLibraryNamePanel(), gridBagConstraints);
+	    gridBagConstraints.gridy = 1;
+	    add(getStretchListPanel(), gridBagConstraints);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.util.BasePanel#translate()
+	 */
+	protected void translate() {
+	}
+	
+	/**
+	 * Obtiene el componente para introducir tramos
+	 * @return StretchListPanel
+	 */
+	public StretchSelectorPanel getStretchListPanel() {
+		if(stretchListPanel == null)
+			stretchListPanel = new StretchSelectorPanel();
+		return stretchListPanel;
+	}
+	
+	/**
+	 * Obtiene el panel con el nombre de la librer�a.
+	 * @return JPanel
+	 */
+	private JPanel getLibraryNamePanel() {
+		if(libraryName == null) {
+			libraryName = new JPanel();
+			libraryName.setLayout(new GridBagLayout());
+			GridBagConstraints gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+			gridBagConstraints.insets = new Insets(5, 5, 2, 2);
+			libraryName.add(getLabelName(), gridBagConstraints);
+
+			gridBagConstraints.weightx = 1;
+			gridBagConstraints.insets = new Insets(5, 2, 2, 5);
+			libraryName.add(getLibraryName(), gridBagConstraints);
+		}
+		return libraryName;
+	}
+	
+	/**
+	 * Obtiene la etiqueta con el nombre de librer�a
+	 * @return JLabel
+	 */
+	private JLabel getLabelName() {
+		if(jLabelName == null) 
+			jLabelName = new JLabel(RasterToolsUtil.getText(this, "nombre") + ":");
+		return jLabelName;
+	}
+	
+	/**
+	 * Obtiene el nombre de la librer�a
+	 * @return JTextField
+	 */
+	public JTextField getLibraryName() {
+		if(jTextName == null)
+			jTextName = new JTextField(RasterToolsUtil.getText(this, "nueva_libreria"));
+		return jTextName;
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/AddLibraryPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/ColorTableLibraryEvent.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/ColorTableLibraryEvent.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/ColorTableLibraryEvent.java	(revision 8183)
@@ -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.raster.tools.app.basic.tool.colortable.ui.library;
+
+import java.util.EventObject;
+/**
+ * Eventos para ColorTableLibrary
+ *
+ * @version 07/08/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class ColorTableLibraryEvent extends EventObject {
+	private static final long serialVersionUID = -1649548367781607532L;
+
+	public ColorTableLibraryEvent(Object source) {
+		super(source);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/ColorTableLibraryEvent.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/ColorTableLibraryListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/ColorTableLibraryListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/ColorTableLibraryListener.java	(revision 8183)
@@ -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.raster.tools.app.basic.tool.colortable.ui.library;
+
+import java.util.EventListener;
+/**
+ * Personalizacion del evento listener para el ColorTableLibrary
+ *
+ * @version 07/08/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public interface ColorTableLibraryListener extends EventListener {
+	/**
+	 * Evento que se dispara cuando cambia el valor del componente.
+	 * @param e
+	 */
+	public void actionColorTableChanged(ColorTableLibraryEvent e);
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/ColorTableLibraryListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/ColorTableIconPainter.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/ColorTableIconPainter.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/ColorTableIconPainter.java	(revision 8183)
@@ -0,0 +1,131 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.colortable.ui.library;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.datastruct.ColorItem;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.gui.ColorTablePainter;
+import org.gvsig.gui.beans.listview.IIconPaint;
+/**
+ * Clase para dibujar los iconos del ListViewComponent del panel de color. Se
+ * puede indicar si la paleta esta seleccionada y si se dibuja con
+ * interpolaciones.
+ * 
+ * @version 29/06/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class ColorTableIconPainter implements IIconPaint, ColorTablePainter {
+	private ColorTable colorTable;
+
+	/**
+	 * Construye un ColorTablePaint con una tabla de color pasada por parametro
+	 * @param colorTable
+	 */
+	public ColorTableIconPainter(ColorTable colorTable) {
+		this.colorTable = colorTable;
+	}
+
+	/**
+	 * Define si los valores estan interpolados o no entre si
+	 * @param value
+	 */
+	public void setInterpolated(boolean value) {
+		colorTable.setInterpolated(value);
+	}
+
+	/**
+	 * Obtiene el ColorTable
+	 * @return
+	 */
+	public ColorTable getColorTable() {
+		return colorTable;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.ColorTablePainter#getColors()
+	 */
+	public Color[] getColors() {
+		List<ColorItem> cItem = colorTable.getColorItems();
+		Color[] colorList = new Color[cItem.size()];
+		for (int i = 0; i < colorList.length; i++) {
+			colorList[i] = cItem.get(i).getColor();
+		}
+		return colorList;
+	}
+
+	/**
+	 * Metodo de pintado de la tabla de color
+	 * @param g
+	 * @param isSelected
+	 */
+	public void paint(Graphics2D g, boolean isSelected) {
+		Rectangle area = g.getClipBounds();
+
+		int x1 = area.x;
+		int x2 = area.x + area.width - 1;
+
+		Color bgColor = new Color(224, 224, 224);
+		for (int i = 0; (i * 4) <= area.width; i++) {
+			for (int j = 0; (j * 4) <= area.height; j++) {
+				if ((i + j) % 2 == 0)
+					g.setColor(Color.white);
+				else
+					g.setColor(bgColor);
+				g.fillRect(area.x + 1 + i * 4, area.y + 1 + j * 4, 4, 4);
+			}
+		}		
+		
+		if (colorTable.getColorItems().size() >= 1) {
+			double min = ((ColorItem) colorTable.getColorItems().get(0)).getValue();
+			double max = ((ColorItem) colorTable.getColorItems().get(colorTable.getColorItems().size() - 1)).getValue();
+			for (int i = area.x; i < (area.x + area.width); i++) {
+				double pos = min + (((max - min) * (i - area.x)) / (area.width - 2));
+
+				byte[] col3 = colorTable.getRGBAByBand(pos);
+				g.setColor(new Color(col3[0] & 0xff, col3[1] & 0xff, col3[2] & 0xff, col3[3] & 0xff));
+				g.drawLine(i, area.y, i, area.y + area.height);
+			}
+		} else {
+			g.setColor(new Color(224, 224, 224));
+			g.fillRect(x1, area.y, x2 - x1, area.height - 1);
+		}
+		if (isSelected)
+			g.setColor(Color.black);
+		else
+			g.setColor(new Color(96, 96, 96));
+		g.drawRect(x1, area.y, x2 - x1, area.height - 1);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.ColorTablePainter#getTableName()
+	 */
+	public String getTableName() {
+		return colorTable.getName();
+	}	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/ColorTableIconPainter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/RasterColorTablesFactory.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/RasterColorTablesFactory.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/RasterColorTablesFactory.java	(revision 8183)
@@ -0,0 +1,81 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.colortable.ui.library;
+
+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.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.gui.ColorTablePainter;
+import org.gvsig.gui.ColorTablesFactory;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+
+/**
+ * Factory for color tables. This factory is useful to register color tables
+ * in gvSIG.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class RasterColorTablesFactory implements ColorTablesFactory {
+	private ColorTableLibrary tableLib               = null;
+	
+	public RasterColorTablesFactory() {
+		RasterManager rManager = RasterLocator.getManager();
+		tableLib = rManager.getDataStructFactory().getColorTableLibrary();		
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.ColorTablesFactory#createColorTables()
+	 */
+	public List<ColorTablePainter> createColorTables() {
+		try {
+			List<ColorTablePainter> result = new ArrayList<ColorTablePainter>();
+			ArrayList<String> fileList = tableLib.getPaletteFileList(ColorTableLibraryPanel.palettesPath);
+			for (int i = 0; i < fileList.size(); i++) {
+				ArrayList<ColorItem> paletteItems = new ArrayList<ColorItem>();
+				String paletteName = tableLib.loadPalette(ColorTableLibraryPanel.palettesPath, (String) fileList.get(i), paletteItems);
+
+				if (paletteItems.size() <= 0)
+					continue;
+
+				ColorTable colorTable = tableLib.createColorTable();
+				colorTable.setName(paletteName);
+				colorTable.createPaletteFromColorItems(paletteItems, true);
+				colorTable.setInterpolated(true);
+
+				ColorTablePainter painter = new ColorTableIconPainter(colorTable);
+				result.add(painter);
+			}
+			return result;
+		} catch (FilePaletteException e) {
+			RasterSwingLibrary.messageBoxError(e.getMessage(), this, e);
+		}
+		return null;
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/RasterColorTablesFactory.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/AddLibraryWindow.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/AddLibraryWindow.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/AddLibraryWindow.java	(revision 8183)
@@ -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.tools.app.basic.tool.colortable.ui.library;
+
+import java.awt.Component;
+import java.util.ArrayList;
+
+import javax.swing.JOptionPane;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.ColorItem;
+import org.gvsig.fmap.dal.coverage.datastruct.ColorTableLibrary;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.raster.tools.app.basic.raster.bean.stretchselector.StretchSelectorData;
+
+/**
+ * Ventana para a�adir una nueva libreria. En ella se especificara si queremos
+ * una tabla de color por intervalos o el numero de cortes. La generar� con el
+ * nombre seleccionado y todos los colores seran negros inicialmente.
+ * 
+ * @version 01/10/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class AddLibraryWindow extends JOptionPane {
+	private static final long   serialVersionUID  = 1L;
+	private AddLibraryPanel     libraryPanel      = null;
+	/**
+	 * Si supera el numero de particiones estimado, se le preguntar� al usuario si
+	 * quiere continuar
+	 */
+	private int                 limit_question    = 500;
+	
+	/**
+	 * Devuelve el componente interno del JOptionPane
+	 * @return
+	 */
+	private Object getMessageComponent() {
+		return getLibraryPanel();
+	}
+	
+	/**
+	 * Obtiene el panel AddLibraryPanel
+	 * @return
+	 */
+	public AddLibraryPanel getLibraryPanel() {
+		if(libraryPanel == null)
+			libraryPanel = new AddLibraryPanel();
+		return libraryPanel;
+	}
+
+	/**
+	 * Muestra el di�logo de la creaci�n de la tabla de color. Devolver�
+	 * JOptionPane.OK_OPTION si el usuario le ha dado a aceptar y otro valor en
+	 * caso contrario.
+	 * @param parentComponent
+	 * @return
+	 */
+	public int showConfirm(Component parentComponent) {
+		return showConfirmDialog(
+				parentComponent,
+				getMessageComponent(),
+				PluginServices.getText(this, "nueva_libreria_title"),
+				JOptionPane.OK_CANCEL_OPTION,
+				JOptionPane.PLAIN_MESSAGE);
+	}
+
+	/**
+	 * Devuelve la tabla de color creada segun los parametros especificados en el
+	 * panel.
+	 * @return
+	 */
+	public ColorTable getColorTable() {
+		ColorTableLibrary lib = RasterLocator.getManager().getDataStructFactory().getColorTableLibrary();
+		ColorTable colorTable = lib.createColorTable();
+		colorTable.setName(getLibraryPanel().getLibraryName().getText());
+		ArrayList<ColorItem> items = new ArrayList<ColorItem>();
+
+		StretchSelectorData stretchListData = getLibraryPanel().getStretchListPanel().getData(); 
+		double start = stretchListData.getMinimum();
+		double end = stretchListData.getMaximum();
+
+		if (start > end) {
+			double aux = start;
+			start = end;
+			end = aux;
+		}
+
+		double num = getLibraryPanel().getStretchListPanel().getInterval();
+		boolean quest = false;
+		if (getLibraryPanel().getStretchListPanel().getIntervalNumber().isSelected())
+			quest = (num > limit_question);
+		else
+			quest = (((end - start) / num) > limit_question);
+		if (quest && JOptionPane.showConfirmDialog(this, PluginServices.getText(this, "addlibrary_supera_limite"), PluginServices.getText(this, "confirmar"), JOptionPane.YES_NO_OPTION) == NO_OPTION)
+			return null;
+		if (getLibraryPanel().getStretchListPanel().getIntervalNumber().isSelected()) {
+			for (double i = 0; i <= num; i++) {
+				ColorItem colorItem = lib.createColorItem();
+				colorItem.setValue(start + (((end - start) / num) * i));
+				items.add(colorItem);
+			}
+		} else {
+			for (double i = start; i <= end; i += num) {
+				ColorItem colorItem = lib.createColorItem();
+				colorItem.setValue(i);
+				items.add(colorItem);
+			}
+		}
+
+		colorTable.createPaletteFromColorItems(items, false);
+		return colorTable;
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/AddLibraryWindow.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/ColorTableLibraryPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/ColorTableLibraryPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/ColorTableLibraryPanel.java	(revision 8183)
@@ -0,0 +1,550 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.colortable.ui.library;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.EventObject;
+import java.util.Iterator;
+
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JFileChooser;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.Launcher;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.RasterManager;
+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.exception.RasterLegendIONotFound;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.gui.beans.listview.ListViewComponent;
+import org.gvsig.gui.beans.listview.ListViewItem;
+import org.gvsig.gui.beans.listview.ListViewListener;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.tool.colortable.data.ColorTableData;
+import org.gvsig.raster.util.BasePanel;
+import org.gvsig.raster.util.ExtendedFileFilter;
+/**
+ * Panel que aparece en la parte inferior derecha que contiene la lista
+ * de librerias disponibles para las tablas de color, con sus botones correspondientes
+ * para importar, exportar, borrar y a�adir librerias.
+ * 
+ * 19/02/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class ColorTableLibraryPanel extends BasePanel implements ActionListener, ListViewListener {
+	private static final long serialVersionUID       = 1L;
+	private JPanel            panelButtons           = null;
+	private JButton           buttonAdd              = null;
+	private JButton           buttonDel              = null;
+	private JButton           buttonImport           = null;
+	private JButton           buttonExport           = null;
+	private ListViewComponent listViewComponent      = null;
+	private boolean           hasChanged             = false;
+	private ArrayList<ColorTableLibraryListener>         
+	                          actionCommandListeners = new ArrayList<ColorTableLibraryListener>();
+	private ColorTableData    colorTableData         = null;
+	private ColorTable        currentColorTable      = null;
+	public static String      palettesPath           = Launcher.getAppHomeDir() + File.separator + "colortable";
+	private ColorTableLibrary tableLib               = null;
+	private RasterManager     rManager               = null;
+	
+	/**
+	 *Inicializa componentes gr�ficos y traduce
+	 */
+	public ColorTableLibraryPanel() {
+		init();
+		translate();
+	}
+	
+	public ColorTableLibraryPanel(ColorTableData colorTableData){
+		this.colorTableData = colorTableData;
+		init();
+		translate();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.util.BasePanel#init()
+	 */
+	protected void init() {
+		rManager = RasterLocator.getManager();
+		tableLib = rManager.getDataStructFactory().getColorTableLibrary();
+		setLayout(new BorderLayout());
+		
+		JPanel panel = new JPanel();
+		panel.setLayout(new BorderLayout());
+		panel.setBorder(javax.swing.BorderFactory.createEmptyBorder(8, 8, 8, 8));
+		
+		JScrollPane jScrollPane = new JScrollPane();
+		jScrollPane.setViewportView(getListViewComponent());
+		jScrollPane.setAutoscrolls(true);
+		
+		panel.add(jScrollPane, BorderLayout.CENTER);
+		add(panel, BorderLayout.CENTER);
+		add(getPanelButtons(), BorderLayout.SOUTH);
+		setPreferredSize(new Dimension(0, 192));
+
+		loadDiskLibrary();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.util.BasePanel#translate()
+	 */
+	protected void translate() {
+	}
+	
+	private void loadDiskLibrary() {
+		try {
+			ArrayList<String> fileList = tableLib.getPaletteFileList(palettesPath);
+			for (int i = 0; i < fileList.size(); i++) {
+				ArrayList<ColorItem> paletteItems = new ArrayList<ColorItem>();
+				String paletteName = tableLib.loadPalette(palettesPath, (String) fileList.get(i), paletteItems);
+
+				if (paletteItems.size() <= 0)
+					continue;
+
+				ColorTable colorTable = tableLib.createColorTable();
+				colorTable.setName(paletteName);
+				colorTable.createPaletteFromColorItems(paletteItems, true);
+				colorTable.setInterpolated(true);
+
+				ListViewItem item = new ListViewItem(new ColorTableIconPainter(colorTable), paletteName);
+				item.setTag(fileList.get(i));
+				getListViewComponent().addItem(item);
+			}
+			getListViewComponent().sort();
+			getListViewComponent().setSelectedIndex(0);
+			callColorTableChanged();
+		} catch (FilePaletteException e) {
+			RasterSwingLibrary.messageBoxError(e.getMessage(), this, e);
+		}
+	}
+	
+	/**
+	 * Devuelve el jButtonAdd
+	 * @return
+	 */
+	private JButton getButtonAdd() {
+		if (buttonAdd == null) {
+			ImageIcon icon = null;
+			try {
+				icon = IconThemeHelper.getImageIcon("addlayer-icon");
+			} catch (NullPointerException n) {
+				// No ha encontrado el icono, no lo muestra.
+			}
+
+			buttonAdd = new JButton(icon);
+			buttonAdd.setPreferredSize(new Dimension(22, 19));
+			buttonAdd.addActionListener(this);
+			buttonAdd.setToolTipText(getText(this, "nueva_libreria_title"));
+		}
+		return buttonAdd;
+	}
+
+	/**
+	 * Devuelve el jButtonDel
+	 * @return
+	 */
+	private JButton getButtonDel() {
+		if (buttonDel == null) {
+			ImageIcon icon = null;
+			try {
+				icon = IconThemeHelper.getImageIcon("delall-icon");
+			} catch (NullPointerException n) {
+				// No ha encontrado el icono, no lo muestra.
+			}
+			buttonDel = new JButton(icon);
+			buttonDel.setPreferredSize(new Dimension(22, 19));
+			buttonDel.addActionListener(this);
+			buttonDel.setToolTipText(getText(this, "borrar_libreria"));
+		}
+		return buttonDel;
+	}
+
+	/**
+	 * Devuelve el jButtonDel
+	 * @return
+	 */
+	private JButton getButtonImport() {
+		if (buttonImport == null) {
+			ImageIcon icon = null;
+			try {
+				icon = IconThemeHelper.getImageIcon("import-icon");
+			} catch (NullPointerException n) {
+				// No ha encontrado el icono, no lo muestra.
+			}
+			buttonImport = new JButton(icon);
+			buttonImport.setPreferredSize(new Dimension(22, 19));
+			buttonImport.addActionListener(this);
+			buttonImport.setToolTipText(getText(this, "import_libreria"));
+		}
+		return buttonImport;
+	}
+
+	/**
+	 * Devuelve el jButtonDel
+	 * @return
+	 */
+	private JButton getButtonExport() {
+		if (buttonExport == null) {
+			ImageIcon icon = null;
+			try {
+				icon = IconThemeHelper.getImageIcon("view-export-image");
+			} catch (NullPointerException n) {
+				// No ha encontrado el icono, no lo muestra.
+			}
+			buttonExport = new JButton(icon);
+			buttonExport.setPreferredSize(new Dimension(22, 19));
+			buttonExport.addActionListener(this);
+			buttonExport.setToolTipText(getText(this, "export_libreria"));
+		}
+		return buttonExport;
+	}
+	
+	/**
+	 * Devuelve el panel de botones de la libreria de a�adir y borrar
+	 * @return
+	 */
+	private JPanel getPanelButtons() {
+		if (panelButtons == null) {
+			panelButtons = new JPanel();
+			panelButtons.setPreferredSize(new Dimension(0, 21));
+
+			FlowLayout flowLayout5 = new FlowLayout();
+			flowLayout5.setHgap(5);
+			flowLayout5.setVgap(0);
+			flowLayout5.setAlignment(java.awt.FlowLayout.CENTER);
+			panelButtons.setLayout(flowLayout5);
+
+			panelButtons.add(getButtonAdd(), null);
+			panelButtons.add(getButtonExport(), null);
+			panelButtons.add(getButtonImport(), null);
+			panelButtons.add(getButtonDel(), null);
+		}
+		return panelButtons;
+	}
+
+	private ListViewComponent getListViewComponent() {
+		if (listViewComponent == null) {
+			listViewComponent = new ListViewComponent();
+			listViewComponent.addListSelectionListener(this);
+			listViewComponent.setEditable(true);
+		}
+		return listViewComponent;
+	}
+
+	private void callColorTableChanged() {
+		Iterator<ColorTableLibraryListener> acIterator = actionCommandListeners.iterator();
+		while (acIterator.hasNext()) {
+			ColorTableLibraryListener listener = (ColorTableLibraryListener) acIterator.next();
+			listener.actionColorTableChanged(new ColorTableLibraryEvent(this));
+		}
+	}
+	
+	/**
+	 * Accion que se ejecuta cuando se disparan los siguientes eventos:
+	 *  - Checkbox de interpolacion.
+	 *  - Checkbox de habilitacion de colortables.
+	 *  - Boton de a�adir un colortable nuevo.
+	 *  - Boton de borrar un colortable seleccionado.
+	 */
+	public void actionPerformed(ActionEvent e) {
+		if (e.getSource() == getButtonAdd()) {
+			AddLibraryWindow addLibrary = new AddLibraryWindow();
+			if (addLibrary.showConfirm(this) == JOptionPane.OK_OPTION) {
+				ColorTable colorTable = addLibrary.getColorTable();
+				if (colorTable != null) {
+					ListViewItem item = new ListViewItem(new ColorTableIconPainter(colorTable), colorTable.getName());
+					item.setTag(item.getName() + ".xml");
+					getListViewComponent().addItem(item);
+					getListViewComponent().setSelectedIndex(getListViewComponent().getItems().size() - 1);
+					((ColorTableIconPainter) item.getIcon()).getColorTable().setName(item.getName());
+					colorTable.setName(((ColorTableIconPainter) item.getIcon()).getColorTable().getName());
+					tableLib.save_to_1_1(palettesPath, colorTable);
+					callColorTableChanged();
+				}
+			}
+			getListViewComponent().sort();
+		}
+		
+		if (e.getSource() == getButtonExport()) {
+			JFileChooser chooser = new JFileChooser();
+			chooser.setAcceptAllFileFilterUsed(false);
+
+			String[] formats = tableLib.getFormats();
+			ExtendedFileFilter fileFilter = null;
+			ExtendedFileFilter firstFileFilter = null;
+			for (int i = 0; i < formats.length; i++) {
+				fileFilter = new ExtendedFileFilter();
+				fileFilter.addExtension(formats[i]);
+
+				try {
+					String s = RasterLocator.getManager().getFileUtils().getExtensionFromFileName(formats[i]);
+					String desc = rManager.getRasterLegendIO(s).getDescription();
+					if (desc != null)
+						fileFilter.setDescription(desc);
+				} catch (RasterLegendIONotFound e1) {
+					// Si no puedo pillar la descripcion no pasa nada
+				}
+				if (firstFileFilter == null)
+					firstFileFilter = fileFilter;
+
+				chooser.addChoosableFileFilter(fileFilter);
+			}
+			if (firstFileFilter != null)
+				chooser.setFileFilter(firstFileFilter);
+
+			int returnVal = chooser.showSaveDialog(this);
+			if (returnVal == JFileChooser.APPROVE_OPTION) {
+				try {
+					if (colorTableData != null){	
+						tableLib.save_to_1_1(ColorTableLibraryPanel.palettesPath, colorTableData.getColorTable());
+					}
+					ExtendedFileFilter filter = (ExtendedFileFilter) chooser.getFileFilter();
+					String file = filter.getNormalizedFilename(chooser.getSelectedFile());
+					
+					String s = RasterLocator.getManager().getFileUtils().getExtensionFromFileName(file);
+					rManager.getRasterLegendIO(s).write(getColorTableSelected(), new File(file));
+				} catch (IOException e1) {
+					e1.printStackTrace();
+				} catch (RasterLegendIONotFound e1) {
+					e1.printStackTrace();
+				}
+			}
+		}
+
+		if (e.getSource() == getButtonImport()) {
+			JFileChooser chooser = new JFileChooser();
+			chooser.setAcceptAllFileFilterUsed(false);
+			chooser.setMultiSelectionEnabled(true);
+			
+			String[] formats = tableLib.getFormats();
+			ExtendedFileFilter allFilters = new ExtendedFileFilter();
+			ExtendedFileFilter fileFilter = null;
+			for (int i = 0; i < formats.length; i++) {
+				fileFilter = new ExtendedFileFilter();
+				fileFilter.addExtension(formats[i]);
+				allFilters.addExtension(formats[i]);
+
+				try {
+					String s = RasterLocator.getManager().getFileUtils().getExtensionFromFileName((formats[i]));
+					String desc = rManager.getRasterLegendIO(s).getDescription();
+					if (desc != null)
+						fileFilter.setDescription(desc);
+				} catch (RasterLegendIONotFound e1) {
+					// Si no puedo pillar la descripcion no pasa nada
+				}
+
+				chooser.addChoosableFileFilter(fileFilter);
+			}
+			allFilters.setDescription(getText(this, "todos_soportados"));
+			chooser.addChoosableFileFilter(allFilters);
+			chooser.setFileFilter(allFilters);
+
+			int returnVal = chooser.showOpenDialog(this);
+
+			if (returnVal == JFileChooser.APPROVE_OPTION) {
+				try {
+					for (int file = 0; file<chooser.getSelectedFiles().length; file++) {
+						fileFilter = null;
+						for (int i = 0; i < formats.length; i++) {
+							fileFilter = new ExtendedFileFilter();
+							fileFilter.addExtension(formats[i]);
+							if (fileFilter.accept(chooser.getSelectedFiles()[file])) {
+								ColorTable colorTable = rManager.getRasterLegendIO(formats[i]).read(chooser.getSelectedFiles()[file]);
+
+								if (colorTable != null){
+									colorTable.setInterpolated(true);
+
+									ListViewItem item = new ListViewItem(new ColorTableIconPainter(colorTable), colorTable.getName());
+									item.setTag(item.getName() + ".xml");
+									getListViewComponent().addItem(item);
+									getListViewComponent().setSelectedIndex(getListViewComponent().getItems().size() - 1);
+									((ColorTableIconPainter) item.getIcon()).getColorTable().setName(item.getName());
+									colorTable.setName(((ColorTableIconPainter) item.getIcon()).getColorTable().getName());
+									tableLib.save_to_1_1(palettesPath, colorTable);
+									callColorTableChanged();
+								} else {
+									RasterSwingLibrary.messageBoxError("error_importando_tabla_color_rmf", this);
+								}
+								break;
+							}
+						}
+					}
+				} catch (IOException e1) {
+					e1.printStackTrace();
+					RasterSwingLibrary.messageBoxError("error_importando_tabla_color_rmf", this);
+				} catch (RasterLegendIONotFound e1) {
+					e1.printStackTrace();
+				}
+			}
+		}
+
+		if (e.getSource() == getButtonDel()) {
+			if (getListViewComponent().getSelectedIndices().length > 0) {
+				if (RasterSwingLibrary.messageBoxYesOrNot("desea_borrar_librerias", this)) {
+					File oldFile = new File(palettesPath + File.separator + getListViewComponent().getSelectedValue().getTag());
+					oldFile.delete();
+					int pos = getListViewComponent().getSelectedIndices()[0];
+					getListViewComponent().removeSelecteds();
+					
+					if (getListViewComponent().getItems().size() == 0) {
+						loadDiskLibrary();
+					} else {
+						getListViewComponent().setSelectedIndex(pos - 1);
+						callColorTableChanged();
+					}
+				}
+			}
+			return;
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.listview.ListViewListener#actionItemNameChanged(java.util.EventObject, java.lang.String, org.gvsig.gui.beans.listview.ListViewItem)
+	 */
+	public void actionItemNameChanged(EventObject e, String oldName, ListViewItem item) {
+		File oldFile = new File(palettesPath + File.separator + oldName + ".xml");
+		oldFile.delete();
+
+		getColorTableSelected().setName(item.getName());
+		item.setTag(item.getName() + ".xml");
+
+		tableLib.save_to_1_1(palettesPath, getColorTableSelected());
+		
+		callColorTableChanged();
+	}
+
+	/**
+	 * Comprueba si el usuario ha cambiado los valores de la tabla de colores,
+	 * si es as�, le pregunta al usuario si quiere guardar los datos, y seg�n la
+	 * selecci�n, restaura los datos antiguos o los machaca.
+	 */
+	private void testLibraryChanged() {
+		if (hasChanged) {
+			if (RasterSwingLibrary.messageBoxYesOrNot("desea_guardar_cambios", this)) {
+				tableLib.save_to_1_1(palettesPath, getColorTableSelected());
+				getListViewComponent().repaint();
+			}
+			hasChanged = false;
+		}
+	}
+	
+	/**
+	 * Selecciona la tabla de color por defecto.
+	 */
+	public void selectDefault() {
+		int selected = 0;
+		for (int i = 0; i < getListViewComponent().getItems().size(); i++) {
+			if (((ListViewItem) getListViewComponent().getItems().get(i)).getName().equals("Default")) {
+				selected = i;
+				break;
+			}
+		}
+		getListViewComponent().setSelectedIndex(selected);
+		callColorTableChanged();
+	}
+	
+	/**
+	 * Inserta una tabla de color en la posicion especificada y selecciona.
+	 */
+	public void addColorTable(int pos, ColorTable colorTable) {
+		ListViewItem item = new ListViewItem(new ColorTableIconPainter(colorTable), getText(this, "tabla_actual"));
+		getListViewComponent().addItem(pos, item);
+		getListViewComponent().setSelectedIndex(pos);
+		callColorTableChanged();
+	}
+	
+	/**
+	 * Accion que se ejecuta cuando cambia la seleccion de un item del
+	 * ListViewComponent
+	 */
+	public void actionValueChanged(EventObject e) {
+		currentColorTable = ((ColorTableIconPainter) getListViewComponent().getSelectedValue().getIcon()).getColorTable();
+		testLibraryChanged();
+		callColorTableChanged();
+	}
+	
+	/**
+	 * Define si se visualizara el componente con interpolacion o no.
+	 * @param enabled
+	 */
+	public void setInterpolated(boolean enabled) {
+		for (int i = 0; i < getListViewComponent().getItems().size(); i++)
+			((ColorTableIconPainter) ((ListViewItem) getListViewComponent().getItems().get(i)).getIcon()).setInterpolated(enabled);
+		getListViewComponent().repaint();
+	}
+	
+	/**
+	 * A�adir un listener a la lista de eventos
+	 * @param listener
+	 */
+	public void addColorTableLibraryListener(ColorTableLibraryListener listener) {
+		if (!actionCommandListeners.contains(listener))
+			actionCommandListeners.add(listener);
+	}
+
+	/**
+	 * Borrar un listener de la lista de eventos
+	 * @param listener
+	 */
+	public void removeColorTableLibraryListener(ColorTableLibraryListener listener) {
+		actionCommandListeners.remove(listener);
+	}
+
+	/**
+	 * Devuelve la tabla de color que hay seleccionada en ese momento
+	 * @return
+	 */
+	public ColorTable getColorTableSelected() {
+		if (getListViewComponent().getSelectedValue() != null){
+			currentColorTable = ((ColorTableIconPainter) getListViewComponent().getSelectedValue().getIcon()).getColorTable();
+		}
+		return currentColorTable;
+	}
+	
+	/**
+	 * Reescribe la tabla de color en la posicion seleccionada
+	 * @param colorTable
+	 */
+	public void setColorTableSelected(ColorTable colorTable) {
+		hasChanged = true;
+		((ColorTableIconPainter) getListViewComponent().getSelectedValue().getIcon()).getColorTable().createPaletteFromColorItems(colorTable.getColorItems(), false);
+		getListViewComponent().repaint();
+	}
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/ColorTableLibraryPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/ColorTableDialog.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/ColorTableDialog.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/ColorTableDialog.java	(revision 8183)
@@ -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.tools.app.basic.tool.colortable.ui;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.andami.ui.mdiManager.IWindowListener;
+import org.gvsig.andami.ui.mdiManager.WindowInfo;
+import org.gvsig.fmap.dal.coverage.exception.ColorTableException;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+/**
+* <code>ColorTableDialog</code>. Creaci�n de la ventana de ColorTable para gvSIG.
+*
+* @author BorSanZa - Borja S�nchez Zamorano 
+*/
+public class ColorTableDialog extends JPanel implements IWindow, IWindowListener {
+	private static final long serialVersionUID = -5374834293534046986L;
+	private FLyrRaster layer = null;
+
+	/**
+	 * Panel de recortado de imagen que est� en la libreria raster
+	 */
+	private ColorTablePanel colorTablePanel = null;
+	
+	/**
+	 * Constructor
+	 * @param width Ancho
+	 * @param height Alto
+	 * @throws ColorTableException 
+	 */
+	public ColorTableDialog(FLyrRaster layer, int width, int height) throws ColorTableException {
+		this.layer = layer;
+		setPreferredSize(new Dimension(width, height));
+		setSize(width, height);
+		setLayout(new BorderLayout(5, 5));
+		add(getColorTablePanel(), java.awt.BorderLayout.CENTER);
+	}
+
+	/**
+	 * Obtiene el panel con el histograma
+	 * @return HistogramPanel
+	 * @throws ColorTableException 
+	 */
+	private ColorTablePanel getColorTablePanel() throws ColorTableException {
+		if (colorTablePanel == null) {
+			colorTablePanel = new ColorTablePanel(layer, this);
+		}
+		return colorTablePanel;
+	}
+
+	public WindowInfo getWindowInfo() {
+		WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODELESSDIALOG | WindowInfo.RESIZABLE | WindowInfo.MAXIMIZABLE);
+		try {
+			if(getColorTablePanel().getLayer() != null)
+				m_viewinfo.setAdditionalInfo(getColorTablePanel().getLayer().getName());
+		} catch (ColorTableException e1) {
+			//Esta excepci�n ya se ha debido capturar en la carga del dialogo por lo que no deber�a darse
+		}
+		m_viewinfo.setTitle(PluginServices.getText(this, "tablas_color"));
+		m_viewinfo.setHeight(this.getHeight());
+		m_viewinfo.setWidth(this.getWidth());
+		return m_viewinfo;
+	}
+
+	public void windowClosed() {
+		try {
+			getColorTablePanel().windowClosed();
+		} catch (ColorTableException e1) {
+			//Esta excepci�n ya se ha debido capturar en la carga del dialogo por lo que no deber�a darse
+		}
+	}
+
+	public void windowActivated() {}
+
+	public Object getWindowProfile() {
+		return WindowInfo.PROPERTIES_PROFILE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/ColorTableDialog.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/ColorTablePanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/ColorTablePanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/ColorTablePanel.java	(revision 8183)
@@ -0,0 +1,450 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.colortable.ui;
+
+import java.awt.BorderLayout;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JPanel;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.RasterManager;
+import org.gvsig.fmap.dal.coverage.exception.ColorTableException;
+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.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.store.props.Transparency;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.swing.RasterSwingLocator;
+import org.gvsig.raster.swing.preview.PreviewBasePanelTab;
+import org.gvsig.raster.swing.preview.PreviewPanel;
+import org.gvsig.raster.swing.preview.PreviewRenderProcess;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.raster.bean.previewbase.RasterDataSourcePreview;
+import org.gvsig.raster.tools.app.basic.tool.colortable.data.ColorTableData;
+import org.gvsig.raster.tools.app.basic.tool.colortable.ui.library.ColorTableLibraryEvent;
+import org.gvsig.raster.tools.app.basic.tool.colortable.ui.library.ColorTableLibraryListener;
+import org.gvsig.raster.tools.app.basic.tool.colortable.ui.library.ColorTableLibraryPanel;
+import org.gvsig.raster.tools.app.basic.tool.colortable.ui.tabs.IColorTableUI;
+import org.gvsig.raster.tools.app.basic.tool.colortable.ui.tabs.TabInterpolated;
+import org.gvsig.raster.tools.app.basic.tool.colortable.ui.tabs.TabTable;
+/**
+ * ColorTablePanel es el panel padre que contendra todos los paneles del interfaz
+ * de tablas de color.
+ *
+ * @author BorSanZa - Borja Sanchez Zamorano
+ */
+public class ColorTablePanel extends JPanel implements ChangeListener, ButtonsPanelListener, ColorTableLibraryListener {
+	private static final long serialVersionUID = 6028780107787443656L;
+
+	private ColorTableListener      colorTableListener = null;
+	private FLyrRaster              fLayer             = null;
+	private List<RasterFilter>      filterStatus       = null;
+	private ColorTableData          colorTableData     = null;
+
+	private IColorTableUI           tabTable           = null;
+	private IColorTableUI           tabInterpolated    = null;
+	
+	private ColorTableLibraryPanel  colorTableLibraryPanel = null;
+
+	private JPanel                  jPanelListView     = null;
+	private ColorTableGlobalPanel   panelGeneral       = null;
+	private ColorTableDialog        colorTableDialog   = null;
+	private PreviewPanel            previewBasePanel   = null;
+
+	/**
+	 * Controla si se ha presionado el boton aceptar para el cerrado de la ventana
+	 */
+	boolean accepted = false;
+
+	/**
+	 * Construir un nuevo ColorTablePanel
+	 * @throws ColorTableException 
+	 */
+	public ColorTablePanel(FLyrRaster layer, ColorTableDialog colorTableDialog) throws ColorTableException {
+		this.colorTableDialog = colorTableDialog;
+		fLayer = layer;
+		initialize();
+		setLayer(layer);
+	}
+	
+	public PreviewPanel getPreviewBasePanel() {
+		if (previewBasePanel == null) {
+			ArrayList<PreviewBasePanelTab> list = new ArrayList<PreviewBasePanelTab>();
+			list.add((PreviewBasePanelTab)getTabTable());
+			list.add((PreviewBasePanelTab)getTabInterpolated());
+			getColorTableListener().setLastColorTableUI(getTabTable());
+			IProjection viewProj = null;
+			if(fLayer.getMapContext() != null)
+				viewProj = fLayer.getMapContext().getProjection();
+			RasterDataSourcePreview previewDataSource = new RasterDataSourcePreview(fLayer, viewProj);
+			
+			previewBasePanel = RasterSwingLocator.getSwingManager().createPreviewPanel(
+					ButtonsPanel.BUTTONS_NONE, 
+					list, 
+					(JPanel) getGeneralPanel(), 
+					getPanelListView(), 
+					(PreviewRenderProcess)getColorTableListener(), 
+					previewDataSource);
+			previewBasePanel.getTabbedPane().addChangeListener(this);
+			previewBasePanel.getButtonsPanel().addButton(RasterToolsUtil.getText(this, "equidistar"), ButtonsPanel.BUTTON_LAST + 3);
+			previewBasePanel.getButtonsPanel().addButton(RasterToolsUtil.getText(this, "guardar_predeterminado"), ButtonsPanel.BUTTON_LAST + 2);
+			previewBasePanel.getButtonsPanel().addApply();
+			previewBasePanel.getButtonsPanel().addAccept();
+			previewBasePanel.getButtonsPanel().addCancel();
+			previewBasePanel.addButtonPressedListener(this);
+		}
+		return previewBasePanel;
+	}
+	
+
+	private void initialize() {
+		setLayout(new BorderLayout());
+		add((JPanel)getPreviewBasePanel(), BorderLayout.CENTER);
+	}
+
+	private IColorTableUI getTabTable() {
+		if (tabTable == null) {
+			tabTable = new TabTable();
+			tabTable.addColorTableUIChangedListener(getColorTableListener());
+		}
+		return tabTable;
+	}
+
+
+	private IColorTableUI getTabInterpolated() {
+		if (tabInterpolated == null) {
+			tabInterpolated = new TabInterpolated();
+			tabInterpolated.addColorTableUIChangedListener(getColorTableListener());
+		}
+		return tabInterpolated;
+	}
+
+	public JPanel getPanelListView() {
+		if (jPanelListView == null) {
+			jPanelListView = new JPanel();
+			jPanelListView.setBorder(javax.swing.BorderFactory.createTitledBorder(null, RasterToolsUtil.getText(this, "libreria"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+			jPanelListView.setLayout(new BorderLayout());
+			
+			jPanelListView.add(getColorTableLibraryPanel());
+		}
+		return jPanelListView;
+	}
+	
+	public ColorTableLibraryPanel getColorTableLibraryPanel() {
+		if (colorTableLibraryPanel == null) {
+			colorTableLibraryPanel = new ColorTableLibraryPanel(getColorTableData());
+			colorTableLibraryPanel.addColorTableLibraryListener(this);
+			colorTableLibraryPanel.selectDefault();
+		}
+		return colorTableLibraryPanel;
+	}
+
+	/**
+	 * Obtener el componente que hara la carga pesada de los listeners
+	 * @return
+	 */
+	private ColorTableListener getColorTableListener() {
+		if (colorTableListener == null) {
+			colorTableListener = new ColorTableListener(this, getColorTableData());
+		}
+		return colorTableListener;
+	}
+
+	public ColorTableGlobalPanel getGeneralPanel() {
+		if (panelGeneral == null) {
+			panelGeneral = new ColorTableGlobalPanel(getColorTableData());
+		}
+		return panelGeneral;
+	}
+
+	/**
+	 * Volvemos todo a la normalidad cuando se cancela
+	 */
+	private boolean restoreFilters() {
+		if (getLayer() != null) {
+			Render rendering = getLayer().getRender();
+			if(rendering.getFilterList() == null)
+				return false;
+			rendering.getFilterList().setStatus(getFilterStatus());
+			getLayer().getRender().setFilterList(rendering.getFilterList());
+		}
+		return true;
+	}
+
+	/**
+	 * Devuelve el arrayList de filtros inicial
+	 * @return
+	 */
+	private List<RasterFilter> getFilterStatus() {
+		return filterStatus;
+	}
+
+	/**
+	 * Carga la tabla de color que hay seleccionada en el componente
+	 * ListViewComponent
+	 * @throws ColorTableException 
+	 */
+	public void reloadPanelsFromLibraryPanel() throws ColorTableException {
+		ColorTable colorTable = getColorTableLibraryPanel().getColorTableSelected();
+		if(colorTable == null)
+			throw new ColorTableException(ColorTableException.MESSAGE_NOTLOADED);
+		getColorTableData().setColorTable((ColorTable) colorTable.clone());
+		if (colorTableData.isLimitsEnabled()) {
+			double min = getColorTableData().getMinim();
+			double max = getColorTableData().getMaxim();
+			getColorTableData().getColorTable().createColorTableInRange(min, max, false);
+		}
+		getColorTableListener().refreshItems(true);
+		getColorTableData().refreshPreview();
+	}
+
+	/**
+	 * Salva la tabla de color al fichero rmf.
+	 * @param fName
+	 * @throws IOException
+	 */
+	private void saveColorTable() {
+		RasterDataStore dataset = getLayer().getDataStore();
+		try {
+			if (getColorTableData().isEnabled())
+				dataset.saveColorTableToRmf(getColorTableData().getColorTable());
+			else
+				dataset.saveColorTableToRmf(null);
+		} catch (RmfSerializerException e) {
+			RasterSwingLibrary.messageBoxError("error_salvando_rmf", this, e);
+		}
+	}
+
+	/**
+	 * Restaura el estado de los filtros como estaban al abrir la ventana y quita
+	 * la leyenda del TOC
+	 */
+	private void restoreSettings() {
+		if (getLayer() == null)
+			return;
+
+		// Restauramos la vista con los filtros originales antes de cualquier acci�n
+		if(!restoreFilters())
+			return;
+
+		getLayer().setLastLegend(null);
+
+		RasterFilterList rasterFilterList = getLayer().getRender().getFilterList();
+		RasterFilter colorTableFilter = rasterFilterList.getByName("colortable");
+		if (colorTableFilter != null) {
+			ColorTable colorTable = (ColorTable)colorTableFilter.getParam("colorTable");
+			getLayer().setLastLegend(colorTable);
+		}
+
+		// Quitamos la banda de transparencia por si el filtro de color la ha activado
+		try {
+			Transparency transparency = getLayer().getRender().getRenderingTransparency();
+			transparency.setTransparencyBand(-1);
+			//transparency.activeTransparency();
+			//transparency.setAlphaBand(null);
+		} catch (NullPointerException ex) {
+			//No quitamos la banda de transparencia
+		}
+	}
+
+	/**
+	 * Devuelve el componente que trata los datos
+	 * @return
+	 */
+	private ColorTableData getColorTableData() {
+		if (colorTableData == null) {
+			colorTableData = new ColorTableData();
+		}
+		return colorTableData;
+	}
+
+	/**
+	 * Especificar el layer para la tabla de color
+	 * @param layer
+	 * @throws ColorTableException 
+	 */
+	private void setLayer(FLyrRaster fLayer) throws ColorTableException {
+		try {
+			this.fLayer = fLayer;
+			RasterManager rManager = RasterLocator.getManager();
+
+			getGeneralPanel().setLayer(fLayer);
+
+			getColorTableListener().setLayer(fLayer);
+
+			RasterFilterList rasterFilterList = getLayer().getRender().getFilterList();
+
+			filterStatus = rasterFilterList.getStatusCloned();
+
+			RasterFilter colorTableFilter = rasterFilterList.getByName("colortable");
+			if (colorTableFilter != null) {
+				ColorTable colorTable = (ColorTable)colorTableFilter.getParam("colorTable");
+				if (colorTable.isCompressible()) {
+					if (RasterSwingLibrary.messageBoxYesOrNot("comprimir_paleta", this)) {
+						colorTable.compressPalette();
+						colorTable.setInterpolated(true);
+					}
+				}
+
+				ColorTable ct = rManager.getDataStructFactory().getColorTableLibrary().createColorTable();
+				ct.setName(RasterToolsUtil.getText(this, "tabla_actual"));
+				ct.createPaletteFromColorItems(colorTable.getColorItems(), false);
+				ct.setInterpolated(colorTable.isInterpolated());
+				getGeneralPanel().setCheckBoxInterpolated(colorTable.isInterpolated());
+
+				getColorTableLibraryPanel().addColorTable(0, ct);
+
+				getGeneralPanel().setLimitsEnabled(false);
+				getGeneralPanel().setCheckBoxEnabled(true);
+			} else {
+				getColorTableLibraryPanel().selectDefault();
+
+				getGeneralPanel().setLimitsEnabled(true);
+				getGeneralPanel().setCheckBoxEnabled(false);
+			}
+			reloadPanelsFromLibraryPanel();
+		}catch (Exception e) {
+			throw new ColorTableException(ColorTableException.MESSAGE_NOTLOADED);
+		}
+	}
+
+	/**
+	 * Especificar el layer para el recorte
+	 * @param layer
+	 */
+	public FLyrRaster getLayer() {
+		return fLayer;
+	}
+
+	/**
+	 * Cuando se aceptan los cambios en el panel ejecutaremos el aceptar del
+	 * listener
+	 */
+	private void accept() {
+		if(!getGeneralPanel().getCheckBoxEnabled().isSelected()) {
+			boolean ok = RasterSwingLibrary.messageBoxYesOrNot("colortable_not_active", this);
+			if(ok)
+				getColorTableListener().accept();
+			else
+				return;
+		}
+		getColorTableListener().accept();
+	}
+
+	/**
+	 * Volvemos todo a la normalidad cuando se cancela
+	 */
+	private void cancel() {
+		getColorTableListener().closePreviewLayer();
+		getLayer().getMapContext().invalidate();
+	}
+
+	/**
+	 * Se dispara cuando se selecciona una pesta�a en el panel
+	 */
+	public void stateChanged(ChangeEvent e) {
+		switch (getPreviewBasePanel().getTabbedPane().getSelectedIndex()) {
+			case 1:
+				getColorTableListener().setLastColorTableUI(getTabInterpolated());
+				break;
+			default:
+				getColorTableListener().setLastColorTableUI(getTabTable());
+				break;
+		}
+
+		getColorTableListener().refreshItems(true);
+	}
+
+	public void actionButtonPressed(ButtonsPanelEvent e) {
+		restoreSettings();
+
+		// Al pulsar Aceptar o Aplicar se ejecuta el aceptar del panel
+		if (e.getButton() == ButtonsPanel.BUTTON_APPLY || e.getButton() == ButtonsPanel.BUTTON_ACCEPT) {
+			accept();
+		}
+
+		// Al pulsar Cancelar la ventana se cierra y se refresca la vista
+		if (e.getButton() == ButtonsPanel.BUTTON_CANCEL) {
+			cancel();
+			close();
+		}
+
+		// Al pulsar Aceptar simplemente la ventana se cierra
+		if (e.getButton() == ButtonsPanel.BUTTON_ACCEPT) {
+			accepted = true;
+			close();
+		}
+
+		if (e.getButton() == (ButtonsPanel.BUTTON_LAST + 2)) {
+			if (RasterSwingLibrary.messageBoxYesOrNot("guardar_como_predeterminado", this)) {
+				saveColorTable();
+				accept();
+			}
+		}
+
+		if (e.getButton() == (ButtonsPanel.BUTTON_LAST + 3)) {
+			getColorTableListener().equidistar();
+		}
+	}
+
+	/**
+	 * Acciones a ejecutar cuando se cancela
+	 */
+	private void close() {
+		if (colorTableDialog == null)
+			return;
+		try {
+			PluginServices.getMDIManager().closeWindow(colorTableDialog);
+		} catch (ArrayIndexOutOfBoundsException e) {
+			// Si la ventana no se puede eliminar no hacemos nada
+		}
+	}
+
+	public void windowClosed() {
+		if (!accepted) {
+			restoreSettings();
+			cancel();
+		}
+	}
+
+	public void actionColorTableChanged(ColorTableLibraryEvent e) {
+		try {
+			reloadPanelsFromLibraryPanel();
+		} catch (ColorTableException e1) {
+			//Esta excepci�n ya se ha debido capturar en la carga del dialogo por lo que no deber�a darse
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/ColorTablePanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/ColorTableGlobalPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/ColorTableGlobalPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/ColorTableGlobalPanel.java	(revision 8183)
@@ -0,0 +1,420 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.colortable.ui;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.text.NumberFormat;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JFormattedTextField;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.text.DefaultFormatterFactory;
+import javax.swing.text.NumberFormatter;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.tools.app.basic.raster.process.IProcessActions;
+import org.gvsig.raster.tools.app.basic.raster.process.RasterProcess;
+import org.gvsig.raster.tools.app.basic.raster.process.StatisticsProcess;
+import org.gvsig.raster.tools.app.basic.tool.colortable.data.ColorTableData;
+import org.gvsig.raster.util.BasePanel;
+/**
+ * Panel que contiene las opciones sobre los maximos y minimos de la tabla de color,
+ * checkbox de limites, si esta interpolado o si esta activa la tabla de color 
+ * 
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public class ColorTableGlobalPanel extends BasePanel implements ActionListener, PropertyChangeListener, IProcessActions {
+	private static final long   serialVersionUID     = 1L;
+	private JCheckBox           checkBoxInterpolated = null;
+	private JCheckBox           checkBoxEnabled      = null;
+	private ColorTableData      colorTableData       = null;
+
+	private JCheckBox           checkBoxLimits       = null;
+	private JFormattedTextField textFieldMinim       = null;
+	private JFormattedTextField textFieldMaxim       = null;
+	private JLabel              labelMinim           = null;
+	private JLabel              labelMaxim           = null;
+	private JButton             buttonStatistics     = null;
+
+	private NumberFormat        doubleDisplayFormat  = null;
+	private NumberFormat        doubleEditFormat     = null;
+	private FLyrRaster          fLayer               = null;
+	
+	/**
+	 *Inicializa componentes gr�ficos y traduce
+	 */
+	public ColorTableGlobalPanel() {
+		init();
+		translate();
+	}
+	
+	public ColorTableGlobalPanel(ColorTableData colorTableData) {
+		doubleDisplayFormat = NumberFormat.getNumberInstance();
+		doubleDisplayFormat.setMinimumFractionDigits(0);
+		doubleEditFormat = NumberFormat.getNumberInstance();
+
+		this.colorTableData = colorTableData;
+		init();
+	}
+	
+	protected void init() {
+		GridBagConstraints gridBagConstraints;
+
+		setLayout(new GridBagLayout());
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 4;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.insets = new Insets(5, 2, 2, 5);
+		add(getButtonStatistics(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(5, 2, 2, 2);
+		add(getTextFieldMinim(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 3;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(5, 2, 2, 2);
+		add(getTextFieldMaxim(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.insets = new Insets(5, 5, 2, 2);
+		add(getLabelMinim(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 2;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.insets = new Insets(5, 2, 2, 2);
+		add(getLabelMaxim(), gridBagConstraints);
+
+		JPanel panel = new JPanel();
+		panel.setLayout(new GridBagLayout());
+		
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(2, 5, 5, 2);
+		panel.add(getCheckBoxEnabled(), gridBagConstraints);
+		
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(2, 2, 5, 5);
+		panel.add(getCheckBoxInterpolated(), gridBagConstraints);
+		
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 2;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(2, 2, 5, 5);
+		panel.add(getCheckBoxLimits(), gridBagConstraints);
+		
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.gridwidth = 5;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.insets = new java.awt.Insets(2, 5, 5, 5);
+		add(panel, gridBagConstraints);
+	}
+	
+	protected void translate() {
+	}
+
+	/**
+	 * Obtiene el jCBInterpolated
+	 * @return
+	 */
+	private JCheckBox getCheckBoxInterpolated() {
+		if (checkBoxInterpolated == null) {
+			checkBoxInterpolated = new JCheckBox(getText(this, "interpolado"));
+			checkBoxInterpolated.setSelected(true);
+			checkBoxInterpolated.addActionListener(this);
+		}
+		return checkBoxInterpolated;
+	}
+
+	/**
+	 * Obtiene el jCBInterpolated
+	 * @return
+	 */
+	private JButton getButtonStatistics() {
+		if (buttonStatistics == null) {
+			buttonStatistics = new JButton(getText(this, "recalc_stats"));
+			buttonStatistics.addActionListener(this);
+		}
+		return buttonStatistics;
+	}
+
+	/**
+	 * Obtiene el jCBInterpolated
+	 * @return
+	 */
+	public JCheckBox getCheckBoxEnabled() {
+		if (checkBoxEnabled == null) {
+			checkBoxEnabled = new JCheckBox(getText(this, "activar_tablas_color"));
+			checkBoxEnabled.setSelected(true);
+			checkBoxEnabled.addActionListener(this);
+		}
+		return checkBoxEnabled;
+	}
+	
+	/**
+	 * Activa el control de interpolacion
+	 * @param b
+	 */
+	public void setCheckBoxInterpolated(boolean b) {
+		getCheckBoxInterpolated().setSelected(b);
+		colorTableData.setInterpolated(b);
+	}
+	
+	/**
+	 * Activa el uso de tablas de color para el panel
+	 * @param b
+	 */
+	public void setCheckBoxEnabled(boolean b) {
+		getCheckBoxEnabled().setSelected(b);
+		colorTableData.setEnabled(b);
+	}
+	
+	private boolean isInterpolated() {
+		return getCheckBoxInterpolated().isSelected();
+	}
+	
+	private boolean isCheckEnabled() {
+		return getCheckBoxEnabled().isSelected();
+	}
+	
+	/**
+	 * Activa/Desactiva los componentes de las pesta�as segun la pesta�a selecionada
+	 * @param enabled
+	 */
+	public void setEnabledPanel(boolean enabled) {
+		getLabelMinim().setEnabled(enabled);
+		getTextFieldMinim().setEnabled(enabled);
+		getLabelMaxim().setEnabled(enabled);
+		getTextFieldMaxim().setEnabled(enabled);
+		getCheckBoxLimits().setEnabled(enabled);
+		getCheckBoxInterpolated().setEnabled(enabled);
+		getButtonStatistics().setEnabled(enabled);
+		if (enabled)
+			setLimitsEnabled(getCheckBoxLimits().isSelected());
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if (e.getSource() == getCheckBoxInterpolated()) {
+			colorTableData.setInterpolated(isInterpolated());
+			return;
+		}
+
+		if (e.getSource() == getCheckBoxEnabled()) {
+			colorTableData.setEnabled(isCheckEnabled());
+			return;
+		}
+
+		if (e.getSource() == getCheckBoxLimits()) {
+			setLimitsEnabled(getCheckBoxLimits().isSelected());
+			return;
+		}
+		
+		if ((e.getSource() == getButtonStatistics()) &&
+				(fLayer != null)) {
+			RasterProcess process = new StatisticsProcess();
+			process.setActions(this);
+			process.addParam("layer", fLayer);
+			process.addParam("force", new Boolean(false));
+			process.start();
+			return;
+		}
+	}
+	
+	/**
+	 * Indica si los limites estaran activos para la tabla de color activa
+	 * @param enabled
+	 */
+	public void setLimitsEnabled(boolean enabled) {
+		colorTableData.setLimitsEnabled(enabled);
+		getCheckBoxLimits().setSelected(enabled);
+		getLabelMaxim().setEnabled(enabled);
+		getLabelMinim().setEnabled(enabled);
+		getTextFieldMinim().setEnabled(enabled);
+		getTextFieldMaxim().setEnabled(enabled);
+		getButtonStatistics().setEnabled(enabled);
+	}
+
+	/**
+	 * @return the checkBoxLimits
+	 */
+	private JCheckBox getCheckBoxLimits() {
+		if (checkBoxLimits == null) {
+			checkBoxLimits = new JCheckBox();
+			checkBoxLimits.setText(getText(this, "ajustar_limites"));
+			checkBoxLimits.addActionListener(this);
+		}
+		return checkBoxLimits;
+	}
+
+	/**
+	 * @return the textFieldMinim
+	 */
+	private JFormattedTextField getTextFieldMinim() {
+		if (textFieldMinim == null) {
+			textFieldMinim = new JFormattedTextField(new DefaultFormatterFactory(
+					new NumberFormatter(doubleDisplayFormat),
+					new NumberFormatter(doubleDisplayFormat),
+					new NumberFormatter(doubleEditFormat)));
+			textFieldMinim.setText("0");
+			textFieldMinim.setEnabled(false);
+			textFieldMinim.addPropertyChangeListener("value", this);
+		}
+		return textFieldMinim;
+	}
+
+	/**
+	 * @return the textFieldMaxim
+	 */
+	private JFormattedTextField getTextFieldMaxim() {
+		if (textFieldMaxim == null) {
+			textFieldMaxim = new JFormattedTextField(new DefaultFormatterFactory(
+					new NumberFormatter(doubleDisplayFormat),
+					new NumberFormatter(doubleDisplayFormat),
+					new NumberFormatter(doubleEditFormat)));
+			textFieldMaxim.setText("255");
+			textFieldMaxim.setEnabled(false);
+			textFieldMaxim.addPropertyChangeListener("value", this);
+		}
+		return textFieldMaxim;
+	}
+
+	/**
+	 * @return the labelMinim
+	 */
+	private JLabel getLabelMinim() {
+		if (labelMinim == null) {
+			labelMinim = new JLabel();
+			labelMinim.setText(getText(this, "minimo") + ":");
+			labelMinim.setEnabled(false);
+		}
+		return labelMinim;
+	}
+
+	/**
+	 * @return the labelMaxim
+	 */
+	private JLabel getLabelMaxim() {
+		if (labelMaxim == null) {
+			labelMaxim = new JLabel();
+			labelMaxim.setText(getText(this, "maximo") + ":");
+			labelMaxim.setEnabled(false);
+		}
+		return labelMaxim;
+	}
+	
+	private void setLimitMaxim(double limit) {
+		getTextFieldMaxim().setValue(Double.valueOf(limit));
+		colorTableData.setMaxim(limit);
+	}
+	
+	private void setLimitMinim(double limit) {
+		getTextFieldMinim().setValue(Double.valueOf(limit));
+		colorTableData.setMinim(limit);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
+	 */
+	public void propertyChange(PropertyChangeEvent evt) {
+		if (evt.getSource() == getTextFieldMaxim()) {
+			double max = ((Number) getTextFieldMaxim().getValue()).doubleValue();
+			colorTableData.setMaxim(max);
+			return;
+		}
+		
+		if (evt.getSource() == getTextFieldMinim()) {
+			double min = ((Number) getTextFieldMinim().getValue()).doubleValue();
+			colorTableData.setMinim(min);
+			return;
+		}
+	}
+	
+	/**
+	 * Establece los rangos de minimo y maximo obtenidos de las estadisticas
+	 * de la capa.
+	 */
+	private void putStatistics() {
+		Statistics statistics = ((FLyrRaster) fLayer).getDataStore().getStatistics();
+		if (statistics.isCalculated()) {
+			// En caso de que al hacer la conversion a byte sea igual al valor double
+			// podremos pensar que estamos en un rango RGB y por lo tanto definir
+			// el limite segun los valores RGB, en caso contrario, no deberiamos usar
+			// el valor RGB para mayor fiabilidad
+			if (	((FLyrRaster) fLayer).getDataStore().getDataType()[0] == Buffer.TYPE_BYTE &&
+					((byte) statistics.getMinimun() == (double) statistics.getMinimun()) &&
+					((byte) statistics.getMaximun() == (double) statistics.getMaximun())) {
+				setLimitMaxim(statistics.getMaximunByteUnsigned());
+				setLimitMinim(statistics.getMinimunByteUnsigned());
+			} else {
+				setLimitMaxim(statistics.getMaximun());
+				setLimitMinim(statistics.getMinimun());
+			}
+		}
+	}
+
+	/**
+	 * Establece que capa se va a usar en el panel para aplicarle la tabla de
+	 * color
+	 * @param fLayer
+	 */
+	public void setLayer(FLyrRaster fLayer) {
+		this.fLayer = fLayer;
+		putStatistics();
+	}
+
+	public void end(Object param) {
+		putStatistics();
+	}
+
+	public void interrupted() {}
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/ColorTableGlobalPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/tabs/ColorTableUIListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/tabs/ColorTableUIListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/tabs/ColorTableUIListener.java	(revision 8183)
@@ -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.tools.app.basic.tool.colortable.ui.tabs;
+
+import java.util.EventListener;
+/**
+ * Interfaz para controlar los cambios en los paneles de edici�n de un
+ * ColorTable
+ * 
+ * @version 04/01/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public interface ColorTableUIListener extends EventListener {
+	/**
+	 * Evento que se dispara cuando cambia el ColorTable de un Panel de edici�n
+	 * @param e
+	 */
+	public void actionColorTableUIChanged(IColorTableUI colorTableUI);
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/tabs/ColorTableUIListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/tabs/IColorTableUI.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/tabs/IColorTableUI.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/tabs/IColorTableUI.java	(revision 8183)
@@ -0,0 +1,64 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.colortable.ui.tabs;
+
+import javax.swing.JPanel;
+
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+/**
+ * Interfaz para poder hacer paneles de edicion de tablas de color
+ * @version 04/01/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public interface IColorTableUI {
+	
+	/**
+	 * Devuelve el JPanel del panel de edicion
+	 * @return
+	 */
+	public JPanel getPanel();
+
+	/**
+	 * Devuelve la Tabla de color que se esta visualizando en el Panel en ese
+	 * momento
+	 * @return
+	 */
+	public ColorTable getColorTable();
+	
+	/**
+	 * Define que Tabla de color se ha de mostrar en el Panel
+	 * @param colorTable
+	 */
+	public void setColorTable(ColorTable colorTable);
+	
+	/**
+	 * A�ade la gestion de eventos para cuando cambia el panel
+	 * @param listener
+	 */
+	public void addColorTableUIChangedListener(ColorTableUIListener listener);
+	
+	/**
+	 * Elimina la gestion de eventos para cuando cambia el panel
+	 * @param listener
+	 */
+	public void removeColorTableUIChangedListener(ColorTableUIListener listener);
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/tabs/IColorTableUI.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/tabs/TabTable.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/tabs/TabTable.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/tabs/TabTable.java	(revision 8183)
@@ -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.raster.tools.app.basic.tool.colortable.ui.tabs;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.JPanel;
+import javax.swing.JTable;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.ColorItem;
+import org.gvsig.fmap.dal.coverage.datastruct.ColorTableLibrary;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.gui.beans.table.TableContainer;
+import org.gvsig.gui.beans.table.exceptions.NotInitializeException;
+import org.gvsig.gui.beans.table.models.TableColorModel;
+import org.gvsig.raster.swing.preview.PreviewBasePanelTab;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.util.BasePanel;
+/**
+ * Pesta�a para definir una tabla de color en formato de tabla
+ *
+ * @version 27/06/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class TabTable extends BasePanel implements IColorTableUI, TableModelListener, PreviewBasePanelTab {
+	private static final long  serialVersionUID       = -6971866166164473789L;
+	private ArrayList<ColorTableUIListener> 
+	                           actionCommandListeners = new ArrayList<ColorTableUIListener>();
+	private boolean            listenerEnabled        = false;
+
+	/**
+	 * Tabla de color interna que se esta utilizando actualmente
+	 */
+	private ColorTable         colorTable             = null;
+	private TableContainer     tableContainer         = null;
+
+	/**
+	 * Construye un TabTable
+	 * @param colorTablePanel
+	 */
+	public TabTable() {
+		ColorTableLibrary colorTableLibrary = RasterLocator.getManager().getDataStructFactory().getColorTableLibrary();
+		colorTable = colorTableLibrary.createColorTable();
+		init();
+		translate();
+		getTableContainer().getTable().getJTable().getModel().addTableModelListener(this);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.util.BasePanel#init()
+	 */
+	protected void init() {
+		setLayout(new BorderLayout());
+		add(getTableContainer(), BorderLayout.CENTER);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.util.BasePanel#translate()
+	 */
+	protected void translate() {
+	}
+
+	private TableContainer getTableContainer() {
+		if (tableContainer == null) {
+			String[] columnNames = {getText(this, "color"), getText(this, "clase"), "RGB", getText(this, "valor"), getText(this, "hasta"), getText(this, "alpha")};
+			int[] columnWidths = {55, 68, 110, 64, 71, 43};
+			tableContainer = new TableContainer(columnNames, columnWidths);
+			tableContainer.setModel("TableColorModel");
+			tableContainer.initialize();
+		}
+		return tableContainer;
+	}
+
+	/**
+	 * Borra todas las filas de la tabla.
+	 */
+	private void clearTable() {
+		try {
+			getTableContainer().removeAllRows();
+		} catch (NotInitializeException e) {
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * Devuelve el String de un color en formato ##0, ##0, ##0
+	 * @param c
+	 * @return
+	 */
+	private String getColorString(Color c) {
+		return c.getRed() + ", " + c.getGreen() + ", " + c.getBlue();
+	}
+
+	/**
+	 * A�ade una fila a la tabla asignando el color por par�metro. Este
+	 * color asignado ser� el que aparezca en el bot�n y en el texto RGB
+	 * @param color
+	 */
+	private void addRowToTable(Color color, String name, Double fromRange, Double toRange, String alpha){
+		try {
+			getTableContainer().addRow(new Object[] { color, name, getColorString(color), fromRange, toRange, alpha });
+		} catch (NotInitializeException e1) {
+		}
+	}
+	
+	/**
+	 * Convierte la tabla en un array de objetos para poder crear con el el objeto Palette
+	 * @return
+	 * @throws NotInitializeException
+	 */
+	private ArrayList<ColorItem> getPalette() {
+		ArrayList<ColorItem> arrayList = new ArrayList<ColorItem>();
+		JTable jTable = getTableContainer().getTable().getJTable();
+		TableColorModel model = (TableColorModel) jTable.getModel();
+		ColorTableLibrary colorTableLibrary = RasterLocator.getManager().getDataStructFactory().getColorTableLibrary();
+		for (int iRow = 0; iRow < jTable.getRowCount(); iRow++) {
+			Color rgb = (Color) model.getValueAt(iRow, 0);
+			ColorItem colorItem = colorTableLibrary.createColorItem();
+			colorItem.setColor(new Color(
+					rgb.getRed(),
+					rgb.getGreen(),
+					rgb.getBlue(),
+					Integer.valueOf((String) model.getValueAt(iRow, 5)).intValue()));
+
+			if (model.getValueAt(iRow, 3) != null)
+				colorItem.setValue(((Double) model.getValueAt(iRow, 3)).doubleValue());
+
+			colorItem.setNameClass((String) model.getValueAt(iRow, 1));
+			arrayList.add(colorItem);
+		}
+
+		return arrayList;
+	}
+	
+	/**
+	 * Carga inicial de los colores del panel
+	 * @param colorItems
+	 */
+	private void reloadItems() {
+		listenerEnabled = false;
+		List<ColorItem> colorItems = colorTable.getColorItems();
+		clearTable();
+		for (int i = 0; i < colorItems.size(); i++) {
+			ColorItem c1 = (ColorItem) colorItems.get(i);
+			Double toRange = null;
+			if ((i + 1) < colorItems.size())
+				toRange = new Double(((ColorItem) colorItems.get(i + 1)).getValue());
+			addRowToTable(c1.getColor(), c1.getNameClass(), new Double(c1.getValue()), toRange, c1.getColor().getAlpha() + "");
+		}
+		listenerEnabled = true;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see javax.swing.event.TableModelListener#tableChanged(javax.swing.event.TableModelEvent)
+	 */
+	public void tableChanged(TableModelEvent e) {
+		if (!listenerEnabled)
+			return;
+		colorTable.createPaletteFromColorItems(getPalette(), false);
+		callColorTableUIChangedListener();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.colortable.panels.IColorTableUI#getColorTable()
+	 */
+	public ColorTable getColorTable() {
+		return colorTable;
+	}
+
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.colortable.panels.IColorTableUI#setColorTable(org.gvsig.raster.datastruct.ColorTable)
+	 */
+	public void setColorTable(ColorTable colorTable) {
+		this.colorTable = colorTable;
+		reloadItems();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.colortable.panels.IColorTableUI#addColorTableUIChangedListener(org.gvsig.rastertools.colortable.panels.ColorTableUIListener)
+	 */
+	public void addColorTableUIChangedListener(ColorTableUIListener listener) {
+		if (!actionCommandListeners.contains(listener))
+			actionCommandListeners.add(listener);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.colortable.panels.IColorTableUI#removeColorTableUIChangedListener(org.gvsig.rastertools.colortable.panels.ColorTableUIListener)
+	 */
+	public void removeColorTableUIChangedListener(ColorTableUIListener listener) {
+		actionCommandListeners.remove(listener);
+	}
+
+	/**
+	 * Invoca el evento de cambio de un ColorTable
+	 * @param colorTable
+	 */
+	private void callColorTableUIChangedListener() {
+		Iterator<ColorTableUIListener> acIterator = actionCommandListeners.iterator();
+		while (acIterator.hasNext()) {
+			ColorTableUIListener listener = (ColorTableUIListener) acIterator.next();
+			listener.actionColorTableUIChanged(this);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.beans.previewbase.IUserPanelInterface#getTitle()
+	 */
+	public String getTitle() {
+		return RasterToolsUtil.getText(this, "tabla");
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.colortable.ui.tabs.IColorTableUI#getPanel()
+	 */
+	public JPanel getPanel() {
+		return this;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/tabs/TabTable.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/tabs/TabInterpolated.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/tabs/TabInterpolated.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/tabs/TabInterpolated.java	(revision 8183)
@@ -0,0 +1,648 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.colortable.ui.tabs;
+
+import java.awt.Color;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.ColorItem;
+import org.gvsig.fmap.dal.coverage.datastruct.ColorTableLibrary;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.fmap.dal.coverage.util.MathUtils;
+import org.gvsig.gui.beans.colorbutton.ColorButton;
+import org.gvsig.gui.beans.colorbutton.ColorButtonEvent;
+import org.gvsig.gui.beans.colorbutton.ColorButtonListener;
+import org.gvsig.gui.beans.colorslideredition.ColorSliderEdition;
+import org.gvsig.gui.beans.colorslideredition.ColorSliderEvent;
+import org.gvsig.gui.beans.colorslideredition.ColorSliderListener;
+import org.gvsig.gui.beans.colorslideredition.ItemColorSlider;
+import org.gvsig.raster.swing.preview.PreviewBasePanelTab;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.util.BasePanel;
+/**
+ * Pesta�a para las interpolaciones de la tabla de color, aqui se tratar�n
+ * los gradientes de color, etc...
+ *
+ * @version 27/06/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class TabInterpolated extends BasePanel implements IColorTableUI, ColorSliderListener, ColorButtonListener, FocusListener, KeyListener, PreviewBasePanelTab {
+	private static final long serialVersionUID = -5208861410196059899L;
+
+	private ArrayList<ColorTableUIListener>          
+	                           actionCommandListeners = new ArrayList<ColorTableUIListener>();
+	private boolean            listenerEnabled        = true;
+	private double             min                    = Double.POSITIVE_INFINITY;
+	private double             max                    = Double.NEGATIVE_INFINITY;
+	
+	/**
+	 * Tabla de color interna que se esta utilizando actualmente
+	 */	
+	private ColorTable         colorTable             = null;
+
+	private ColorSliderEdition colorSliderEdition     = null;
+	private ColorButton        colorButton            = null;
+	private JTextField         jTextClassName         = null;
+	private JTextField         jTextValue             = null;
+	private JLabel             jLabelColor            = null;
+	private JLabel             jLabelClassName        = null;
+	private JLabel             jLabelValue            = null;
+
+	/**
+	 *Inicializa componentes gr�ficos y traduce
+	 */
+	public TabInterpolated() {
+		colorTable = RasterLocator.getManager().getDataStructFactory().getColorTableLibrary().createColorTable();
+		init();
+		translate();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.util.BasePanel#init()
+	 */
+	protected void init() {
+		setLayout(new GridBagLayout());
+
+		GridBagConstraints gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridwidth = 2;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(5, 5, 2, 5);
+		add(getColorSliderEdition(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.anchor = GridBagConstraints.EAST;
+		gridBagConstraints.weightx = 0.5;
+		gridBagConstraints.insets = new Insets(2, 5, 2, 2);
+		add(getJLabelColor(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.weightx = 0.5;
+		gridBagConstraints.insets = new Insets(2, 2, 2, 5);
+		add(getColorButton(), gridBagConstraints);
+		
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 2;
+		gridBagConstraints.anchor = GridBagConstraints.EAST;
+		gridBagConstraints.insets = new Insets(2, 5, 2, 2);
+		add(getJLabelClassName(), gridBagConstraints);
+		
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = 2;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.insets = new Insets(2, 2, 2, 5);
+		add(getJTextClassName(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 3;
+		gridBagConstraints.anchor = GridBagConstraints.EAST;
+		gridBagConstraints.insets = new Insets(2, 5, 2, 2);
+		add(getJLabelValue(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = 3;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.insets = new Insets(2, 2, 2, 5);
+		add(getJTextValue(), gridBagConstraints);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.util.BasePanel#translate()
+	 */
+	protected void translate() {
+	}
+
+	private JLabel getJLabelColor() {
+		if (jLabelColor == null) {
+			jLabelColor = new JLabel(getText(this, "tabinterpolated_color") + ": ");
+			jLabelColor.setEnabled(false);
+		}
+		return jLabelColor;
+	}
+	
+	private JLabel getJLabelClassName() {
+		if (jLabelClassName == null) {
+			jLabelClassName = new JLabel(getText(this, "clase") + ": ");
+			jLabelClassName.setEnabled(false);
+		}
+		return jLabelClassName;
+	}
+
+	private JLabel getJLabelValue() {
+		if (jLabelValue == null) {
+			jLabelValue = new JLabel(getText(this, "value") + ": ");
+			jLabelValue.setEnabled(false);
+		}
+		return jLabelValue;
+	}
+
+	private ColorSliderEdition getColorSliderEdition() {
+		if (colorSliderEdition == null) {
+			colorSliderEdition = new ColorSliderEdition();
+			colorSliderEdition.addValueChangedListener(this);
+			colorSliderEdition.addSelectionChangedListener(this);
+		}
+		return colorSliderEdition;
+	}
+
+	private ColorButton getColorButton() {
+		if (colorButton == null) {
+			colorButton = new ColorButton();
+			colorButton.addValueChangedListener(this);
+		}
+		return colorButton;
+	}
+
+	private JTextField getJTextClassName() {
+		if (jTextClassName == null) {
+			jTextClassName = new JTextField();
+			jTextClassName.setEnabled(false);
+			jTextClassName.addKeyListener(this);
+		}
+		return jTextClassName;
+	}
+
+	private JTextField getJTextValue() {
+		if (jTextValue == null) {
+			jTextValue = new JTextField();
+			jTextValue.setEnabled(false);
+			jTextValue.addKeyListener(this);
+			jTextValue.addFocusListener(this);
+		}
+		return jTextValue;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.colorslideredition.ColorSliderListener#actionSelectionChanged(org.gvsig.gui.beans.colorslideredition.ColorSliderEvent)
+	 */
+	public void actionSelectionChanged(ColorSliderEvent e) {
+		ItemColorSlider itemColorSlider = getColorSliderEdition().getSelectedItem();
+		boolean enabled = false;
+		if ((itemColorSlider != null) && (itemColorSlider.getSelected() == 1)) {
+			getColorButton().setColor(itemColorSlider.getColor());
+			getJTextClassName().setText(itemColorSlider.getName());
+			enabled = true;
+		}
+		setControlsEnabled(enabled);
+	}
+
+	/**
+	 * Acci�n que se ejecuta cuando cambia el color el usuario. Este metodo
+	 * actualiza el color del ItemColorSlider segun la seleccion del usuario.
+	 */
+	private void updateItemSelectedToColorSlider() {
+		ItemColorSlider itemColorSlider = getColorSliderEdition().getSelectedItem();
+		if (itemColorSlider != null) {
+			itemColorSlider.setColor(getColorButton().getColor());
+			itemColorSlider.setName(getJTextClassName().getText());
+			getColorSliderEdition().repaint();
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.colorbutton.ColorButtonListener#actionValueDragged(org.gvsig.gui.beans.colorbutton.ColorButtonEvent)
+	 */
+	public void actionValueDragged(ColorButtonEvent e) {
+		updateItemSelectedToColorSlider();
+	}
+
+	/**
+	 * Convierte el slider de la paleta en un array de objetos para poder crear
+	 * con �l el objeto Palette
+	 * @return
+	 */
+	private ArrayList<ColorItem> getPalette() {
+		ColorTableLibrary colorTableLibrary = RasterLocator.getManager().getDataStructFactory().getColorTableLibrary();
+		double min2 = min;
+		double max2 = max;
+
+		if (min2 > max2) {
+			double aux = min2;
+			min2 = max2;
+			max2 = aux;
+		}
+
+		ArrayList<ColorItem> arrayList = new ArrayList<ColorItem>();
+		ArrayList<?> items = getColorSliderEdition().getItemsShowed();
+
+		// A�adir el minimo
+		ItemColorSlider item;
+		if (items.size() > 0)
+			item = (ItemColorSlider) items.get(0);
+		else
+			item = new ItemColorSlider(0, Color.black);
+		ColorItem colorItem = colorTableLibrary.createColorItem();
+		colorItem.setColor(item.getColor());
+		colorItem.setInterpolated(50);
+		colorItem.setNameClass("");
+		colorItem.setValue(min2);
+		arrayList.add(colorItem);
+
+		for (int i = 0; i < items.size(); i++) {
+			item = (ItemColorSlider) items.get(i);
+			colorItem = colorTableLibrary.createColorItem();
+			colorItem.setColor(item.getColor());
+			colorItem.setInterpolated((int) item.getInterpolated());
+			colorItem.setNameClass(item.getName());
+
+			colorItem.setValue(min2 + ((item.getValue() * (max2 - min2)) / 100.0d));
+
+			arrayList.add(colorItem);
+		}
+
+		// A�adir el maximo
+		if (items.size() > 0)
+			item = (ItemColorSlider) items.get(items.size() - 1);
+		else
+			item = new ItemColorSlider(255, Color.white);
+		colorItem = colorTableLibrary.createColorItem();
+		colorItem.setColor(item.getColor());
+		colorItem.setInterpolated(50);
+		colorItem.setNameClass("");
+		colorItem.setValue(max2);
+		arrayList.add(colorItem);
+
+
+		return arrayList;
+	}	
+	
+	/**
+	 * Refresco de los items del panel de color
+	 * @param colorItems
+	 */
+	private void refreshItems() {
+		colorTable.createPaletteFromColorItems(getPalette(), false);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.colorbutton.ColorButtonListener#actionValueChanged(org.gvsig.gui.beans.colorbutton.ColorButtonEvent)
+	 */
+	public void actionValueChanged(ColorButtonEvent e) {
+		updateItemSelectedToColorSlider();
+		refreshItems();
+		callColorTableUIChangedListener();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.colorslideredition.ColorSliderListener#actionValueChanged(org.gvsig.gui.beans.colorslideredition.ColorSliderEvent)
+	 */
+	public void actionValueChanged(ColorSliderEvent e) {
+		refreshItems();
+		changeTextValue();
+		callColorTableUIChangedListener();
+	}
+
+	private void initialState() {
+		getColorSliderEdition().repaint();
+		setControlsEnabled(false);
+	}
+	
+	private void setControlsEnabled(boolean value) {
+		getColorButton().setEnabled(value);
+		getJLabelColor().setEnabled(value);
+		getJLabelClassName().setEnabled(value);
+		getJTextClassName().setEnabled(value);
+		getJLabelValue().setEnabled(value);
+		getJTextValue().setEnabled(value);
+		if (value == false)
+			getJTextClassName().setText("");
+	}
+
+	/**
+	 * Carga inicial de los items del panel de color
+	 * @param colorItems
+	 */
+	private void reloadItems() {
+		List<ColorItem> colorItems = colorTable.getColorItems();
+
+		min = Double.POSITIVE_INFINITY;
+		max = Double.NEGATIVE_INFINITY;
+		for (int i = 0; i < colorItems.size(); i++) {
+			ColorItem c1 = (ColorItem) colorItems.get(i);
+			if (c1.getValue() > max)
+				max = c1.getValue();
+			if (c1.getValue() < min)
+				min = c1.getValue();
+		}
+
+		clearTable();
+		for (int i = 0; i < colorItems.size(); i++) {
+			ColorItem c1 = (ColorItem) colorItems.get(i);
+			double percent = (((c1.getValue() - min) * 100) / (max - min));
+
+			ItemColorSlider aux = new ItemColorSlider(percent, c1.getColor());
+			aux.setInterpolated(c1.getInterpolated());
+			aux.setName(c1.getNameClass());
+
+			getColorSliderEdition().addItem(aux, false);
+		}
+		initialState();
+		if (min > max) {
+			min = 0;
+			max = 255;
+		}
+		refreshItems();
+	}
+
+	/**
+	 * Borra todas las filas de la tabla.
+	 */
+	private void clearTable() {
+		getColorSliderEdition().removeAllItems();
+	}
+
+	@SuppressWarnings("unchecked")
+	private void updateChangedValue() {
+		double min2 = Double.POSITIVE_INFINITY;
+		double max2 = Double.NEGATIVE_INFINITY;
+		ArrayList list = getColorSliderEdition().getItems();
+		for (int i = 0; i < list.size(); i++) {
+			ItemColorSlider itemColorSlider = (ItemColorSlider) list.get(i);
+			
+			double value = SliderToValue(itemColorSlider.getValue());
+			
+			itemColorSlider.setTag(new Double(value));
+			
+			if (itemColorSlider.getSelected() != 1) {
+				if (min2 > value)
+					min2 = value;
+	
+				if (max2 < value)
+					max2 = value;
+			}
+		}
+		
+		double value;
+		try {
+			value = Double.parseDouble(getJTextValue().getText());
+			if (min2 > value)
+				min2 = value;
+			if (max2 < value)
+				max2 = value;
+		} catch (NumberFormatException e1) {
+		}
+		
+		min = min2;
+		max = max2;
+
+		for (int i = 0; i < list.size(); i++) {
+			ItemColorSlider itemColorSlider = (ItemColorSlider) list.get(i);
+			
+			value = ValueToSlider(((Double) itemColorSlider.getTag()).doubleValue());
+			
+			itemColorSlider.setValue(value);
+
+			if (itemColorSlider.getSelected() == 1) {
+				try {
+					value = Double.parseDouble(getJTextValue().getText());
+					itemColorSlider.setValue(ValueToSlider(value));
+				} catch (NumberFormatException e1) {
+				}
+			}
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.FocusListener#focusLost(java.awt.event.FocusEvent)
+	 */
+	public void focusLost(FocusEvent e) {
+		if (e.getSource() == getJTextValue())
+			updateChangedValue();
+
+		updateItemSelectedToColorSlider();
+		refreshItems();
+		callColorTableUIChangedListener();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
+	 */
+	public void keyReleased(KeyEvent e) {
+		if (e.getSource() == getJTextValue()) {
+			updateChangedValue();
+			updateItemSelectedToColorSlider();
+			refreshItems();
+			callColorTableUIChangedListener();
+		}
+		
+		if (e.getSource() == getJTextClassName()) {
+			updateItemSelectedToColorSlider();
+			refreshItems();
+			callColorTableUIChangedListener();
+		}
+	}
+
+	private void changeTextValue() {
+		if (getColorSliderEdition().getSelectedItem() != null) {
+			double value = SliderToValue(getColorSliderEdition().getSelectedItem().getValue());
+			MathUtils math = RasterLocator.getManager().getMathUtils();
+			getJTextValue().setText(math.format(value, 3) + "");
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.colorslideredition.ColorSliderListener#actionValueDragged(org.gvsig.gui.beans.colorslideredition.ColorSliderEvent)
+	 */
+	public void actionValueDragged(ColorSliderEvent e) {
+		changeTextValue();
+	}
+	
+	/**
+	 * Devuelve los limites de la tabla de color, minimo y maximo
+	 * @return
+	 */
+	private double[] getLimits() {
+		double min2 = min;
+		double max2 = max;
+
+		if (min2 > max2) {
+			double aux = min2;
+			min2 = max2;
+			max2 = aux;
+		}
+		
+		if (min2 == max2)
+			max2++;
+
+		double limits[] = {min2, max2};
+		
+		return limits;
+	}
+	
+	/**
+	 * Convierte un valor de la tabla de color a un porcentaje para el Slider
+	 * @param value
+	 * @return
+	 */
+	private double ValueToSlider(double value) {
+		double limits[] = getLimits();
+		return ((value - limits[0]) * 100.0d) / (limits[1] - limits[0]);
+	}
+
+	/**
+	 * Convierte un porcentaje del slider a un valor de la tabla de color
+	 * @param value
+	 * @return
+	 */
+	private double SliderToValue(double value) {
+		double limits[] = getLimits();
+		return limits[0] + ((value * (limits[1] - limits[0])) / 100.0d);		
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.colortable.panels.IColorTableUI#getColorTable()
+	 */
+	public ColorTable getColorTable() {
+		return colorTable;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.colortable.panels.IColorTableUI#setColorTable(org.gvsig.raster.datastruct.ColorTable)
+	 */
+	public void setColorTable(ColorTable colorTable) {
+		listenerEnabled = false;
+		this.colorTable = colorTable;
+		reloadItems();
+		getColorSliderEdition().setInterpolated(colorTable.isInterpolated());
+		listenerEnabled = true;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.colortable.panels.IColorTableUI#addColorTableUIChangedListener(org.gvsig.rastertools.colortable.panels.ColorTableUIListener)
+	 */
+	public void addColorTableUIChangedListener(ColorTableUIListener listener) {
+		if (!actionCommandListeners.contains(listener))
+			actionCommandListeners.add(listener);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.colortable.panels.IColorTableUI#removeColorTableUIChangedListener(org.gvsig.rastertools.colortable.panels.ColorTableUIListener)
+	 */
+	public void removeColorTableUIChangedListener(ColorTableUIListener listener) {
+		actionCommandListeners.remove(listener);
+	}
+
+	/**
+	 * Invoca el evento de cambio de un ColorTable
+	 * @param colorTable
+	 */
+	private void callColorTableUIChangedListener() {
+		if (!listenerEnabled)
+			return;
+
+		Iterator<ColorTableUIListener> acIterator = actionCommandListeners.iterator();
+		while (acIterator.hasNext()) {
+			ColorTableUIListener listener = (ColorTableUIListener) acIterator.next();
+			listener.actionColorTableUIChanged(this);
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.KeyListener#keyPressed(java.awt.event.KeyEvent)
+	 */
+	public void keyPressed(KeyEvent e) {
+		if (e.getKeyCode() == 38) {
+			try {
+				double value = Double.parseDouble(getJTextValue().getText());
+				value+=10;
+				getJTextValue().setText(Double.valueOf(value).toString());
+				updateChangedValue();
+				updateItemSelectedToColorSlider();
+				refreshItems();
+				callColorTableUIChangedListener();
+			} catch (NumberFormatException e1) {
+			}
+		}
+		if (e.getKeyCode() == 40) {
+			try {
+				double value = Double.parseDouble(getJTextValue().getText());
+				value-=10;
+				getJTextValue().setText(Double.valueOf(value).toString());
+				updateChangedValue();
+				updateItemSelectedToColorSlider();
+				refreshItems();
+				callColorTableUIChangedListener();
+			} catch (NumberFormatException e1) {
+			}
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.beans.previewbase.IUserPanelInterface#getTitle()
+	 */
+	public String getTitle() {
+		return RasterToolsUtil.getText(this, "rampa");
+	}
+	
+	public void focusGained(FocusEvent e) {}
+	public void keyTyped(KeyEvent e) {}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.colortable.ui.tabs.IColorTableUI#getPanel()
+	 */
+	public JPanel getPanel() {
+		return this;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/tabs/TabInterpolated.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/tabs
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/ColorTableListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/ColorTableListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/ColorTableListener.java	(revision 8183)
@@ -0,0 +1,390 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.colortable.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JComponent;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.ColorItem;
+import org.gvsig.fmap.dal.coverage.datastruct.ColorTableLibrary;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.ColorTableException;
+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.store.props.ColorTable;
+import org.gvsig.fmap.dal.coverage.util.PropertyEvent;
+import org.gvsig.fmap.dal.coverage.util.PropertyListener;
+import org.gvsig.gui.beans.imagenavigator.ImageUnavailableException;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.swing.preview.DataSourcePreview;
+import org.gvsig.raster.swing.preview.PreviewRenderProcess;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.tool.colortable.data.ColorTableData;
+import org.gvsig.raster.tools.app.basic.tool.colortable.ui.library.ColorTableLibraryPanel;
+import org.gvsig.raster.tools.app.basic.tool.colortable.ui.tabs.ColorTableUIListener;
+import org.gvsig.raster.tools.app.basic.tool.colortable.ui.tabs.IColorTableUI;
+/**
+ * Listener generico para el panel de tablas de color, en el controlaremos el
+ * refresco de la vista previa, los cambios en las tablas de color y la
+ * finalizacion del panel.
+ * 
+ * @author BorSanZa - Borja Sanchez Zamorano 
+ */
+public class ColorTableListener implements PropertyListener, ColorTableUIListener, PreviewRenderProcess {
+	private ColorTablePanel colorTablePanel  = null;
+	private FLyrRaster      previewLayer     = null;
+	private ColorTableData  colorTableData   = null;
+	private ArrayList<StatusComponent>       
+	                        statusList       = new ArrayList<StatusComponent>();
+	private IColorTableUI   lastColorTableUI = null;
+	private boolean         showPreview      = true;
+	
+	/**
+	 * Construye un ColorTableListener
+	 * @param colorTablePanel
+	 */
+	public ColorTableListener(ColorTablePanel colorTablePanel, ColorTableData colorTableData) {
+		this.colorTablePanel = colorTablePanel;
+		this.colorTableData = colorTableData;
+		getColorTableData().addValueChangedListener(this);
+	}
+
+	/**
+	 * Devuelve el panel de ColorTable
+	 * @return
+	 */
+	private ColorTablePanel getColorTablePanel() {
+		return colorTablePanel;
+	}
+
+	private ColorTableData getColorTableData() {
+		return colorTableData;
+	}
+
+	/**
+	 * Asigna la capa raster de la vista
+	 * @param fLayer
+	 */
+	public void setLayer(FLyrRaster fLayer) {
+		if (fLayer instanceof FLyrRaster) {
+			try {
+				previewLayer = (FLyrRaster) fLayer.cloneLayer();
+			} catch (Exception e) {
+				RasterSwingLibrary.messageBoxError("preview_not_available", colorTablePanel, e);
+			}
+		}
+	}
+
+	/**
+	 * Cierra la capa abierta para previsualizaci�n
+	 */
+	public void closePreviewLayer() {
+		if (previewLayer != null) {
+			previewLayer.setRemoveRasterFlag(true);
+			previewLayer.removeLayerListener(null);
+		}
+	}
+
+	/**
+	 * Aqui se aplica el estado de las tablas de color al rendering pasado por
+	 * parametro
+	 * @param rendering
+	 * @return
+	 * @throws FilterTypeException
+	 * @throws FilterManagerException 
+	 */
+	private void applyColorTable(FLyrRaster rendering, boolean isPreview) throws FilterTypeException, FilterManagerException {
+		RasterFilterList filterList = rendering.getRender().getFilterList();
+		RasterFilterListManager cManager = filterList.getManagerByID("ColorTable");
+
+		filterList.remove("colortable");
+		getColorTablePanel().getLayer().setLastLegend(null);
+
+		if (getColorTableData().isEnabled()) {
+			filterList.removeAll();
+
+			// Asignamos la transparencia del render actual al filterList
+			filterList.addEnvParam("Transparency", rendering.getRender().getRenderingTransparency());
+
+			Params params = filterList.createEmptyFilterParams();
+			ColorTable colorTable = getColorTableData().getColorTable();
+			params.setParam("colorTable", colorTable);
+			cManager.addFilter(params);
+			
+			if (!isPreview) {
+				colorTable.compressPalette();
+				getColorTablePanel().getLayer().setLastLegend(colorTable);
+			}
+		}
+		for (int i = 0; i< filterList.lenght(); i++) {
+			((RasterFilter) filterList.get(i)).setEnv(filterList.getEnv());
+		}
+
+		rendering.getRender().setFilterList(filterList);
+	}
+
+	/**
+	 * Acciones que se ejecutaran al haber presionado el bot�n aceptar o aplicar
+	 */
+	public void accept() {
+		try {
+			ColorTableLibrary tableLib = RasterLocator.getManager().getDataStructFactory().getColorTableLibrary();
+			applyColorTable(getColorTablePanel().getLayer(), false);
+			getColorTablePanel().getLayer().getMapContext().invalidate();
+			tableLib.save_to_1_1(ColorTableLibraryPanel.palettesPath, getColorTableData().getColorTable());
+		} catch (FilterTypeException e) {
+			RasterSwingLibrary.messageBoxError(PluginServices.getText(this, "error_adding_filters"), this, e);
+		} catch (FilterManagerException e) {
+			RasterSwingLibrary.messageBoxError(PluginServices.getText(this, "error_adding_filters"), this, e);
+		}
+	}
+
+	public class StatusComponent {
+		private JComponent object;
+		private boolean enabled;
+
+		public boolean isEnabled() {
+			return enabled;
+		}
+
+		public void setEnabled(boolean enabled) {
+			this.enabled = enabled;
+		}
+
+		public JComponent getObject() {
+			return object;
+		}
+
+		public void setObject(JComponent object) {
+			this.object = object;
+		}
+	}
+	
+	private void saveComponentsStatus(JComponent component) {
+		// Guardar estado
+		StatusComponent auxStatus = new StatusComponent();
+		auxStatus.setEnabled(component.isEnabled());
+		auxStatus.setObject(component);
+		statusList.add(auxStatus);
+
+		for (int i = 0; i < component.getComponentCount(); i++)
+			if (component.getComponent(i) instanceof JComponent)
+				saveComponentsStatus((JComponent) component.getComponent(i));
+	}
+
+	private void setEnabledRecursive(JComponent component, boolean enabled, int level) {
+		if (enabled == true) {
+			boolean auxEnabled = false;
+			boolean finded = false;
+			// Buscar estado de dicho componente
+			for (int i = 0; i < statusList.size(); i++) {
+				StatusComponent auxStatus = (StatusComponent) statusList.get(i);
+				if (auxStatus.getObject() == component) {
+					auxEnabled = auxStatus.isEnabled();
+					statusList.remove(i);
+					i--;
+					finded = true;
+					break;
+				}
+			}
+
+			// Asignar su estado
+			if (finded)
+				component.setEnabled(auxEnabled);
+		} else {
+			// Si es la primera llamada, guardamos el estado de todos los componentes
+			if (level == 0)
+				saveComponentsStatus(component);
+
+			// Desactivar componente
+			component.setEnabled(false);
+		}
+
+		for (int i = 0; i < component.getComponentCount(); i++)
+			if (component.getComponent(i) instanceof JComponent)
+				setEnabledRecursive((JComponent) component.getComponent(i), enabled, level + 1);
+	}	
+	
+	/**
+	 * Activa/Desactiva los componentes de las pesta�as segun la pesta�a selecionada
+	 * @param enabled
+	 */
+	@SuppressWarnings("unused")
+	private void setEnabledPanel(boolean enabled) {
+		colorTablePanel.getGeneralPanel().setEnabledPanel(enabled);
+		colorTablePanel.getPreviewBasePanel().getTabbedPane().setEnabled(enabled);
+		setEnabledRecursive(getLastColorTableUI().getPanel(), enabled, 0);
+		setEnabledRecursive(colorTablePanel.getPreviewBasePanel().getImageNavigator(), enabled, 0);
+		setEnabledRecursive(colorTablePanel.getPanelListView(), enabled, 0);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.PropertyListener#actionValueChanged(org.gvsig.rastertools.PropertyEvent)
+	 */
+	public void actionValueChanged(PropertyEvent e) {
+		if (e.getName().equals("refreshPreview")) {
+			colorTablePanel.getPreviewBasePanel().refreshPreview();
+			return;
+		}
+		
+		if (e.getName().equals("interpolated")) {
+			colorTablePanel.getColorTableLibraryPanel().setInterpolated(((Boolean) e.getValue()).booleanValue());
+			getColorTableData().getColorTable().setInterpolated(((Boolean) e.getValue()).booleanValue());
+			getColorTableData().refreshPreview();
+			getLastColorTableUI().setColorTable(getColorTableData().getColorTable());
+			return;
+		}
+
+		if (e.getName().equals("limits") ||
+				e.getName().equals("maxim") ||
+				e.getName().equals("minim")) {
+			if (getColorTableData().isLimitsEnabled()) {
+				double min = getColorTableData().getMinim();
+				double max = getColorTableData().getMaxim();
+				getLastColorTableUI().getColorTable().createColorTableInRange(min, max, false);
+				getLastColorTableUI().setColorTable(getLastColorTableUI().getColorTable());
+				getColorTableData().refreshPreview();
+			} else {
+				try {
+					colorTablePanel.reloadPanelsFromLibraryPanel();
+				} catch (ColorTableException e1) {
+					//Esta excepci�n ya se ha debido capturar en la carga del dialogo por lo que no deber�a darse
+				}
+			}
+			return;
+		}
+	}
+	
+	/**
+	 * Recarga la tabla de elementos
+	 * @param isNewSelection
+	 */
+	public void refreshItems(boolean isNewSelection) {
+		if (getColorTableData().getColorTable() == null)
+			return;
+
+		if (isNewSelection)
+			getColorTableData().getColorTable().removeDuplicatedValues();
+
+		getLastColorTableUI().setColorTable(getColorTableData().getColorTable());
+	}
+
+	/**
+	 * Pone en separaciones iguales todos los valores de la tabla seleccionada
+	 */
+	public void equidistar() {
+		ColorTable colorTable = getColorTableData().getColorTable();
+		if (colorTable == null)
+			return;
+		colorTable.removeDuplicatedValues();
+		List<ColorItem> list = colorTable.getColorItems();
+		double min2 = Double.POSITIVE_INFINITY;
+		double max2 = Double.NEGATIVE_INFINITY;
+		for (int i = 0; i < list.size(); i++) {
+			ColorItem colorItem = (ColorItem) list.get(i);
+			if (min2 > colorItem.getValue())
+				min2 = colorItem.getValue();
+			if (max2 < colorItem.getValue())
+				max2 = colorItem.getValue();
+		}
+		for (int i = 0; i < list.size(); i++) {
+			ColorItem colorItem = (ColorItem) list.get(i);
+			colorItem.setValue(min2 + (((max2 - min2) / (list.size() - 1)) * i));
+		}
+		refreshItems(true);
+		getColorTableData().refreshPreview();
+	}
+	
+	/**
+	 * @return the lastColorTableUI
+	 */
+	private IColorTableUI getLastColorTableUI() {
+		return lastColorTableUI;
+	}
+
+	/**
+	 * @param lastColorTableUI the lastColorTableUI to set
+	 */
+	public void setLastColorTableUI(IColorTableUI lastColorTableUI) {
+		this.lastColorTableUI = lastColorTableUI;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.colortable.panels.ColorTableUIListener#actionColorTableUIChanged(org.gvsig.rastertools.colortable.panels.IColorTableUI)
+	 */
+	public void actionColorTableUIChanged(IColorTableUI colorTableUI) {
+		ColorTable colorTable = colorTablePanel.getColorTableLibraryPanel().getColorTableSelected();
+		colorTable.createPaletteFromColorItems(colorTableUI.getColorTable().getColorItems(), false);
+		colorTablePanel.getColorTableLibraryPanel().setColorTableSelected(colorTable);
+
+		getColorTableData().setColorTable((ColorTable) colorTableUI.getColorTable().clone());
+		getColorTableData().refreshPreview();
+		//getLastColorTableUI().setColorTable(getColorTableData().getColorTable());
+	}
+
+	public void process(DataSourcePreview rendering) throws ImageUnavailableException {
+		if(!showPreview)
+			throw new ImageUnavailableException(RasterToolsUtil.getText(this, "panel_preview_not_available"));
+		
+//		rendering.getRenderFilterList().pushStatus();
+		try {
+			if(!(rendering.getSource() instanceof FLyrRaster))
+				return;
+			FLyrRaster lyr = (FLyrRaster)rendering.getSource();
+			applyColorTable(lyr, true);
+		} catch (FilterTypeException e1) {
+			RasterSwingLibrary.messageBoxError(PluginServices.getText(this, "error_adding_filters"), this, e1);
+		} catch (FilterManagerException e) {
+			RasterSwingLibrary.messageBoxError(PluginServices.getText(this, "error_adding_filters"), this, e);
+		}
+	}
+	
+	/**
+	 * Obtiene el flag que informa de si se est� mostrando la previsualizaci�n o no.
+	 * En caso de no mostrarse se lanza una excepci�n ImageUnavailableExcepcion con el 
+	 * mensaje "La previsualizaci�n no est� disponible para este panel"
+	 * @return
+	 */
+	public boolean isShowPreview() {
+		return showPreview;
+	}
+	
+	/**
+	 * Asigna el flag para mostrar u ocultar la preview. En caso de no mostrarse se lanza una 
+	 * excepci�n ImageUnavailableExcepcion con el mensaje "La previsualizaci�n no est� disponible para
+	 * este panel"
+	 * @param showPreview
+	 */
+	public void setShowPreview(boolean showPreview) {
+		this.showPreview = showPreview;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/ColorTableListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ColorTableTocMenuEntry.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ColorTableTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ColorTableTocMenuEntry.java	(revision 8183)
@@ -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.tools.app.basic.tool.colortable;
+
+import javax.swing.Icon;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.dal.coverage.exception.ColorTableException;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.layers.ILayerState;
+import org.gvsig.raster.fmap.layers.IRasterLayerActions;
+import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.tool.colortable.ui.ColorTableDialog;
+/**
+ * <code>ColorTableTocMenuEntry</code> es el punto de entrada del menu de la
+ * tabla de color
+ * 
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public class ColorTableTocMenuEntry extends AbstractTocContextMenuAction implements IGenericToolBarMenuItem {
+	static private ColorTableTocMenuEntry singleton  = null;
+
+	/**
+	 * Nadie puede crear una instancia a esta clase �nica, hay que usar el
+	 * getSingleton()
+	 */
+	private ColorTableTocMenuEntry() {}
+
+	/**
+	 * Devuelve un objeto unico a dicha clase
+	 * @return
+	 */
+	static public ColorTableTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new ColorTableTocMenuEntry();
+		return singleton;
+	}
+
+	public String getGroup() {
+		return "RasterLayer";
+	}
+
+	public int getGroupOrder() {
+		return 10;
+	}
+
+	public int getOrder() {
+		return 40;
+	}
+
+	public String getText() {
+		return Messages.getText("tablas_color");
+	}
+
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof FLyrRaster))
+			return false;
+
+		if (!((ILayerState) selectedItems[0]).isOpen())
+			return false;
+
+		return true;
+	}
+
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof FLyrRaster))
+			return false;
+		
+		if (((FLyrRaster) selectedItems[0]).getDataStore() != null &&
+				(((FLyrRaster) selectedItems[0]).getDataStore().getBandCount() == 1) &&
+				(((IRasterLayerActions) selectedItems[0]).isActionEnabled(IRasterLayerActions.COLOR_TABLE)))
+					return true;
+		return false;
+	}
+
+	public synchronized void execute(ITocItem item, FLayer[] selectedItems) {
+		if(selectedItems[0] instanceof FLyrRaster) {
+			ColorTableDialog colorTableDialog = null;
+			try {
+				colorTableDialog = new ColorTableDialog((FLyrRaster)selectedItems[0], 660, 465);
+			} catch (ColorTableException e) {
+				RasterSwingLibrary.messageBoxError("colortables_not_loaded", PluginServices.getMDIManager().getActiveWindow(), e);
+				return;
+			}
+			PluginServices.getMDIManager().addCentredWindow(colorTableDialog);
+		}
+	}
+	
+	public Icon getIcon() {
+		return IconThemeHelper.getImageIcon("layer-color-table");
+	}
+	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ColorTableTocMenuEntry.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ClippingTocMenuEntry.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ClippingTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ClippingTocMenuEntry.java	(revision 8183)
@@ -0,0 +1,163 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.clip;
+
+import java.awt.geom.AffineTransform;
+
+import javax.swing.Icon;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.app.project.documents.view.toolListeners.StatusBarListener;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseMovementBehavior;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.layers.ILayerState;
+import org.gvsig.raster.fmap.layers.IRasterLayerActions;
+import org.gvsig.raster.fmap.tool.behavior.TransformedRectangleBehavior;
+import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.tool.clip.ui.ClippingDialog;
+import org.gvsig.raster.tools.app.basic.tool.clip.ui.listener.ClippingMouseViewListener;
+import org.gvsig.raster.tools.app.basic.tool.clip.ui.listener.ClippingPanelListener;
+
+/**
+ * <code>ClippingTocMenuEntry</code> es el punto de entrada del menu del
+ * recorte.
+ *
+ * @version 17/04/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class ClippingTocMenuEntry extends AbstractTocContextMenuAction implements IGenericToolBarMenuItem {
+	static private ClippingTocMenuEntry singleton = null;
+
+	/**
+	 * Nadie puede crear una instancia a esta clase �nica, hay que usar el
+	 * getSingleton()
+	 */
+	private ClippingTocMenuEntry() {}
+
+	/**
+	 * Devuelve un objeto unico a dicha clase
+	 * @return
+	 */
+	static public ClippingTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new ClippingTocMenuEntry();
+		return singleton;
+	}
+
+	/**
+	 * Carga el listener de salvar a raster en el MapControl.
+	 */
+	private void loadClippingListener(MapControl m_MapControl, ClippingMouseViewListener clippingMouseViewListener, FLyrRaster lyr) {
+		// Si no se ha cargado el listener a�n lo cargamos.
+		StatusBarListener sbl = new StatusBarListener(m_MapControl);
+		TransformedRectangleBehavior trb = new TransformedRectangleBehavior(clippingMouseViewListener);
+		AffineTransform at = ((FLyrRaster)lyr).getAffineTransform();
+		trb.setAffineTransform(at);
+		m_MapControl.addBehavior("clipRaster", new Behavior[] { trb, new MouseMovementBehavior(sbl) });
+	}
+
+	public String getGroup() {
+		return "RasterExport";
+	}
+
+	public int getGroupOrder() {
+		return 50;
+	}
+
+	public int getOrder() {
+		return 2;
+	}
+
+	public String getText() {
+		return RasterToolsUtil.getText(this, "recorte");
+	}
+
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof ILayerState))
+			return false;
+
+		if (!((ILayerState) selectedItems[0]).isOpen())
+			return false;
+		return true;
+	}
+
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof IRasterLayerActions))
+			return false;
+
+		return ((IRasterLayerActions) selectedItems[0]).isActionEnabled(IRasterLayerActions.CLIPPING);
+	}
+
+	@SuppressWarnings("deprecation")
+	public void execute(ITocItem item, FLayer[] selectedItems) {
+		FLayer fLayer = null;
+		AbstractViewPanel theView = (AbstractViewPanel) PluginServices.getMDIManager().getActiveWindow();
+		MapControl mapCtrl = theView.getMapControl();
+
+		if (selectedItems.length != 1)
+			return;
+
+		fLayer = selectedItems[0];
+
+		if (!(fLayer instanceof FLyrRaster))
+			return;
+
+		ClippingDialog clippingDialog = new ClippingDialog(420, 290, fLayer.getName());
+
+		ClippingPanelListener clippingPanelListener = new ClippingPanelListener(clippingDialog.getClippingPanel());
+		clippingPanelListener.setLayer((FLyrRaster)fLayer);
+		clippingDialog.getClippingPanel().setClippingListener(clippingPanelListener);
+
+		ClippingData clippingData = new ClippingData();
+		clippingPanelListener.setData(clippingData);
+		clippingData.addObserver(clippingDialog.getClippingPanel());
+
+		ClippingMouseViewListener clippingMouseViewListener = new ClippingMouseViewListener(mapCtrl, clippingDialog.getClippingPanel(), clippingData, (FLyrRaster)fLayer);
+		loadClippingListener(mapCtrl, clippingMouseViewListener, ((FLyrRaster)fLayer));
+		
+		clippingData.updateObservers();
+		
+		clippingDialog.getClippingPanel().getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY).setEnabled(false);
+		clippingDialog.getClippingPanel().getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT).setEnabled(false);
+		
+		RasterToolsUtil.addWindow(clippingDialog);
+	}
+
+	public Icon getIcon() {
+		return RasterToolsUtil.getIcon("layer-clip-raster");
+	}
+	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ClippingTocMenuEntry.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/panel/ClippingSelectionPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/panel/ClippingSelectionPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/panel/ClippingSelectionPanel.java	(revision 8183)
@@ -0,0 +1,138 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+package org.gvsig.raster.tools.app.basic.tool.clip.ui.panel;
+
+import java.awt.BorderLayout;
+import java.io.File;
+
+import javax.swing.JPanel;
+
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
+import org.gvsig.fmap.dal.coverage.store.parameter.TileDataParameters;
+import org.gvsig.gui.beans.table.TableContainer;
+import org.gvsig.gui.beans.table.exceptions.NotInitializeException;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+
+/**
+ * Panel de seleccion de que bandas. Permite seleccionar que bandas se van a
+ * guardar y especificar su orden.
+ *
+ * @version 25/09/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class ClippingSelectionPanel extends JPanel {
+  private static final long serialVersionUID = 813234785743904477L;
+	private TableContainer tableContainer = null;
+
+	/**
+	 * Construye un Panel de seleccion para el recorte
+	 */
+	public ClippingSelectionPanel() {
+		initialize();
+	}
+
+
+	private void initialize() {
+		setLayout(new BorderLayout());
+		add(getTableContainer(), BorderLayout.CENTER);
+	}
+
+	/**
+	 * Obtiene la tabla de selecci�n de bandas
+	 * @return Tabla de selecci�n de bandas
+	 */
+	public TableContainer getTableContainer() {
+		if (tableContainer == null) {
+			String[] columnNames = {Messages.getText("bandas"), Messages.getText("nombre"), ""};
+			int[] columnWidths = {55, 305, 0};
+			tableContainer = new TableContainer(columnNames, columnWidths);
+			tableContainer.setModel("CheckBoxModel");
+			tableContainer.initialize();
+			tableContainer.setControlVisible(false);
+			tableContainer.setMoveRowsButtonsVisible(true);
+
+			tableContainer.getTable().getJTable().getColumnModel().getColumn(2).setMinWidth(0);
+			tableContainer.getTable().getJTable().getColumnModel().getColumn(2).setMaxWidth(0);
+			tableContainer.getTable().getJTable().getColumnModel().getColumn(0).setMinWidth(55);
+			tableContainer.getTable().getJTable().getColumnModel().getColumn(0).setMaxWidth(55);
+
+		}
+
+		return tableContainer;
+	}
+
+	/**
+	 * Establecer la capa para usarla en el recorte
+	 * @param fLayer
+	 */
+	public void setLayer(FLyrRaster fLayer) {
+		// Rellenar el arbol de bandas
+		RasterDataStore dataStore = fLayer.getDataStore();
+		int cont = 0;
+
+		RasterDataParameters[] params = dataStore.getDataParametersByProvider();
+		int[] nBands = dataStore.getBandCountByProvider();
+
+		for (int i = 0; i < params.length; i++) {
+			String fName = null;
+			if(params[i] instanceof RasterDataParameters)
+				fName = ((RasterDataParameters)params[i]).getURI().getPath();
+			if(params[i] == null && params[i] instanceof TileDataParameters && ((TileDataParameters)params[i]).getName() != null)
+				fName = ((TileDataParameters)params[i]).getName();
+			cont = loadBandsTable(nBands[i], fName, cont);
+		}
+	}
+
+	/**
+	 * Loads the band table
+	 * @param dataStore
+	 * @param fName
+	 * @param cont
+	 * @return
+	 */
+	private int loadBandsTable(int nBands, String fName, int cont) {
+		String bandName = new File(fName).getName();
+
+		if (nBands > 1) {
+			for (int b = 0; b < nBands; b++) {
+				Object row[] = { new Boolean(true), new String("B" + (b + 1) + " - " + bandName), new Integer(cont++)};
+				try {
+					getTableContainer().addRow(row);
+				} catch (NotInitializeException e) {
+					RasterSwingLibrary.messageBoxError("error_rowtable", this, e);
+				}
+			}
+		} else {
+			Object row[] = { new Boolean(true), new String("B - " + bandName), new Integer(cont++)};
+			try {
+				getTableContainer().addRow(row);
+			} catch (NotInitializeException e) {
+				RasterSwingLibrary.messageBoxError("error_rowtable", this, e);
+			}
+		}
+
+		return cont;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/panel/ClippingSelectionPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/panel/ClippingCoordinatesPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/panel/ClippingCoordinatesPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/panel/ClippingCoordinatesPanel.java	(revision 8183)
@@ -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.tools.app.basic.tool.clip.ui.panel;
+
+import java.awt.Component;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.gui.beans.coordinatespanel.CoordinatesPanel;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.swing.RasterSwingLocator;
+import org.gvsig.raster.swing.buttonbar.ButtonBar;
+import org.gvsig.raster.tools.app.basic.tool.clip.ui.listener.ClippingPanelListener;
+
+/**
+ * Panel for selecting coordinates. The user will introduce real or pixel
+ * coordinates in this panel to choose the clip area.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ClippingCoordinatesPanel extends JPanel {
+  private static final long serialVersionUID = -410791369185749893L;
+	private CoordinatesPanel   coordinatesPixel   = null;
+	private CoordinatesPanel   coordinatesReales  = null;
+	private ButtonBar          buttonBarContainer = null;
+
+  public ClippingCoordinatesPanel() {
+  	initialize();
+  }
+  
+  /**
+   * A�ade los listener a los controles
+   * que lo necesiten 
+   * @param list
+   */
+  public void setClippingListener(ClippingPanelListener clippingPanelListener) {
+	  getPixelCoordinates().addValueChangedListener(clippingPanelListener);
+	  getRealCoordinates().addValueChangedListener(clippingPanelListener);
+	  getButtonBarContainer().getButton(0).addActionListener(clippingPanelListener);
+	  getButtonBarContainer().getButton(1).addActionListener(clippingPanelListener);
+	  getButtonBarContainer().getButton(2).addActionListener(clippingPanelListener);
+	  getButtonBarContainer().getButton(3).addActionListener(clippingPanelListener);
+	  getButtonBarContainer().getButton(4).addActionListener(clippingPanelListener);
+	  getButtonBarContainer().getButton(5).addActionListener(clippingPanelListener);
+  }
+  
+  /**
+   * Inicializa los componentes gr�ficos
+   */
+  private void initialize() {
+		setLayout(new GridBagLayout());
+
+		GridBagConstraints gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(5, 5, 2, 5);
+		add(getPixelCoordinates(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(2, 5, 2, 5);
+		add(getRealCoordinates(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 2;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.anchor = GridBagConstraints.CENTER;
+		gridBagConstraints.insets = new Insets(2, 5, 5, 5);
+		add((Component)getButtonBarContainer(), gridBagConstraints);
+  }
+  
+
+	/**
+	 * This method initializes jPanel
+	 * @return javax.swing.JPanel
+	 */
+	public CoordinatesPanel getPixelCoordinates() {
+		if (coordinatesPixel == null) {
+			coordinatesPixel = new CoordinatesPanel();
+			coordinatesPixel.setTitlePanel(Messages.getText("coordenadas_pixel"));
+		}
+		return coordinatesPixel;
+	}
+
+	/**
+	 * This method initializes jPanel1
+	 * @return javax.swing.JPanel
+	 */
+	public CoordinatesPanel getRealCoordinates() {
+		if (coordinatesReales == null) {
+			coordinatesReales = new CoordinatesPanel();
+			coordinatesReales.setTitlePanel(PluginServices.getText(this, "coordenadas_reales")
+);
+		}
+		return coordinatesReales;
+	}
+	
+	/**
+	 * This method initializes jButton
+	 * @return javax.swing.JButton
+	 */
+	public ButtonBar getButtonBarContainer() {
+		if (buttonBarContainer == null) {
+			buttonBarContainer = RasterSwingLocator.getSwingManager().createButtonBar();
+			buttonBarContainer.addButton("view-export-image", Messages.getText("load_parameters"), 0);
+			buttonBarContainer.addButton("import-icon", Messages.getText("save_parameters"), 1);
+			buttonBarContainer.addButton("round-icon", Messages.getText("round_pixels"), 2);
+			buttonBarContainer.addButton("layer-modify-roi", Messages.getText("adjust_to_rois"), 3);
+			buttonBarContainer.addButton("fullextent-icon", Messages.getText("fullExtent"), 4);
+			buttonBarContainer.addButton("selecttool-icon", Messages.getText("select_tool"), 5);
+			buttonBarContainer.setButtonAlignment("right");
+			buttonBarContainer.setComponentBorder(false);
+			//buttonBarContainer.setBorder(BorderFactory.createLineBorder(new Color(189, 190, 176)));
+		}
+		return buttonBarContainer;
+	}
+	
+	/**
+	 * Asigna los valores de las coordenadas reales.
+	 * @param values
+	 */
+	public void setCoordReal(String[] values) {
+		getRealCoordinates().setValues(values);
+	}
+	
+	/**
+	 * Asigna los valores de las coordenadas p�xel.
+	 * @return
+	 */
+	public void setCoordPixel(String[] values) {
+		getPixelCoordinates().setValues(values);
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/panel/ClippingCoordinatesPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/panel/ClippingOptionsPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/panel/ClippingOptionsPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/panel/ClippingOptionsPanel.java	(revision 8183)
@@ -0,0 +1,287 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.clip.ui.panel;
+
+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.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.io.File;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+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.i18n.Messages;
+
+/**
+ * Panel with general clip options
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ClippingOptionsPanel extends JPanel implements PropertyListener, ItemListener, ActionListener {
+	private static final long serialVersionUID = 7299254074235648334L;
+	private JPanel     jPNameFile           = null;
+	private JPanel     jPNameDirectory      = null;
+	private JCheckBox  jCheckBox            = null;
+	private JCheckBox  jCheckLoadLayerInToc = null;
+	private JButton    jBChooseDirectory    = null;
+	private JLabel     jLabelDirectory      = null;
+	private JCheckBox  jCheckSaveFile       = null;
+	private JTextField filenameTextField    = null;
+	private JTextField directoryTextField   = null;
+
+	public ClippingOptionsPanel() {
+		initialize();
+	}
+
+	private void initialize() {
+		GridBagConstraints gridBagConstraints = null;
+
+		setLayout(new GridBagLayout());
+
+		gridBagConstraints = new java.awt.GridBagConstraints();
+		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new java.awt.Insets(5, 5, 2, 5);
+		add(getJPNameFile(), gridBagConstraints);
+
+		gridBagConstraints = new java.awt.GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.insets = new java.awt.Insets(2, 5, 2, 5);
+		add(getCbOneLyrPerBand(), gridBagConstraints);
+
+		gridBagConstraints = new java.awt.GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 2;
+		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.insets = new java.awt.Insets(2, 5, 2, 5);
+		//Preguntamos al acabar para que no nos peten la aplicaci�n
+		//add(getCbLoadLayerInToc(), gridBagConstraints);
+
+		gridBagConstraints = new java.awt.GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 3;
+		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.insets = new java.awt.Insets(2, 5, 2, 5);
+		add(getCbSaveFile(), gridBagConstraints);
+
+		gridBagConstraints = new java.awt.GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 4;
+		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.insets = new java.awt.Insets(2, 5, 5, 5);
+		add(getJPNameDirectory(), gridBagConstraints);
+
+		updateNewLayerText();
+	}
+
+	/**
+	 * This method initializes jPNameFile
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getJPNameFile() {
+		if (jPNameFile == null) {
+			jPNameFile = new JPanel();
+			jPNameFile.add(new JLabel(Messages.getText("nombre_capas") + ":"));
+			jPNameFile.add(getFilenameTextField());
+		}
+		return jPNameFile;
+	}
+
+	/**
+	 * This method initializes jPNameFile
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getJPNameDirectory() {
+		if (jPNameDirectory == null) {
+			GridBagConstraints gridBagConstraints = null;
+			jPNameDirectory = new JPanel();
+
+			jPNameDirectory.setLayout(new GridBagLayout());
+
+			gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.insets = new Insets(2, 5, 5, 2);
+			jPNameDirectory.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);
+			jPNameDirectory.add(getDirectoryTextField(), gridBagConstraints);
+
+			gridBagConstraints = new java.awt.GridBagConstraints();
+			gridBagConstraints.insets = new java.awt.Insets(2, 2, 5, 5);
+			jPNameDirectory.add(getJBChooseDirectory(), gridBagConstraints);
+
+			getJBChooseDirectory().addActionListener(this);
+		}
+		return jPNameDirectory;
+	}
+
+	/**
+	 * This method initializes jCheckLoadLayerInToc
+	 * @return javax.swing.JCheckBox
+	 */
+	public JCheckBox getCbLoadLayerInToc() {
+		if (jCheckLoadLayerInToc == null) {
+			jCheckLoadLayerInToc = new JCheckBox();
+			jCheckLoadLayerInToc.setText(PluginServices.getText(this, "cargar_en_toc"));
+			jCheckLoadLayerInToc.setSelected(true);
+			jCheckLoadLayerInToc.setEnabled(false);
+			jCheckLoadLayerInToc.addItemListener(this);
+		}
+		return jCheckLoadLayerInToc;
+	}
+
+	/**
+	 * This method initializes jCheckBox
+	 * @return javax.swing.JCheckBox
+	 */
+	public JCheckBox getCbOneLyrPerBand() {
+		if (jCheckBox == null) {
+			jCheckBox = new JCheckBox();
+			jCheckBox.setText(PluginServices.getText(this, "crear_1_capa_por_banda"));
+		}
+		return jCheckBox;
+	}
+
+	/**
+	 * Cada vez que cambia un checkbox de cargar en toc o guardar en fichero, nos
+	 * aseguramos de que no pueden estar las dos opciones desmarcadas
+	 */
+	public void itemStateChanged(ItemEvent e) {
+		getCbLoadLayerInToc().setEnabled(true);
+		getCbSaveFile().setEnabled(true);
+		if (getCbLoadLayerInToc().isSelected() && !getCbSaveFile().isSelected())
+			getCbLoadLayerInToc().setEnabled(false);
+		if (!getCbLoadLayerInToc().isSelected() && getCbSaveFile().isSelected())
+			getCbSaveFile().setEnabled(false);
+
+		getJBChooseDirectory().setEnabled(getCbSaveFile().isSelected());
+		getDirectoryTextField().setEnabled(getCbSaveFile().isSelected());
+		getJLabelDirectory().setEnabled(getCbSaveFile().isSelected());
+	}
+
+	private JButton getJBChooseDirectory() {
+		if (jBChooseDirectory == null) {
+			jBChooseDirectory = new JButton(PluginServices.getText(this, "cambiar_ruta"));
+			jBChooseDirectory.setEnabled(false);
+		}
+		return jBChooseDirectory;
+	}
+
+	private JLabel getJLabelDirectory() {
+		if (jLabelDirectory == null) {
+			jLabelDirectory = new JLabel(PluginServices.getText(this, "ruta") + ":");
+			jLabelDirectory.setEnabled(false);
+		}
+		return jLabelDirectory;
+	}
+
+	/**
+	 * This method initializes jCheckSaveFile
+	 *
+	 * @return javax.swing.JCheckBox
+	 */
+	public JCheckBox getCbSaveFile() {
+		if (jCheckSaveFile == null) {
+			jCheckSaveFile = new JCheckBox();
+			jCheckSaveFile.setText(PluginServices.getText(this, "guardar_en_disco"));
+			jCheckSaveFile.addItemListener(this);
+		}
+		return jCheckSaveFile;
+	}
+
+	/**
+	 * This method initializes filenameTextField
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	public JTextField getFilenameTextField() {
+		if (filenameTextField == null) {
+			filenameTextField = new JTextField();
+			filenameTextField.setPreferredSize(new Dimension(150, filenameTextField.getPreferredSize().height));
+			RasterLocator.getManager().getFileUtils().addOnlyLayerNameListener(this);
+		}
+		return filenameTextField;
+	}
+
+	/**
+	 * This method initializes filenameTextField
+	 *
+	 * @return javax.swing.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()));
+	}
+
+	/**
+	 * Especificar el nombre de la nueva capa para el recuadro de texto asign�ndo
+	 * en cada llamada un nombre consecutivo.
+	 */
+	public void updateNewLayerText() {
+		filenameTextField.setText(RasterLocator.getManager().getFileUtils().getOnlyLayerName());
+	}
+
+	/**
+	 * Cuando alguien ha cambiado la propiedad del nombre de la 
+	 * capa se actualiza autom�ticamente
+	 */
+	public void actionValueChanged(PropertyEvent e) {
+		updateNewLayerText();
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/panel/ClippingOptionsPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/panel/ClippingResolutionPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/panel/ClippingResolutionPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/panel/ClippingResolutionPanel.java	(revision 8183)
@@ -0,0 +1,371 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.clip.ui.panel;
+
+import java.awt.Font;
+import java.awt.GridBagConstraints;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.border.TitledBorder;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.gui.beans.datainput.DataInputContainer;
+import org.gvsig.i18n.Messages;
+
+/**
+ * <code>ResolutionPanel</code> sirve para controlar las redimensiones por
+ * interpolaci�n
+ *
+ * @version 17/04/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class ClippingResolutionPanel extends JPanel implements ActionListener {
+	private static final long serialVersionUID = 2570616093263451091L;
+	private JPanel             pButtons       = null;
+	private DataInputContainer cCellSize      = null;
+	private DataInputContainer cHeight        = null;
+	private DataInputContainer cWidth         = null;
+	private JRadioButton       rSize          = null;
+	private JRadioButton       rWidthH        = null;
+	private JComboBox          cInterpolation = null;
+	private JButton            buttonRestore  = null;
+
+	/**
+	 * This is the default constructor
+	 */
+	public ClippingResolutionPanel() {
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 * @return void
+	 */
+	private void initialize() {
+		GridBagConstraints gridBagConstraints;
+
+		setLayout(new java.awt.GridBagLayout());
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridwidth = 2;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.weightx = 1;
+		gridBagConstraints.insets = new Insets(2, 8, 6, 8);
+		add(getPButtons(), gridBagConstraints);
+
+		gridBagConstraints.gridwidth = 1;
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		add(getComboInterpolation(), gridBagConstraints);
+		
+		JLabel jLabel = new JLabel();
+		jLabel.setText(Messages.getText("interpolacion") + ":");
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		add(jLabel, gridBagConstraints);
+
+		gridBagConstraints.gridwidth = 2;
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 2;
+		gridBagConstraints.gridwidth = 2;
+		add(getCCellSize(), gridBagConstraints);
+
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 3;
+		gridBagConstraints.gridwidth = 2;
+		add(getCWidth(), gridBagConstraints);
+
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 4;
+		gridBagConstraints.gridwidth = 2;
+		add(getCHeight(), gridBagConstraints);
+
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 5;
+		gridBagConstraints.gridwidth = 2;
+		gridBagConstraints.fill = java.awt.GridBagConstraints.NONE;
+		add(getButtonRestore(), gridBagConstraints);
+
+		getRSize().addActionListener(this);
+		getRWidthH().addActionListener(this);
+		getRSize().setSelected(true);
+		getCWidth().setControlEnabled(false);
+		getCHeight().setControlEnabled(false);
+	}
+
+	/**
+	 * This method initializes jPanel1
+	 * @return javax.swing.JPanel
+	 */
+	public DataInputContainer getCCellSize() {
+		if (cCellSize == null) {
+			cCellSize = new DataInputContainer();
+			cCellSize.setLabelText(Messages.getText("celda"));
+		}
+		return cCellSize;
+	}
+
+	/**
+	 * This method initializes jPanel2
+	 * @return javax.swing.JPanel
+	 */
+	public DataInputContainer getCHeight() {
+		if (cHeight == null) {
+			cHeight = new DataInputContainer();
+			cHeight.setLabelText(Messages.getText("alto"));
+		}
+		return cHeight;
+	}
+	
+	public JButton getButtonRestore() {
+		if (buttonRestore == null) {
+			buttonRestore = new JButton(Messages.getText("restablecer"));
+		}
+		return buttonRestore;
+	}
+
+	/**
+	 * This method initializes jPanel
+	 * @return javax.swing.JPanel
+	 */
+	public DataInputContainer getCWidth() {
+		if (cWidth == null) {
+			cWidth = new DataInputContainer();
+			cWidth.setLabelText(Messages.getText("ancho"));
+		}
+		return cWidth;
+	}
+
+	/**
+	 * This method initializes jPanel
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getPButtons() {
+		if (pButtons == null) {
+			pButtons = new JPanel();
+			pButtons.setLayout(new java.awt.GridBagLayout());
+			pButtons.setBorder(javax.swing.BorderFactory.createTitledBorder(
+					BorderFactory.createTitledBorder(null, 
+							Messages.getText("resolution_method_selection"), 
+							TitledBorder.DEFAULT_JUSTIFICATION, 
+							TitledBorder.DEFAULT_POSITION, 
+							new Font("Dialog", Font.PLAIN, 12), 
+							null)));
+
+			GridBagConstraints gridBagConstraints;
+			gridBagConstraints = new java.awt.GridBagConstraints();
+			gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+			gridBagConstraints.weightx = 1.0;
+			gridBagConstraints.insets = new Insets(0, 10, 0, 0);
+			pButtons.add(getRSize(), gridBagConstraints);
+
+			gridBagConstraints = new java.awt.GridBagConstraints();
+			gridBagConstraints.gridx = 0;
+			gridBagConstraints.gridy = 1;
+			gridBagConstraints.insets = new Insets(0, 10, 0, 0);
+			gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+			pButtons.add(getRWidthH(), gridBagConstraints);
+		}
+		return pButtons;
+	}
+
+	/**
+	 * This method initializes jRadioButton
+	 * @return javax.swing.JRadioButton
+	 */
+	private JRadioButton getRSize() {
+		if (rSize == null) {
+			rSize = new JRadioButton(Messages.getText("tamanyo_celda"));
+		}
+		return rSize;
+	}
+
+	/**
+	 * This method initializes jRadioButton1
+	 * @return javax.swing.JRadioButton
+	 */
+	private JRadioButton getRWidthH() {
+		if (rWidthH == null) {
+			rWidthH = new JRadioButton(Messages.getText("ancho_x_alto"));
+		}
+		return rWidthH;
+	}
+
+	/**
+	 * This method initializes jComboBox
+	 * @return javax.swing.JComboBox
+	 */
+	public JComboBox getComboInterpolation() {
+		if (cInterpolation == null) {
+			cInterpolation = new JComboBox();
+			cInterpolation.addItem(Messages.getText("vecino_+_proximo"));
+			cInterpolation.addItem(Messages.getText("bilinear"));
+			cInterpolation.addItem(Messages.getText("distancia_inversa"));
+			cInterpolation.addItem(Messages.getText("b_splines"));
+			// cInterpolation.addItem(PluginServices.getText(this, "bicubico"));
+		}
+		return cInterpolation;
+	}
+
+	/**
+	 * Obtiene el valor correspondiente al m�todo de interpolaci�n seleccionado en
+	 * el JComboBox
+	 * @return M�todo de interpolaci�n interpretable con las variables definidas
+	 *         en BufferInterpolation.
+	 */
+	public int getSelectedInterpolationMethod() {
+		switch (getComboInterpolation().getSelectedIndex()) {
+			case 0:
+				return Buffer.INTERPOLATION_NearestNeighbour;
+			case 1:
+				return Buffer.INTERPOLATION_Bilinear;
+			case 2:
+				return Buffer.INTERPOLATION_InverseDistance;
+			case 3:
+				return Buffer.INTERPOLATION_BSpline;
+		}
+		return Buffer.INTERPOLATION_Undefined;
+	}
+
+	/**
+	 * Asigna el valor del campo "tama�o de celda" a partir del double que lo
+	 * representa y con el n�mero de decimales que se especifica en el par�metro
+	 * dec
+	 * @param cellSize Tama�o de celda en double
+	 * @param dec N�mero de decimales
+	 */
+	public void setCellSizeText(double cellSize, int dec) {
+		int indexPoint = String.valueOf(cellSize).indexOf('.');
+		try {
+			cCellSize.setValue(String.valueOf(cellSize).substring(0, indexPoint + dec));
+		} catch (StringIndexOutOfBoundsException ex) {
+			cCellSize.setValue(String.valueOf(cellSize));
+		} catch (NumberFormatException ex) {
+			cCellSize.setValue(String.valueOf(cellSize));
+		}
+	}
+
+	/**
+	 * Asigna el valor del campo "Ancho" a partir del double que lo representa y
+	 * con el n�mero de decimales que se especifica en el par�metro dec
+	 * @param width Ancho
+	 * @param dec N�mero de decimales
+	 */
+	public void setWidthText(double width, int dec) {
+		int indexPoint = String.valueOf(width).indexOf('.');
+		try {
+			cWidth.setValue(String.valueOf(width).substring(0, indexPoint + dec));
+		} catch (StringIndexOutOfBoundsException ex) {
+			cWidth.setValue(String.valueOf(width));
+		} catch (NumberFormatException ex) {
+			cWidth.setValue(String.valueOf(width));
+		}
+	}
+
+	/**
+	 * Asigna el valor del campo "Alto" a partir del double que lo representa y
+	 * con el n�mero de decimales que se especifica en el par�metro dec
+	 * @param height Alto
+	 * @param dec N�mero de decimales
+	 */
+	public void setHeightText(double height, int dec) {
+		int indexPoint = String.valueOf(height).indexOf('.');
+		try {
+			cHeight.setValue(String.valueOf(height).substring(0, indexPoint + dec));
+		} catch (StringIndexOutOfBoundsException ex) {
+			cHeight.setValue(String.valueOf(height));
+		} catch (NumberFormatException ex) {
+			cHeight.setValue(String.valueOf(height));
+		}
+	}
+
+	/**
+	 * Devuelve el valor del campo "tama�o de celda"
+	 * @return
+	 */
+	public double getCellSizeText() {
+		return Double.parseDouble(cCellSize.getValue());
+	}
+
+	/**
+	 * Devuelve el valor del campo "tama�o de celda"
+	 * @return
+	 */
+	public double getWidthText() {
+		return Double.parseDouble(cWidth.getValue());
+	}
+
+	/**
+	 * Devuelve el valor del campo "tama�o de celda"
+	 * @return
+	 */
+	public double getHeightText() {
+		return Double.parseDouble(cHeight.getValue());
+	}
+
+	/**
+	 * Devuelve los valores de Alto x Acho de la resoluci�n espacial
+	 * @return
+	 */
+	public String[] getWidthHeight() {
+		String[] text = { cWidth.getValue(), cHeight.getValue() };
+		return text;
+	}
+
+	/**
+	 * Devuelve el metodo de interpolacion.
+	 * @return
+	 */
+	public String getInterpolation() {
+		return (String) getComboInterpolation().getSelectedItem();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+	 */
+	public void actionPerformed(ActionEvent e) {
+		if (e.getSource() == getRSize()) {
+			getRSize().setSelected(true);
+			getRWidthH().setSelected(false);
+			cCellSize.setControlEnabled(true);
+			cHeight.setControlEnabled(false);
+			cWidth.setControlEnabled(false);
+		}
+		if (e.getSource() == getRWidthH()) {
+			getRWidthH().setSelected(true);
+			getRSize().setSelected(false);
+			cCellSize.setControlEnabled(false);
+			cHeight.setControlEnabled(true);
+			cWidth.setControlEnabled(true);
+		}
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/panel/ClippingResolutionPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/panel
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/ClippingDialog.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/ClippingDialog.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/ClippingDialog.java	(revision 8183)
@@ -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.raster.tools.app.basic.tool.clip.ui;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.andami.ui.mdiManager.WindowInfo;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.util.FileUtils;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
+
+/**
+ * <code>ClippingDialog</code>. Creaci�n de la ventana de recorte para gvSIG.
+ *
+ * @version 17/04/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class ClippingDialog extends JPanel implements IWindow, ButtonsPanelListener {
+	private static final long  serialVersionUID = -5374834293534046986L;
+	private String             name             = null;
+
+	/**
+	 * Panel de recortado de imagen que est� en la libreria raster
+	 */
+	private ClippingPanel clippingPanel = null;
+
+	/**
+	 * Constructor
+	 * @param width Ancho
+	 * @param height Alto
+	 */
+	public ClippingDialog(int width, int height, String name) {
+		this.name = name;
+		this.setPreferredSize(new Dimension(width, height));
+		this.setSize(width, height);
+		this.setLayout(new BorderLayout(5, 5));
+		this.add(getClippingPanel(), java.awt.BorderLayout.CENTER);
+	}
+
+	/**
+	 * Obtiene el panel con el histograma
+	 * @return HistogramPanel
+	 */
+	public ClippingPanel getClippingPanel() {
+		if (clippingPanel == null) {
+			clippingPanel = new ClippingPanel(this);
+			clippingPanel.addButtonPressedListener(this);
+		}
+		return clippingPanel;
+	}
+
+	public WindowInfo getWindowInfo() {
+		WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODELESSDIALOG);
+		if (name != null)
+			m_viewinfo.setAdditionalInfo(name);
+		m_viewinfo.setTitle(PluginServices.getText(this, "recorte"));
+		m_viewinfo.setHeight(this.getHeight());
+		m_viewinfo.setWidth(this.getWidth());
+		return m_viewinfo;
+	}
+
+	/**
+	 * Acciones a ejecutar cuando se cancela
+	 */
+	public void close() {
+		try {
+			FileUtils util = RasterLocator.getManager().getFileUtils();
+			util.removeOnlyLayerNameListener(getClippingPanel().getOptionsPanel());
+			PluginServices.getMDIManager().closeWindow(this);
+		} catch (ArrayIndexOutOfBoundsException e) {
+			// Si la ventana no se puede eliminar no hacemos nada
+		}
+	}
+
+	public void actionButtonPressed(ButtonsPanelEvent e) {
+		if (e.getButton() == ButtonsPanel.BUTTON_CLOSE) {
+			close();
+		}
+	}
+
+	public Object getWindowProfile() {
+		return WindowInfo.PROPERTIES_PROFILE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/ClippingDialog.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/ClippingPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/ClippingPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/ClippingPanel.java	(revision 8183)
@@ -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.tools.app.basic.tool.clip.ui;
+
+import java.awt.BorderLayout;
+import java.util.Observable;
+import java.util.Observer;
+
+import javax.swing.JPanel;
+import javax.swing.JTabbedPane;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.util.RasterUtils;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.defaultbuttonspanel.DefaultButtonsPanel;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.tools.app.basic.tool.clip.ClippingData;
+import org.gvsig.raster.tools.app.basic.tool.clip.ui.listener.ClippingPanelListener;
+import org.gvsig.raster.tools.app.basic.tool.clip.ui.panel.ClippingCoordinatesPanel;
+import org.gvsig.raster.tools.app.basic.tool.clip.ui.panel.ClippingOptionsPanel;
+import org.gvsig.raster.tools.app.basic.tool.clip.ui.panel.ClippingResolutionPanel;
+import org.gvsig.raster.tools.app.basic.tool.clip.ui.panel.ClippingSelectionPanel;
+
+/**
+ * General panel for clipping. This panel contains a list of panels with the
+ * clip options. 
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ClippingPanel extends DefaultButtonsPanel implements Observer {
+	private static final long         serialVersionUID = 3078196473228467834L;
+
+	private ClippingDialog            clippingDialog       = null;
+
+	private JTabbedPane               jTabbedPane1         = null;
+
+	private ClippingCoordinatesPanel  coordinatesPanel     = null;
+	private ClippingResolutionPanel   resolutionPanel      = null;
+	private ClippingSelectionPanel    selectionPanel       = null;
+	private ClippingOptionsPanel      optionsPanel         = null;
+
+	private ClippingPanelListener     clippingPanelListener = null;
+
+	/**
+	 * Crea un nuevo <code>ClippingPanel</code>
+	 * @param clippingDialog
+	 */
+	public ClippingPanel(ClippingDialog clippingDialog) {
+		super(ButtonsPanel.BUTTONS_ACCEPTCANCELAPPLY);
+		getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT).setEnabled(false);
+		getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY).setEnabled(false);
+
+		this.clippingDialog = clippingDialog;
+
+		initialize();
+	}
+	
+	/**
+	 * Asigna el gestor de eventos y a�ade los listener a los controles
+	 * que lo necesiten 
+	 * @param list
+	 */
+	public void setClippingListener(ClippingPanelListener list) {
+		this.clippingPanelListener = list;
+		addListeners(clippingPanelListener);
+		getCoordinatesPanel().setClippingListener(clippingPanelListener);
+	}
+	
+	/**
+	 * Gets the listener
+	 * @return
+	 */
+	public ClippingPanelListener getListener() {
+		return clippingPanelListener;
+	}
+	
+	/**
+	 * A�ade listeners a los controles que lo necesitan
+	 * @param list
+	 */
+	private void addListeners(ClippingPanelListener list) {
+		getResolutionPanel().getCCellSize().addValueChangedListener(list);
+		getResolutionPanel().getCWidth().addValueChangedListener(list);
+		getResolutionPanel().getCHeight().addValueChangedListener(list);
+		getResolutionPanel().getButtonRestore().addActionListener(list);
+		addButtonPressedListener(list);
+	}
+		
+	/**
+	 * Obtener el <code>ClippingDialog</code> asociado a este objeto.
+	 * @return ClippingDialog
+	 */
+	public ClippingDialog getClippingDialog() {
+		return clippingDialog;
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		jTabbedPane1 = new JTabbedPane();
+		
+		jTabbedPane1.addTab(Messages.getText("coordenadas_recorte"), getCoordinatesPanel());
+		jTabbedPane1.addTab(Messages.getText("resolucion_espacial"), getResolutionPanel());
+		jTabbedPane1.addTab(Messages.getText("seleccion_bandas"), getSelectionPanel());
+		jTabbedPane1.addTab(Messages.getText("otras_opciones"), getOptionsPanel());
+
+		setLayout(new BorderLayout());
+		add(jTabbedPane1, BorderLayout.CENTER);
+	}
+	
+	public void removeTab(JPanel panel) {
+		jTabbedPane1.remove(panel);			
+	}
+
+	public ClippingCoordinatesPanel getCoordinatesPanel() {
+		if (coordinatesPanel == null) {
+			coordinatesPanel = new ClippingCoordinatesPanel();
+		}
+		return coordinatesPanel;
+	}
+	
+	/**
+	 * This method initializes jPanel
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	public ClippingResolutionPanel getResolutionPanel() {
+		if (resolutionPanel == null) {
+			resolutionPanel = new ClippingResolutionPanel();
+			resolutionPanel.validate();
+		}
+		return resolutionPanel;
+	}
+
+	/**
+	 * This method initializes jPanel1
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	public ClippingSelectionPanel getSelectionPanel() {
+		if (selectionPanel == null) {
+			selectionPanel = new ClippingSelectionPanel();
+		}
+		return selectionPanel;
+	}
+
+	/**
+	 * This method initializes jOptions
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	public ClippingOptionsPanel getOptionsPanel() {
+		if (optionsPanel == null) {
+			optionsPanel = new ClippingOptionsPanel();
+		}
+		return optionsPanel;
+	}
+
+	double textWidth, textHeight;
+	
+	/**
+	 * Almacena el estado actual del ancho y alto para poder restaurarlo
+	 * si lo necesitamos.
+	 */
+	public void saveStatus(ClippingData data) {
+		textWidth = data.getPxWidth();
+		textHeight = data.getPxHeight();
+	}
+
+	/**
+	 * Restaura el estado almacenado por saveStatus
+	 */
+	public void restoreStatus(ClippingData data) {
+		data.setPxWidth(textWidth);
+		data.setPxHeight(textHeight);
+		data.updateObservers();
+	}
+
+	/**
+	 * Actualiza los valores de los paneles cuando los datos de ClippingData varian
+	 * @param o 
+	 * @param arg
+	 */
+	public void update(Observable o, Object arg) {
+		if(!(o instanceof ClippingData))
+			return;
+		ClippingData data = (ClippingData)o;
+		
+		clippingPanelListener.setEnableValueChangedEvent(false);
+		getResolutionPanel().setWidthText(Math.round(data.getPxWidth()), 0);
+		getResolutionPanel().setHeightText(Math.round(data.getPxHeight()), 0);
+		RasterUtils util = RasterLocator.getManager().getRasterUtils();
+		getCoordinatesPanel().setCoordReal(util.getCoord(data.getUlxWc(), data.getUlyWc(), data.getLrxWc(), data.getLryWc(), ClippingData.DEC));
+		getCoordinatesPanel().setCoordPixel(util.getCoord(data.getUlxPx(), data.getUlyPx(), data.getLrxPx(), data.getLryPx(), ClippingData.DEC));
+		getResolutionPanel().setCellSizeText(data.getCellSize(), ClippingData.DEC);
+		clippingPanelListener.setEnableValueChangedEvent(true);
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/ClippingPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/listener/ClippingMouseViewListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/listener/ClippingMouseViewListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/listener/ClippingMouseViewListener.java	(revision 8183)
@@ -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.tools.app.basic.tool.clip.ui.listener;
+
+import java.awt.Image;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.Events.EnvelopeEvent;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.tool.SaveRasterListenerImpl;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.tool.clip.ClippingData;
+import org.gvsig.raster.tools.app.basic.tool.clip.ui.ClippingPanel;
+/**
+ * <code>ClippingMouseViewListener</code> es un listener del recorte de raster.
+ * Al seleccionar un �rea sobre la vista debe cargar el cuadro con los datos de
+ * coordenadas pixel, coordenadas reales, ancho y alto del raster resultante,
+ * tama�o de celda.
+ *
+ * @version 19/04/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class ClippingMouseViewListener extends SaveRasterListenerImpl {
+	private final Image     isaveraster    = IconThemeHelper.getImageIcon("rectangle-select-cursor").getImage();
+	private FLyrRaster      layer          = null;
+	private ClippingPanel   clippingPanel  = null;
+	private ClippingData    data           = null;
+	private MapControl      mapControl     = null;
+	private String          currentTool    = null;
+
+	/**
+	 * Crea un nuevo <code>ClippingMouseViewListener</code>
+	 *
+	 * @param mapCtrl
+	 * @param cutRasterDialog
+	 */
+	public ClippingMouseViewListener(MapControl mapControl, ClippingPanel clippingPanel, ClippingData data, FLyrRaster lyr) {
+		super(mapControl);
+		this.clippingPanel = clippingPanel;
+		this.data = data;
+		this.layer = lyr;
+		this.mapControl = mapControl;
+		this.currentTool = mapControl.getCurrentTool();
+	}
+
+	/**
+	 * Asigna la capa raster.
+	 * @param flyr Capa raster
+	 */
+	public void setRasterLayer(FLyrRaster flyr) {
+		layer = flyr;
+	}
+
+	/**
+	 * Realiza las acciones de selecci�n del �rea de recorte por medio de un rectangulo
+	 * sobre la vista.
+	 */
+	public void rectangle(EnvelopeEvent event) {
+		super.rectangle(event);
+
+		if(((FLyrRaster) layer).getAffineTransform() == null)
+			return;
+		
+		AffineTransform at = ((FLyrRaster) layer).getAffineTransform();
+		//Temporalmente cargamos las coordenadas reales para luego transformarlas a pixel
+		Point2D ulWc = new Point2D.Double(rect.getMinimum(0), rect.getMaximum(1));
+		Point2D lrWc = new Point2D.Double(rect.getMaximum(0), rect.getMinimum(1));
+		Point2D urWc = new Point2D.Double(rect.getMaximum(0), rect.getMaximum(1));
+		Point2D llWc = new Point2D.Double(rect.getMinimum(0), rect.getMinimum(1));
+		Point2D ulPx = new Point2D.Double();
+		Point2D lrPx = new Point2D.Double();
+		Point2D urPx = new Point2D.Double();
+		Point2D llPx = new Point2D.Double();
+		try {
+			at.inverseTransform(ulWc, ulPx);
+			at.inverseTransform(lrWc, lrPx);
+			at.inverseTransform(urWc, urPx);
+			at.inverseTransform(llWc, llPx);
+		} catch (NoninvertibleTransformException e) {
+			RasterSwingLibrary.messageBoxError(Messages.getText("coordenadas_erroneas"), null);
+			return;
+		}
+		
+		Point2D[] pointList = new Point2D[]{ulPx, lrPx, urPx, llPx};
+		Point2D dim = new Point2D.Double(layer.getDataStore().getWidth(), layer.getDataStore().getHeight());
+
+		//Comprobamos si la selecci�n est� completamente fuera del �rea
+		if(isOutside(ulPx, lrPx)) {
+			data.setOutOfArea();
+			return;
+		}
+
+		//Ajustamos los puntos al �rea en pixeles del raster
+		RasterLocator.getManager().getRasterUtils().adjustToPixelSize(pointList, dim);
+
+		//Convertimos nuevamente a coordenadas reales despu�s de ajustar
+		at.transform(ulPx, ulWc);
+		at.transform(lrPx, lrWc);
+		at.transform(llPx, llWc);
+		at.transform(urPx, urWc);
+
+		data.setCoorPixel(ulPx, lrPx, llPx, urPx); 
+		data.setCoorReal(ulWc, lrWc, llWc, urWc);
+		data.setAffineTransform(at);
+		data.initSize();
+		if(((FLyrRaster) layer).isRemote()) {
+			RasterSwingLibrary.messageBoxInfo(Messages.getText("remember_select_size"), clippingPanel);
+		}
+				
+		clippingPanel.saveStatus(data);
+
+		if(clippingPanel.getListener().activeButtons(ulPx, lrPx, ulWc, lrWc)) {
+			clippingPanel.getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY).setEnabled(true);
+			clippingPanel.getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT).setEnabled(true);
+		} else {
+			clippingPanel.getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY).setEnabled(false);
+			clippingPanel.getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT).setEnabled(false);
+		}
+		
+		if (currentTool != null)
+			mapControl.setTool(currentTool);
+	}
+
+	/**
+	 * Comprueba si la selecci�n del punto est� fuera del �rea del raster.
+	 * @param ulPx Coordenada superior izquierda en pixeles
+	 * @param lrPx Corrdenada inferior derecha en pixeles
+	 * @return true si la selecci�n del punto est� fuera del raster y false si no lo est�
+	 */
+	private boolean isOutside(Point2D ulPx, Point2D lrPx) {
+		double minX = Math.min(ulPx.getX(), lrPx.getX());
+		double minY = Math.min(ulPx.getY(), lrPx.getY());
+		double maxX = Math.max(ulPx.getX(), lrPx.getX());
+		double maxY = Math.max(ulPx.getY(), lrPx.getY());
+		if(minX >= layer.getDataStore().getWidth() || minY >= layer.getDataStore().getHeight() || maxX < 0 || maxY < 0)
+			return true;
+		return false;
+	}
+	
+	public Image getImageCursor() {
+		return isaveraster;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/listener/ClippingMouseViewListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/listener/ClippingPanelListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/listener/ClippingPanelListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/listener/ClippingPanelListener.java	(revision 8183)
@@ -0,0 +1,1037 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.clip.ui.listener;
+
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.Dimension;
+import java.awt.Image;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+import java.io.File;
+import java.util.EventObject;
+import java.util.List;
+
+import javax.swing.JOptionPane;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.Utilities;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.app.project.documents.view.toolListeners.StatusBarListener;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.exception.ROIException;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.BehaviorException;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseMovementBehavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.RectangleBehavior;
+import org.gvsig.fmap.mapcontrol.tools.Events.EnvelopeEvent;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.RectangleListener;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
+import org.gvsig.gui.beans.coordinatespanel.CoordinatesEvent;
+import org.gvsig.gui.beans.coordinatespanel.CoordinatesListener;
+import org.gvsig.gui.beans.coordinatespanel.CoordinatesPanel;
+import org.gvsig.gui.beans.datainput.DataInputContainerListener;
+import org.gvsig.gui.beans.table.models.CheckBoxModel;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.algorithm.process.DataProcess;
+import org.gvsig.raster.algorithm.process.IProcessActions;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.roi.ROI;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.swing.RasterSwingLocator;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.raster.process.ClippingProcess;
+import org.gvsig.raster.tools.app.basic.tool.clip.ClippingData;
+import org.gvsig.raster.tools.app.basic.tool.clip.ui.ClippingPanel;
+import org.gvsig.raster.tools.app.basic.tool.clip.ui.panel.ClippingCoordinatesPanel;
+import org.gvsig.raster.tools.app.basic.tool.clip.ui.panel.ClippingOptionsPanel;
+import org.gvsig.raster.tools.app.basic.tool.clip.ui.panel.ClippingResolutionPanel;
+import org.gvsig.raster.tools.app.basic.tool.clip.ui.panel.ClippingSelectionPanel;
+import org.gvsig.tools.swing.api.ToolsSwingLocator;
+import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * <code>ClippingPanelListener</code> es una clase donde se recoger�n y
+ * tratar�n todos los eventos del panel de recorte
+ *
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public class ClippingPanelListener implements ActionListener, RectangleListener, ButtonsPanelListener, CoordinatesListener, DataInputContainerListener, IProcessActions {
+    
+    private static final Logger LOG = LoggerFactory.getLogger(ClippingPanelListener.class);
+    
+	private Dimension             dim                     = new Dimension();
+	private AffineTransform       at                      = null;
+	private ClippingPanel         clippingPanel           = null;
+	private ClippingData          data                    = null;
+	private boolean               enableValueChangedEvent = true;
+	private FLyrRaster            fLayer                  = null;
+	private MapControl            mapControl              = null;
+	/**
+	 * Herramienta seleccionada en el momento de la apertura del dialogo
+	 */
+	private String                 lastTool                = null;
+	private String                 viewName                = null;
+	private static ClippingData    lastDataSaved           = null;
+
+	/**
+	 * Crea un nuevo <code>ClippingPanelListener</code> con el
+	 * <code>ClippingPanelListener</code> asociado
+	 * @param panel
+	 */
+	public ClippingPanelListener(ClippingPanel clippingPanel) {
+		this.clippingPanel = clippingPanel;
+	}
+
+	/**
+	 * Asigna el modelo de datos
+	 * @param data
+	 */
+	public void setData(ClippingData data) {
+		this.data = data;
+		if(fLayer != null) {
+			data.setPxWidth((int)fLayer.getDataStore().getWidth());
+			data.setPxHeight((int)fLayer.getDataStore().getHeight());
+		}
+	}
+
+	/**
+	 * Asigna la matriz de transformaci�n entre puntos en coordenadas del raster y
+	 * puntos en coordenadas reales.
+	 * @param AffineTransform
+	 */
+	private void setAffineTransform(AffineTransform at) {
+		this.at = at;
+	}
+
+	/**
+	 * Asigna la dimensi�n del raster
+	 * @param dim
+	 */
+	public void setDimension(Dimension dim) {
+		this.dim = dim;
+	}
+
+	/**
+	 * M�todo que se invoca cuando se disparan los eventos de los botones de
+	 * extensi�n completa o de seleccion de extensi�n con el rat�n
+	 */
+	public void actionPerformed(ActionEvent e) {
+		// Bot�n de selecci�n del extent completo
+		// Modificamos las coordenadas reales y recalculamos las coordenadas pixel
+		if (e.getSource() == getResolutionPanel().getButtonRestore()) {
+			getClippingPanel().restoreStatus(data);
+		}
+
+		//Load parameters
+		if (e.getSource() == getCoordinatesPanel().getButtonBarContainer().getButton(0)) {
+			if(lastDataSaved != null) {
+				data = (ClippingData)lastDataSaved.clone();
+				data.addObserver(getClippingPanel());
+				data.updateObservers();
+				getClippingPanel().getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY).setEnabled(true);
+				getClippingPanel().getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT).setEnabled(true);
+			} else
+				RasterSwingLibrary.messageBoxError(Messages.getText("no_data_saved"), null);
+		}
+
+		//Save parameters
+		if (e.getSource() == getCoordinatesPanel().getButtonBarContainer().getButton(1)) {
+			lastDataSaved = (ClippingData)data.clone();
+		}
+		
+		//Redondear las coordenadas p�xel
+		if (e.getSource() == getCoordinatesPanel().getButtonBarContainer().getButton(2)) {
+			roundPixels();
+			return;
+		}
+
+		//Bot�n de selecci�n del �rea m�xima asociada a los ROIs
+		if (e.getSource() == getCoordinatesPanel().getButtonBarContainer().getButton(3)) {
+			try {
+				List<ROI> roiList = getFLayer().getRois();
+				if(roiList != null && roiList.size() > 0) {
+					Extent ext = RasterLocator.getManager().getRasterUtils().getROIsMaximunExtent(roiList);
+					assignROISExtent(ext, getFLayer());
+				} else
+					assignFullExtent();
+			} catch (ROIException e1) {
+				RasterSwingLibrary.messageBoxError(Messages.getText("problems_loading_rois"), null);
+			}
+			
+			return;
+		}
+
+		// Bot�n de selecci�n del extent completo
+		// Modificamos las coordenadas reales y recalculamos las coordenadas pixel
+		if (e.getSource() == getCoordinatesPanel().getButtonBarContainer().getButton(4)) {
+			assignFullExtent();
+			return;
+		}
+
+		// Bot�n de selecci�n de la herramienta de seleccionar desde la vista
+		if (e.getSource() == getCoordinatesPanel().getButtonBarContainer().getButton(5)) {
+			selectToolButton();
+			return;
+		}
+
+	}
+	
+	/**
+	 * Round off the pixels value
+	 */
+	private void roundPixels() {
+		data.setUlxPx((int)(data.getUlxPx()));
+		data.setUlyPx((int)(data.getUlyPx()));
+		data.setLrxPx((int)(data.getLrxPx()));
+		data.setLryPx((int)(data.getLryPx()));
+		data.setUrxPx((int)(data.getUrxPx()));
+		data.setUryPx((int)(data.getUryPx()));
+		data.setLlxPx((int)(data.getLlxPx()));
+		data.setLlyPx((int)(data.getLlyPx()));
+		
+		Point2D ulWc = new Point2D.Double();
+		Point2D lrWc = new Point2D.Double();
+		Point2D llWc = new Point2D.Double();
+		Point2D urWc = new Point2D.Double();
+		
+		at.transform(new Point2D.Double(data.getUlxPx(), data.getUlyPx()), ulWc);
+		at.transform(new Point2D.Double(data.getLrxPx() + 1, data.getLryPx() + 1), lrWc);
+		at.transform(new Point2D.Double(data.getLlxPx(), data.getLlyPx() + 1), llWc);
+		at.transform(new Point2D.Double(data.getUrxPx() + 1, data.getUryPx()), urWc);
+
+		data.setCoorReal(ulWc, lrWc, llWc, urWc);
+		data.setAffineTransform(at);
+		data.initSize();
+		data.updateObservers();
+	}
+
+	/**
+	 * Asigna el extent completo a los cuadros de texto donde se introducen las coordenadas
+	 * reales y p�xel.
+	 */
+	private void assignROISExtent(Extent ext, FLyrRaster layer) {
+		AffineTransform at = layer.getAffineTransform();
+		Point2D ulWc = new Point2D.Double(ext.minX(), ext.maxY());
+		Point2D lrWc = new Point2D.Double(ext.maxX(), ext.minY());
+		Point2D llWc = new Point2D.Double(ext.minX(), ext.minY());
+		Point2D urWc = new Point2D.Double(ext.maxX(), ext.maxY());
+
+		ulWc = getFLayer().adjustWorldRequest(ulWc);
+		lrWc = getFLayer().adjustWorldRequest(lrWc);
+		llWc = getFLayer().adjustWorldRequest(llWc);
+		urWc = getFLayer().adjustWorldRequest(urWc);
+
+		Point2D ulPx = new Point2D.Double();
+		Point2D lrPx = new Point2D.Double();
+		Point2D llPx = new Point2D.Double();
+		Point2D urPx = new Point2D.Double();
+
+		try {
+			at.inverseTransform(ulWc, ulPx);
+			at.inverseTransform(lrWc, lrPx);
+			at.inverseTransform(ulWc, llPx);
+			at.inverseTransform(lrWc, urPx);
+		} catch (NoninvertibleTransformException e) {
+			JOptionPane.showMessageDialog((Component) PluginServices.getMainFrame(), Messages.getText("coordenadas_erroneas"));
+			return;
+		}
+
+		data.setCoorPixel(ulPx, lrPx, llPx, urPx);
+		data.setCoorReal(ulWc, lrWc, llWc, urWc);
+		data.setAffineTransform(at);
+		data.initSize();
+		getClippingPanel().saveStatus(data);
+
+		getClippingPanel().getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY).setEnabled(true);
+		getClippingPanel().getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT).setEnabled(true);
+	}
+
+	/**
+	 * Asigna el extent completo a los cuadros de texto donde se introducen las coordenadas
+	 * reales y p�xel.
+	 */
+	private void assignFullExtent() {
+		Point2D ulPx = new Point2D.Double(0, 0);
+		Point2D lrPx = new Point2D.Double(dim.width, dim.height);
+		Point2D urPx = new Point2D.Double(dim.width, 0);
+		Point2D llPx = new Point2D.Double(0, dim.height);
+
+		//Convertimos nuevamente a coordenadas reales
+		Point2D ulWc = new Point2D.Double();
+		Point2D lrWc = new Point2D.Double();
+		Point2D urWc = new Point2D.Double();
+		Point2D llWc = new Point2D.Double();
+		at.transform(ulPx, ulWc);
+		at.transform(lrPx, lrWc);
+		at.transform(urPx, urWc);
+		at.transform(llPx, llWc);
+
+		ulPx = new Point2D.Double(0, 0);
+		lrPx = new Point2D.Double(dim.width - 1, dim.height - 1);
+		urPx = new Point2D.Double(dim.width - 1, 0);
+		llPx = new Point2D.Double(0, dim.height - 1);
+
+		data.setCoorPixel(ulPx, lrPx, llPx, urPx);
+		data.setCoorReal(ulWc, lrWc, llWc, urWc);
+		data.setAffineTransform(at);
+		data.initSize();
+
+		getClippingPanel().saveStatus(data);
+		getClippingPanel().getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY).setEnabled(true);
+		getClippingPanel().getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT).setEnabled(true);
+	}
+
+	/**
+	 * Al producirse un evento de perdida de foco o pulsaci�n de "enter" en un campo de texto de coordenadas
+	 * hay que asignar el nuevo valor introducido.
+	 * @param obj
+	 */
+	private void eventJTextField(CoordinatesEvent e) {
+		try {
+			if (e.getSource() == getCoordinatesPanel().getPixelCoordinates()) {
+				if (e.getName().equals("11")) {
+					data.setUlxPx(Double.valueOf(getCoordinatesPanel().getPixelCoordinates().getValue11()).doubleValue());
+					data.setLlxPx(Double.valueOf(getCoordinatesPanel().getPixelCoordinates().getValue11()).doubleValue());
+				}
+				if (e.getName().equals("12")) {
+					data.setUlyPx(Double.valueOf(getCoordinatesPanel().getPixelCoordinates().getValue12()).doubleValue());
+					data.setUryPx(Double.valueOf(getCoordinatesPanel().getPixelCoordinates().getValue12()).doubleValue());
+				}
+				if (e.getName().equals("21")) {
+					data.setLrxPx(Double.valueOf(getCoordinatesPanel().getPixelCoordinates().getValue21()).doubleValue());
+					data.setUrxPx(Double.valueOf(getCoordinatesPanel().getPixelCoordinates().getValue21()).doubleValue());
+				}
+				if (e.getName().equals("22")) {
+					data.setLryPx(Double.valueOf(getCoordinatesPanel().getPixelCoordinates().getValue22()).doubleValue());
+					data.setLlyPx(Double.valueOf(getCoordinatesPanel().getPixelCoordinates().getValue22()).doubleValue());
+				}
+				data.updateObservers();
+			}
+
+			if (e.getSource() == getCoordinatesPanel().getRealCoordinates()) {
+				if (e.getName().equals("11")) {
+					data.setUlxWc(Double.valueOf(getCoordinatesPanel().getRealCoordinates().getValue11()).doubleValue());
+					data.setLlxWc(Double.valueOf(getCoordinatesPanel().getRealCoordinates().getValue11()).doubleValue());
+				}
+				if (e.getName().equals("12")) {
+					data.setUlyWc(Double.valueOf(getCoordinatesPanel().getRealCoordinates().getValue12()).doubleValue());
+					data.setUryWc(Double.valueOf(getCoordinatesPanel().getRealCoordinates().getValue12()).doubleValue());
+				}
+				if (e.getName().equals("21")) {
+					data.setLrxWc(Double.valueOf(getCoordinatesPanel().getRealCoordinates().getValue21()).doubleValue());
+					data.setUrxWc(Double.valueOf(getCoordinatesPanel().getRealCoordinates().getValue21()).doubleValue());
+				}
+				if (e.getName().equals("22")) {
+					data.setLryWc(Double.valueOf(getCoordinatesPanel().getRealCoordinates().getValue22()).doubleValue());
+					data.setLlyWc(Double.valueOf(getCoordinatesPanel().getRealCoordinates().getValue22()).doubleValue());
+				}
+				data.updateObservers();
+			}
+		} catch (NumberFormatException ex1) {
+			// No hay valores parseables a decimal en las cajas de texto. No hacemos nada
+		}
+	}
+
+	
+	/**
+	 * Recalcula el valor de los campos de coordenadas reales y pixel. Cuando modificamos alg�n campo
+	 * de las coordenadas reales se modifican los pixeles y viceversa.
+	 * @param modifyPx true si se ha modificado alg�n campo de coordenadas pixel y false si se ha modificado
+	 * alg�n campo de las coordenadas reales.
+	 */
+	private void recalcCoordFields(boolean modifyPx) {
+		try {
+			Point2D ulPx = new Point2D.Double(data.getUlxPx(), data.getUlyPx());
+			Point2D lrPx = new Point2D.Double(data.getLrxPx(), data.getLryPx());
+			Point2D llPx = new Point2D.Double(data.getLlxPx(), data.getLlyPx());
+			Point2D urPx = new Point2D.Double(data.getUrxPx(), data.getUryPx());
+			
+			Point2D ulWc = new Point2D.Double(data.getUlxWc(), data.getUlyWc());
+			Point2D lrWc = new Point2D.Double(data.getLrxWc(), data.getLryWc());
+			Point2D llWc = new Point2D.Double(data.getLlxWc(), data.getLlyWc());
+			Point2D urWc = new Point2D.Double(data.getUrxWc(), data.getUryWc());
+			
+			if (modifyPx) {
+				at.transform(new Point2D.Double(ulPx.getX(), ulPx.getY()), ulWc);
+				at.transform(new Point2D.Double(lrPx.getX() + 1, lrPx.getY() + 1), lrWc);
+				at.transform(new Point2D.Double(llPx.getX(), llPx.getY() + 1), llWc);
+				at.transform(new Point2D.Double(urPx.getX() + 1, urPx.getY()), urWc);
+
+				data.setCoorReal(ulWc, lrWc, llWc, urWc);
+				data.setAffineTransform(at);
+				data.initSize();
+
+				getClippingPanel().saveStatus(data);
+			} else {
+				try {
+					at.inverseTransform(ulWc, ulPx);
+					at.inverseTransform(lrWc, lrPx);
+					at.inverseTransform(llWc, llPx);
+					at.inverseTransform(urWc, urPx);
+				} catch (NoninvertibleTransformException e) {
+					JOptionPane.showMessageDialog((Component) PluginServices.getMainFrame(), PluginServices.getText(this, "coordenadas_erroneas"));
+					return;
+				}
+
+				//adjustPoints(ulPx, lrPx);
+				//adjustPoints(llPx, urPx);
+				lrPx = new Point2D.Double(lrPx.getX() - 1, lrPx.getY() - 1);
+				llPx = new Point2D.Double(llPx.getX(), llPx.getY() - 1);
+				urPx = new Point2D.Double(urPx.getX() - 1, urPx.getY());
+				data.setCoorPixel(ulPx, lrPx, llPx, urPx);
+				data.setAffineTransform(at);
+				data.initSize();
+				getClippingPanel().saveStatus(data);
+			}
+			
+			//Condiciones para activar botones. 
+			if(activeButtons(ulPx, lrPx, ulWc, lrWc)) {
+				getClippingPanel().getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY).setEnabled(true);
+				getClippingPanel().getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT).setEnabled(true);
+			} else {
+				getClippingPanel().getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY).setEnabled(false);
+				getClippingPanel().getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT).setEnabled(false);
+			}
+			
+		} catch (NumberFormatException ex) {
+			return;
+		}
+
+	}
+	
+	public boolean activeButtons(Point2D ulPx, Point2D lrPx, Point2D ulWc, Point2D lrWc) {
+		if(ulPx.getX() < lrPx.getX() && ulPx.getY() < lrPx.getY() &&
+			ulWc.getX() < lrWc.getX() && ulWc.getY() > lrWc.getY() &&
+			(lrPx.getX() - ulPx.getX()) >= 2 && (lrPx.getY() - ulPx.getY()) >= 2 &&
+			ulPx.getX() >= 0 && ulPx.getY() >= 0 && 
+			((int)lrPx.getX()) <= (fLayer.getDataStore().getWidth() - 1) &&
+			((int)lrPx.getY()) <= (fLayer.getDataStore().getHeight() - 1)) {
+			return true;
+		}
+		return false;
+	}
+	
+	/**
+	 * Turns world coordinates into entire numbers to avoid rounds errors 
+	 * @param ul
+	 *        Upper left coordinate
+	 * @param lr
+	 *        Lower right coordinate
+	 */
+	@SuppressWarnings("unused")
+	private void adjustPoints(Point2D ul, Point2D lr) {
+		double a = (ul.getX() - (int)ul.getX());
+		double b = (ul.getY() - (int)ul.getY());
+		double c = (lr.getX() - (int)lr.getX());
+		double d = (lr.getY() - (int)lr.getY());
+		ul.setLocation(	(a > 0.95 || a < 0.05) ? Math.round(ul.getX()) : ul.getX(), 
+						(b > 0.95 || b < 0.05) ? Math.round(ul.getY()) : ul.getY());
+		lr.setLocation(	(c > 0.95 || c < 0.05) ? Math.round(lr.getX()) : lr.getX(), 
+						(d > 0.95 || d < 0.05) ? Math.round(lr.getY()) : lr.getY());
+	}
+
+	/**
+	 * Ajusta las coordenadas especificadas en los par�metros al �rea m�xima
+	 * del raster en p�xeles
+	 * @param req
+	 */
+	@SuppressWarnings("unused")
+	private Point2D adjustPixelRequest(Point2D req) {
+		req.setLocation(Math.max(0, req.getX()), Math.max(0, req.getY()));
+		req.setLocation(Math.min(dim.width - 1, req.getX()), Math.min(dim.height - 1, req.getY()));
+		return req;
+	}
+
+	/**
+	 * Invocaci�n de los eventos de la ventana de <code>DefaultButtonsPanel</code>
+	 */
+	public void actionButtonPressed(ButtonsPanelEvent e) {
+		// Bot�n de Aceptar
+		if (e.getButton() == ButtonsPanel.BUTTON_ACCEPT) {
+			accept();
+			close();
+		}
+
+		// Bot�n de Aplicar
+		if (e.getButton() == ButtonsPanel.BUTTON_APPLY)
+			accept();
+
+		// Bot�n de Cerrar
+		if (e.getButton() == ButtonsPanel.BUTTON_CANCEL)
+			close();
+
+		getFLayer().getMapContext().invalidate();
+	}
+
+	/**
+	 * Cerrar la ventana del recorte
+	 */
+	private void close() {
+		try {
+			if (getLastTool() != null)
+				getMapControl().setTool(getLastTool());
+			PluginServices.getMDIManager().closeWindow(getClippingPanel().getClippingDialog());
+		} catch (ArrayIndexOutOfBoundsException ex) {
+			// Si la ventana no se puede eliminar no hacemos nada
+		}
+	}
+
+	/**
+	 * Obtener el <code>ClippingPanel</code> asociado
+	 * @return ClippingPanel
+	 */
+	private ClippingPanel getClippingPanel() {
+		return clippingPanel;
+	}
+
+	private ClippingCoordinatesPanel getCoordinatesPanel() {
+		return getClippingPanel().getCoordinatesPanel();
+	}
+
+	private ClippingResolutionPanel getResolutionPanel() {
+		return getClippingPanel().getResolutionPanel();
+	}
+
+	private ClippingOptionsPanel getOptionsPanel() {
+		return getClippingPanel().getOptionsPanel();
+	}
+
+	private ClippingSelectionPanel getSelectionPanel() {
+		return getClippingPanel().getSelectionPanel();
+	}
+
+	/**
+	 * Acciones realizadas cuando se acepta en el dialogo. Se obtendr�n los datos
+	 * de recorte desde el dialogo, crearemos el objeto ClippingProcess que
+	 * gestiona el recortado, ajustamos el tama�o del grid de salida y procesamos.
+	 */
+	private void accept() {
+		if(data.getPxHeight() == 0 || data.getPxWidth() == 0) {
+			RasterSwingLibrary.messageBoxError(RasterToolsUtil.getText(this, "wrong_resolution"), null);
+			return;
+		}
+		
+		// Controlamos las coordenadas del recorte que no se salgan de la imagen.
+		// De ser as� mostramos un error
+		CoordinatesPanel coordinatesReales = getCoordinatesPanel().getRealCoordinates();
+		double ulx = 0;
+		double lrx = 0;
+		double lry = 0;
+		double uly = 0;
+		try {
+			ulx = Double.parseDouble(coordinatesReales.getValue11());
+			lry = Double.parseDouble(coordinatesReales.getValue22());
+			lrx = Double.parseDouble(coordinatesReales.getValue21());
+			uly = Double.parseDouble(coordinatesReales.getValue12());
+			Envelope ext = getFLayer().getFullEnvelope();
+			if (((int) ulx) > ((int) ext.getMaximum(0)) || ((int) lrx) < ((int) ext.getMinimum(0)) || ((int) uly) > ((int) ext.getMaximum(1)) || ((int) lry) < ((int) ext.getMinimum(1))) {
+				RasterSwingLibrary.messageBoxError(Messages.getText("coordenadas_erroneas"), null);
+				return;
+			}
+		} catch (NumberFormatException e) {
+			RasterSwingLibrary.messageBoxError(Messages.getText("coordenadas_erroneas"), null);
+			return;
+		}
+
+		// Seleccionamos las bandas que se usaran en el recorte a partir de la tabla
+		int countBands = 0;
+		int rowCount = ((CheckBoxModel) getSelectionPanel().getTableContainer().getModel()).getRowCount();
+		for (int iRow = 0; iRow < rowCount; iRow++)
+			if ((((Boolean) ((CheckBoxModel) getSelectionPanel().getTableContainer().getModel()).getValueAt(iRow, 0))).booleanValue())
+				countBands++;
+
+		int[] drawableBands = new int[countBands];
+		int i = 0;
+		for (int iRow = 0; iRow < rowCount; iRow++) {
+			if ((((Boolean) ((CheckBoxModel) getSelectionPanel().getTableContainer().getModel()).getValueAt(iRow, 0))).booleanValue()) {
+				int row = ((Integer) ((CheckBoxModel) getSelectionPanel().getTableContainer().getModel()).getValueAt(iRow, 2)).intValue();
+				drawableBands[i++] = row;
+			}
+		}
+
+		/**
+		 * Donde se va a guardar el fichero
+		 */
+		String path;
+		if (getOptionsPanel().getCbSaveFile().isSelected()) {
+			path = getOptionsPanel().getDirectoryTextField().getText();
+			File f = new File(path);
+			if(!f.exists() || !f.canWrite()) {
+				RasterSwingLibrary.messageBoxError(Messages.getText("path_not_valid"), null);
+				return;
+			}
+		} else
+			path = Utilities.createTempDirectory();
+
+		String file = getOptionsPanel().getFilenameTextField().getText();
+		if (file.compareTo(RasterLocator.getManager().getFileUtils().getOnlyLayerName()) == 0)
+			RasterLocator.getManager().getFileUtils().usesOnlyLayerName();
+
+		if (file == "")
+			file = "cutlayer";
+
+		String filename = path + File.separator + file;
+
+		if (new File(filename + ".tif").exists())
+			if (!RasterSwingLibrary.messageBoxYesOrNot("raster_error_file_exists", getOptionsPanel()))
+				return;
+
+		/**
+		 * Preparacion para la generacion del proceso del recorte
+		 */
+		if (getFLayer() == null){
+		    return;
+		}
+		
+		double[] pxValues = data.getPxCoordinatesToClip();
+        boolean pxRound = arePixelsRound(pxValues);
+        double[] wcValues = data.getWcCoordinatesToClip();
+        
+        if (getFLayer().getCoordTrans() != null) {
+
+            GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+            Envelope envelope = null;
+            Envelope storeEnvelope = null;
+            Envelope projectedEnvelope = null;
+            Extent extent = getFLayer().getDataStore().getExtent();
+
+            try {
+                // Create envelope with coordinates of clip area
+                envelope =
+                    geometryManager.createEnvelope(wcValues[0], wcValues[3], wcValues[2],
+                        wcValues[1], SUBTYPES.GEOM2D);
+
+            } catch (CreateEnvelopeException e) {
+                String errorMessage =
+                    String.format("Can not create envelope with [%1d,%1d,%1d,%1d,%1s] parameters",
+                        wcValues[0], wcValues[3], wcValues[2], wcValues[1], SUBTYPES.GEOM2D);
+                LOG.error(errorMessage, e);
+
+                ThreadSafeDialogsManager tsdm = ToolsSwingLocator.getThreadSafeDialogsManager();
+                tsdm.messageDialog("error_cutting", "_error",
+                    JOptionPane.ERROR_MESSAGE);
+                return;
+            }
+            
+            // Get envelope of raster store
+            try {
+                storeEnvelope =
+                    geometryManager.createEnvelope(extent.getMin().getX(), extent.getMin().getY(),
+                        extent.getMax().getX(), extent.getMax().getY(), SUBTYPES.GEOM2D);
+            } catch (CreateEnvelopeException e) {
+                String errorMessage =
+                    String.format("Can not create envelope with [%1d,%1d,%1d,%1d,%1s] parameters",
+                        extent.getMin().getX(), extent.getMin().getY(), extent.getMax().getX(),
+                        extent.getMax().getY(), SUBTYPES.GEOM2D);
+                LOG.error(errorMessage, e);
+
+                ThreadSafeDialogsManager tsdm = ToolsSwingLocator.getThreadSafeDialogsManager();
+                tsdm.messageDialog("error_cutting", "_error",
+                    JOptionPane.ERROR_MESSAGE);
+                return;
+            }
+            
+            // Reproject to store projection using layer coordinate transform 
+            projectedEnvelope = envelope.convert(getFLayer().getCoordTrans().getInverted());
+            try {
+                // Get instersection to fix projected envelope
+                Geometry intersection =
+                    projectedEnvelope.getGeometry().intersection(storeEnvelope.getGeometry());
+                projectedEnvelope = geometryManager.createEnvelope(SUBTYPES.GEOM2D);
+                projectedEnvelope.add(intersection);
+            } catch (GeometryOperationNotSupportedException | GeometryOperationException e) {
+                String errorMessage =
+                    String.format(
+                        "Can not intersects [%1s] projected envelope with [%1s] store envelope",
+                        projectedEnvelope, storeEnvelope);
+                LOG.error(errorMessage, e);
+
+                ThreadSafeDialogsManager tsdm = ToolsSwingLocator.getThreadSafeDialogsManager();
+                tsdm.messageDialog("error_cutting", "_error",
+                    JOptionPane.ERROR_MESSAGE);
+                return;
+            } catch (CreateEnvelopeException e) {
+                String errorMessage =
+                    String.format("Can not create envelope with [%1s] parameters", SUBTYPES.GEOM2D);
+                LOG.error(errorMessage, e);
+
+                ThreadSafeDialogsManager tsdm = ToolsSwingLocator.getThreadSafeDialogsManager();
+                tsdm.messageDialog("error_cutting", "_error",
+                    JOptionPane.ERROR_MESSAGE);
+                return;
+            }
+
+            wcValues[0] = projectedEnvelope.getLowerCorner().getX();
+            wcValues[3] = projectedEnvelope.getLowerCorner().getY();
+            wcValues[2] = projectedEnvelope.getUpperCorner().getX();
+            wcValues[1] = projectedEnvelope.getUpperCorner().getY();
+        }
+
+		AffineTransform transf = null;
+		if(pxRound && 
+		   ((pxValues[2] - pxValues[0]) == data.getPxWidth()) && 
+		   ((pxValues[3] - pxValues[1]) == data.getPxHeight()))
+			transf = new AffineTransform(at.getScaleX(), at.getShearY(), at.getShearX(), at.getScaleY(), wcValues[0], wcValues[1]);
+		else
+			transf = calcAffineTransform(wcValues[0], wcValues[1], wcValues[2], wcValues[3],
+										Math.round(data.getPxWidth()), Math.round(data.getPxHeight()), at);
+		
+
+		int interpMethod = getResolutionPanel().getSelectedInterpolationMethod();
+
+		// Creamos la interpretaci�n de color para el caso de que la salida tenga
+		// m�s de una banda por fichero. Siempre creamos RED, GREEN y BLUE
+		String[] ci = new String[drawableBands.length];
+		for (int j = 0; j < ci.length; j++) {
+			switch (j) {
+				case 0:
+					if (ci.length >= 3)
+						ci[j] = ColorInterpretation.RED_BAND;
+					else
+						ci[j] = ColorInterpretation.GRAY_BAND;
+					break;
+				case 1:
+					if (ci.length >= 3)
+						ci[j] = ColorInterpretation.GREEN_BAND;
+					else
+						ci[j] = ColorInterpretation.UNDEF_BAND;
+					break;
+				case 2:
+					ci[j] = ColorInterpretation.BLUE_BAND;
+					break;
+				default:
+					ci[j] = ColorInterpretation.UNDEF_BAND;
+					break;
+			}
+		}
+
+		DataProcess clippingProcess = new ClippingProcess();
+		clippingProcess.setActions(this);
+		clippingProcess.addParam("viewname", getViewName());
+		if(pxRound)
+			clippingProcess.addParam("pixelcoordinates", pxValues);
+		else
+			clippingProcess.addParam("realcoordinates", wcValues);
+		clippingProcess.addParam("suffix", ".tif");
+		clippingProcess.addParam("filename", filename);
+		clippingProcess.addParam("layer", getFLayer().getDataStore());
+		clippingProcess.addParam("drawablebands", drawableBands);
+		clippingProcess.addParam("onelayerperband", new Boolean(getOptionsPanel().getCbOneLyrPerBand().isSelected()));
+		clippingProcess.addParam("interpolationmethod", new Integer(interpMethod));
+		clippingProcess.addParam("affinetransform", transf);
+		clippingProcess.addParam("colorInterpretation",  RasterLocator.getManager().getDataStructFactory().createColorInterpretation(ci));
+		clippingProcess.addParam("resolution", new int[]{(int) Math.round(data.getPxWidth()),
+														 (int) Math.round(data.getPxHeight())});
+		clippingProcess.addParam("viewProjection", mapControl.getProjection());
+		clippingProcess.start();
+	}
+
+	/**
+	 * Calcula la matriz de transformaci�n que se usar� para el nuevo raster generado.
+	 * @param ulx Coordenada X real de la esquina superior izquierda
+	 * @param uly Coordenada Y real de la esquina superior izquierda
+	 * @param lrx Coordenada X real de la esquina inferior derecha
+	 * @param lry Coordenada Y real de la esquina inferior derecha
+	 * @param width Ancho en p�xeles del nuevo raster
+	 * @param height Alto en p�xeles del nuevo raster
+	 * @param trans Matriz de transformaci�n de la nueva capa
+	 * @return Matriz de transformaci�n para el nuevo raster
+	 */
+	private AffineTransform calcAffineTransform(double ulx, double uly, double lrx, double lry,
+												double width, double height, AffineTransform trans) {
+		Point2D ul = new Point2D.Double(ulx, uly);
+		Point2D lr = new Point2D.Double(lrx, lry);
+		try {
+			trans.inverseTransform(ul, ul);
+			trans.inverseTransform(lr, lr);
+		} catch (NoninvertibleTransformException e) {
+			JOptionPane.showMessageDialog(null, RasterToolsUtil.getText(this, "coordenadas_erroneas"));
+			return new AffineTransform();
+		}
+		double w = Math.abs(lr.getX() - ul.getX());
+
+		Point2D ur = new Point2D.Double(ul.getX() + w, ul.getY());
+		Point2D ll = new Point2D.Double(lr.getX() - w, lr.getY() );
+
+		//Obtenemos la georreferenciaci�n de las cuatro esquinas del nuevo raster
+		trans.transform(ul, ul);
+		trans.transform(ur, ur);
+		trans.transform(lr, lr);
+		trans.transform(ll, ll);
+
+		double pixelSizeX = (lrx - ulx) / width;
+		double pixelSizeY = (lry - uly) / height;
+		double rotX = trans.getShearX();
+		double rotY = trans.getShearY();
+		return new AffineTransform(pixelSizeX, rotY, rotX, pixelSizeY, ulx, uly);
+	}
+	
+	/**
+	 * Returns true if the pixels are round
+	 * @param pxValues
+	 * @return
+	 */
+	private boolean arePixelsRound(double[] pxValues) {
+		if((((int)pxValues[0]) - pxValues[0]) == 0 &&
+		   (((int)pxValues[1]) - pxValues[1]) == 0 &&
+		   (((int)pxValues[2]) - pxValues[2]) == 0 &&
+		   (((int)pxValues[3]) - pxValues[3]) == 0) {
+			return true;
+		}
+		return false;
+	}
+
+	public boolean cancelDrawing() {
+		return false;
+	}
+
+	public Cursor getCursor() {
+		return null;
+	}
+
+	public void actionValueChanged(CoordinatesEvent e) {
+		if (e.getSource() == getCoordinatesPanel().getPixelCoordinates()) {
+			eventJTextField(e);
+			if (e.getName().equals("11") || 
+				e.getName().equals("12") || 
+				e.getName().equals("21") ||
+				e.getName().equals("22"))
+				recalcCoordFields(true);
+			
+		}
+		if (e.getSource() == getCoordinatesPanel().getRealCoordinates()) {
+			eventJTextField(e);
+			if (e.getName().equals("11") || 
+				e.getName().equals("12") || 
+				e.getName().equals("21") || 
+				e.getName().equals("22"))
+				recalcCoordFields(false);
+		}
+	}
+
+	public void actionValueChanged(EventObject e) {
+		if(!enableValueChangedEvent)
+			return;
+
+		enableValueChangedEvent = false; //Desactivamos el evento de cambio de valor de las cajas de texto para que no se bucle
+
+		if (e.getSource() == getResolutionPanel().getCCellSize().getDataInputField()) {
+			// Cambiamos PS ==> wPx=wWC/PS & hPx=wPx/rel
+			double ps = 0;
+			try {
+				ps = Double.parseDouble(getResolutionPanel().getCCellSize().getValue());
+			} catch (NumberFormatException ex) {
+				return;
+			}
+			data.setPxWidth(data.getWcWidth() / ps);
+			data.setPxHeight(data.getWcHeight() / ps);
+			data.updateObservers();
+		} else if (e.getSource() == getResolutionPanel().getCWidth().getDataInputField()) {
+			// Cambiamos wPx ==> hPx=wPx/rel & PS=wWC/wPx
+			double wPx = 0;
+			try {
+				wPx = Double.parseDouble(getResolutionPanel().getCWidth().getValue());
+			} catch (NumberFormatException ex) {
+				return;
+			}
+			data.setPxWidth(wPx);
+			data.setPxHeight(Math.round(wPx / data.getRatio()));
+			data.updateObservers();
+		} else if (e.getSource() == getResolutionPanel().getCHeight().getDataInputField()) {
+			// Cambiamos hPx ==> wPx=rel*wPx & PS=hWC/hPx
+			double hPx = 0;
+			try {
+				hPx = Double.parseDouble(getResolutionPanel().getCHeight().getValue());
+			} catch (NumberFormatException ex) {
+				return;
+			}
+			data.setPxHeight(hPx);
+			data.setPxWidth(Math.round(Math.round(hPx * data.getRatio())));
+			data.updateObservers();
+		}
+		enableValueChangedEvent = true;
+	}
+
+	/**
+	 * 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;
+	}
+
+	public void end(Object params) {
+		if(	params instanceof Object[] &&
+			((Object[])params).length == 2 &&
+			((Object[])params)[0] instanceof String &&
+			((Object[])params)[1] instanceof Long) {
+
+			String fName = (String)((Object[])params)[0];
+			long milis = ((Long)((Object[])params)[1]).longValue();
+
+			RasterSwingLocator.getSwingManager().showSummaryProcessDialog(fName, milis);
+		}
+	}
+
+	/**
+	 * Obtener la capa de un raster.
+	 * @return
+	 */
+	public FLyrRaster getFLayer() {
+		return fLayer;
+	}
+
+	/**
+	 * Obtiene la ultima herramienta seleccionada antes de cargar el recorte
+	 * @return
+	 */
+	public String getLastTool() {
+		return lastTool;
+	}
+
+	/**
+	 * Obtiene el nombre de la vista
+	 * @return
+	 */
+	public String getViewName() {
+		return viewName;
+	}
+
+	/**
+	 * Establecer la capa para usarla en el recorte
+	 * @param fLayer
+	 */
+	public void setLayer(FLyrRaster fLayer) {
+		this.fLayer = fLayer;
+		AbstractViewPanel view = (AbstractViewPanel) PluginServices.getMDIManager().getActiveWindow();
+		viewName = PluginServices.getMDIManager().getWindowInfo(view).getTitle();
+		mapControl = view.getMapControl();
+
+		lastTool = mapControl.getCurrentTool();
+
+		// Listener de eventos de movimiento que pone las coordenadas del rat�n en
+		// la barra de estado
+		StatusBarListener sbl = new StatusBarListener(mapControl);
+
+		// Cortar Raster
+		ClippingMouseViewListener clippingMouseViewListener = new ClippingMouseViewListener(mapControl, getClippingPanel(), data, fLayer);
+		mapControl.addBehavior("cutRaster", new Behavior[] {
+				new RectangleBehavior(clippingMouseViewListener), new MouseMovementBehavior(sbl)
+			}
+		);
+
+		getSelectionPanel().setLayer(fLayer);
+
+		// Obtener la extension completa de la capa
+
+		setAffineTransform(fLayer.getAffineTransform());
+		setDimension(new Dimension((int)fLayer.getDataStore().getWidth(), (int)fLayer.getDataStore().getHeight()));
+		
+		//Limitaciones del recorte para un servicio remoto
+		//1-Interpolaci�n deshabilitada. Se hace la petici�n al servidor de los pixeles que queramos
+		//2-No se pueden intercambiar bandas. Puede hacerse a posteriori cuando ya est� en disco
+		//3-No se puede seleccionar por coordenadas pixel. Si la fuente es WebMapService puede no tener resoluci�n 
+		//en pixeles por lo que puede no tener sentido este tipo de selecci�n
+		if(getFLayer().isRemote()) {
+			getResolutionPanel().getComboInterpolation().setEnabled(false);
+			getClippingPanel().removeTab(getSelectionPanel());
+			getCoordinatesPanel().getPixelCoordinates().setVisible(false);
+		}
+	}
+
+	/**
+	 * Acciones que se realizan para seleccionar la tool CutRaster
+	 */
+	public void selectToolButton() {
+		// seleccionamos la vista de gvSIG
+		org.gvsig.app.project.documents.view.gui.AbstractViewPanel theView = null;
+		try {
+			IWindow[] allViews = PluginServices.getMDIManager().getAllWindows();
+			for (int i = 0; i < allViews.length; i++) {
+				if (allViews[i] instanceof org.gvsig.app.project.documents.view.gui.AbstractViewPanel
+						&& PluginServices.getMDIManager().getWindowInfo((AbstractViewPanel) allViews[i])
+								.getTitle().equals(viewName))
+					theView = (org.gvsig.app.project.documents.view.gui.AbstractViewPanel) allViews[i];
+			}
+			if (theView == null)
+				return;
+		} catch (ClassCastException ex) {
+			// RasterToolsUtil.messageBoxError("cant_get_view "), this, ex);
+			return;
+		}
+		MapControl m_MapControl = theView.getMapControl();
+
+		// Listener de eventos de movimiento que pone las coordenadas del rat�n en
+		// la barra de estado
+		//StatusBarListener sbl = new StatusBarListener(m_MapControl);
+
+		// Cortar Raster
+		/*ClippingMouseViewListener clippingMouseViewListener = new ClippingMouseViewListener(m_MapControl, getClippingPanel(), data, getFLayer());
+		m_MapControl.addMapTool("cutRaster", new Behavior[] {
+				new RectangleBehavior(clippingMouseViewListener), new MouseMovementBehavior(sbl)
+				}
+		);*/
+
+		m_MapControl.setTool("clipRaster");
+	}
+
+	/**
+	 * Obtiene el <code>MapControl</code> de gvSIG
+	 * @return <code>MapControl</code>
+	 */
+	public MapControl getMapControl() {
+		return mapControl;
+	}
+
+
+	public void rectangle(EnvelopeEvent event) throws BehaviorException {}
+	public void interrupted() {}
+
+	public Image getImageCursor() {
+		return null;
+	}
+
+	public void updateProgress(int current, int total) {
+		
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/listener/ClippingPanelListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/listener
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ClippingData.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ClippingData.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ClippingData.java	(revision 8183)
@@ -0,0 +1,603 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.clip;
+
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.util.Observable;
+
+/**
+ * Datos necesarios para realizar un recorte.
+ *
+ * 27/05/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class ClippingData extends Observable {
+	/**
+	 * N�mero de decimales a mostrar en visualizaci�n
+	 */
+	public static final int  DEC              = 4;
+	/**
+	 * Coordenadas reales y pixel
+	 */
+	private Point2D          ulWc             = new Point2D.Double();
+	private Point2D          lrWc             = new Point2D.Double();
+	private Point2D          llWc             = new Point2D.Double();
+	private Point2D          urWc             = new Point2D.Double();
+
+	private Point2D          ulPx             = new Point2D.Double();
+	private Point2D          lrPx             = new Point2D.Double();
+	private Point2D          llPx             = new Point2D.Double();
+	private Point2D          urPx             = new Point2D.Double();
+	/**
+	 * Valores reales para el ancho, alto y tama�o de celda. Esto es necesario
+	 * porque en la caja de texto se guardan con decimales recortados y cuando se
+	 * pide el valor se devuelven completos.
+	 */
+	private double           pxWidth          = 0;
+	private double           pxHeight         = 0;
+	/**
+	 * Relaci�n entre el ancho y alto en pixeles de la imagen
+	 */
+	private double           ratioWidthHeight = 0;
+
+	private AffineTransform  at               = null;
+
+	/**
+	 * Inicializa los valores de ancho y alto de la imagen de salida a partir del ancho y alto en pixeles
+	 * de la de entrada. Esto solo es necesario al inicio ya que no tienen por que coincidir. Tambi�n inicializa
+	 * la relaci�n entre ancho y alto. La llamada a este m�todo notificar� a los observadores cambios en los
+	 * datos.
+	 */
+	public void initSize() {
+		pxHeight = (Math.floor(getPxMaxY()) - Math.floor(getPxMinY())) + 1;
+		pxWidth = (Math.floor(getPxMaxX()) - Math.floor(getPxMinX())) + 1;
+		ratioWidthHeight = (double) (pxWidth / pxHeight);
+		updateObservers();
+	}
+
+	/**
+	 * Actualiza datos y llama al update de los observadores
+	 */
+	public void updateObservers() {
+		setChanged();
+		notifyObservers();
+	}
+
+	/**
+	 * Inicializa los valores a cero. Esto se hace cuando la selecci�n es fuera del �rea.
+	 */
+	public void setOutOfArea() {
+		ulWc = new Point2D.Double();
+		lrWc = new Point2D.Double();
+		urWc = new Point2D.Double();
+		llWc = new Point2D.Double();
+
+		ulPx = new Point2D.Double();
+		lrPx = new Point2D.Double();
+		llPx = new Point2D.Double();
+		urPx = new Point2D.Double();
+		pxHeight = pxWidth = 0;
+	}
+
+	/**
+	 * Obtiene la relaci�n entre el ancho y alto en p�xeles;
+	 * @return
+	 */
+	public double getRatio() {
+		return getWcWidth() / getWcHeight();
+		//return (double) (ratioWidthHeight);
+	}
+
+	/**
+	 * Obtiene el valor del ancho del raster de salida
+	 * @return
+	 */
+	public double getPxWidth() {
+		return pxWidth;
+	}
+
+	/**
+	 * Obtiene el valor del alto del raster de salida
+	 * @return
+	 */
+	public double getPxHeight() {
+		return pxHeight;
+	}
+
+	/**
+	 * Asigna el valor del ancho del raster de salida
+	 * @param pxw Ancho en p�xeles del raster de salida
+	 */
+	public void setPxWidth(double pxw) {
+		pxWidth = pxw;
+	}
+
+	/**
+	 * Asigna el valor del alto del raster de salida
+	 * @param pxh Alto en p�xeles del raster de salida
+	 */
+	public void setPxHeight(double pxh) {
+		pxHeight = pxh;
+	}
+
+	/**
+	 * Obtiene el tama�o de celda
+	 * @return
+	 */
+	public double getCellSize() {
+		if(((lrPx.getX() - ulPx.getX() + 1) == getPxWidth()) && 
+		   ((lrPx.getY() - ulPx.getY() + 1) == getPxHeight()))
+			return at != null ? at.getScaleX() : 0;
+		else
+			return Math.abs(ulWc.getX() - lrWc.getX()) / pxWidth;
+	}
+
+	/**
+	 * Obtiene la coordenada de m�xima X en pixel.
+	 * @return Coordenada de m�xima X en pixel
+	 */
+	public double getPxMaxX() {
+		return Math.max(Math.max(ulPx.getX(), lrPx.getX()), Math.max(urPx.getX(), llPx.getX()));
+	}
+
+	/**
+	 * Obtiene la coordenada de m�xima Y en pixel.
+	 * @return Coordenada de m�xima Y en pixel
+	 */
+	public double getPxMaxY() {
+		return Math.max(Math.max(ulPx.getY(), lrPx.getY()), Math.max(urPx.getY(), llPx.getY()));
+	}
+
+	/**
+	 * Obtiene la coordenada de m�nima X en pixel.
+	 * @return Coordenada de m�nima X en pixel
+	 */
+	public double getPxMinX() {
+		return Math.min(Math.min(ulPx.getX(), lrPx.getX()), Math.min(llPx.getX(), urPx.getX()));
+	}
+
+	/**
+	 * Obtiene la coordenada de m�nima Y en pixel.
+	 * @return Coordenada de m�nima Y en pixel
+	 */
+	public double getPxMinY() {
+		return Math.min(Math.min(ulPx.getY(), lrPx.getY()), Math.min(urPx.getY(), llPx.getY()));
+	}
+
+	/**
+	 * Obtiene la coordenada de m�xima X real.
+	 * @return Coordenada de m�xima X real
+	 */
+	public double getWcMaxX() {
+		return Math.max(Math.max(ulWc.getX(), lrWc.getX()), Math.max(urWc.getX(), llWc.getX()));
+	}
+
+	/**
+	 * Obtiene la coordenada de m�xima Y real.
+	 * @return Coordenada de m�xima Y real
+	 */
+	public double getWcMaxY() {
+		return Math.max(Math.max(ulWc.getY(), lrWc.getY()), Math.max(urWc.getY(), llWc.getY()));
+	}
+
+	/**
+	 * Obtiene la coordenada de m�nima X real.
+	 * @return Coordenada de m�nima X real
+	 */
+	public double getWcMinX() {
+		return Math.min(Math.min(ulWc.getX(), lrWc.getX()), Math.min(llWc.getX(), urWc.getX()));
+	}
+
+	/**
+	 * Obtiene la coordenada de m�nima Y real.
+	 * @return Coordenada de m�nima Y real.
+	 */
+	public double getWcMinY() {
+		return Math.min(Math.min(ulWc.getY(), lrWc.getY()), Math.min(urWc.getY(), llWc.getY()));
+	}
+
+	/**
+	 * Obtiene la coordenada superior izquierda real en X.
+	 * @return Coordenada de m�xima X real.
+	 */
+	public double getUlxWc() {
+		return ulWc.getX();
+	}
+
+	/**
+	 * Obtiene la coordenada superior izquierda real en Y.
+	 * @return Coordenada de m�xima Y real
+	 */
+	public double getUlyWc() {
+		return ulWc.getY();
+	}
+
+	/**
+	 * Obtiene la coordenada inferior izquierda real en X.
+	 * @return Coordenada de m�xima X real.
+	 */
+	public double getLlxWc() {
+		return llWc.getX();
+	}
+
+	/**
+	 * Obtiene la coordenada inferior izquierda real en Y.
+	 * @return Coordenada de m�xima Y real
+	 */
+	public double getLlyWc() {
+		return llWc.getY();
+	}
+
+	/**
+	 * Obtiene la coordenada inferior derecha real en X.
+	 * @return Coordenada de m�nima X real
+	 */
+	public double getLrxWc() {
+		return lrWc.getX();
+	}
+
+	/**
+	 * Obtiene la coordenada inferior derecha real en Y.
+	 * @return Coordenada de m�nima Y real
+	 */
+	public double getLryWc() {
+		return lrWc.getY();
+	}
+
+	/**
+	 * Obtiene la coordenada superior derecha real en X.
+	 * @return Coordenada de m�nima X real
+	 */
+	public double getUrxWc() {
+		return urWc.getX();
+	}
+
+	/**
+	 * Obtiene la coordenada superior derecha real en Y.
+	 * @return Coordenada de m�nima Y real
+	 */
+	public double getUryWc() {
+		return urWc.getY();
+	}
+
+	/**
+	 * Obtiene la coordenada superior izquierda pixel en X.
+	 * @return Coordenada de m�xima X real.
+	 */
+	public double getUlxPx() {
+		return ulPx.getX();
+	}
+
+	/**
+	 * Obtiene la coordenada superior izquierda pixel en Y.
+	 * @return Coordenada de m�xima Y real
+	 */
+	public double getUlyPx() {
+		return ulPx.getY();
+	}
+
+	/**
+	 * Obtiene la coordenada inferior izquierda pixel en X.
+	 * @return Coordenada de m�xima X real.
+	 */
+	public double getLlxPx() {
+		return llPx.getX();
+	}
+
+	/**
+	 * Obtiene la coordenada inferior izquierda pixel en Y.
+	 * @return Coordenada de m�xima Y real
+	 */
+	public double getLlyPx() {
+		return llPx.getY();
+	}
+
+	/**
+	 * Obtiene la coordenada inferior derecha pixel en X.
+	 * @return Coordenada de m�nima X real
+	 */
+	public double getLrxPx() {
+		return lrPx.getX();
+	}
+
+	/**
+	 * Obtiene la coordenada inferior derecha pixel en Y.
+	 * @return Coordenada de m�nima Y real
+	 */
+	public double getLryPx() {
+		return lrPx.getY();
+	}
+
+	/**
+	 * Obtiene la coordenada superior derecha pixel en X.
+	 * @return Coordenada de m�nima X real
+	 */
+	public double getUrxPx() {
+		return urPx.getX();
+	}
+
+	/**
+	 * Obtiene la coordenada superior derecha pixel en Y.
+	 * @return Coordenada de m�nima Y real
+	 */
+	public double getUryPx() {
+		return urPx.getY();
+	}
+
+	/**
+	 * Ancho en coordenadas reales
+	 * @return
+	 */
+	public double getWcWidth() {
+		return Math.abs(getWcMaxX() - getWcMinX());
+	}
+
+	/**
+	 * Alto en coordenadas reales
+	 * @return
+	 */
+	public double getWcHeight() {
+		return Math.abs(getWcMaxY() - getWcMinY());
+	}
+
+	/**
+	 * Asigna las coordenadas del mundo real a partir de n�meros en coma flotante.
+	 * @param ul coordenada superior izquierda
+	 * @param lr coordenada inferior derecha
+	 * @param ll coordenada inferior izquierda
+	 * @param ur coordenada superior derecha
+	 */
+	public void setCoorReal(Point2D ul, Point2D lr, Point2D ll, Point2D ur) {
+		ulWc = ul;
+		lrWc = lr;
+		llWc = ll;
+		urWc = ur;
+	}
+
+	/**
+	 * Asigna las coordenadas pixel a partir de n�meros en coma flotante.
+	 * @param ul coordenada superior izquierda
+	 * @param lr coordenada inferior derecha
+	 * @param ll coordenada inferior izquierda
+	 * @param ur coordenada superior derecha
+	 */
+	public void setCoorPixel(Point2D ul, Point2D lr, Point2D ll, Point2D ur) {
+		ulPx = ul;
+		lrPx = lr;
+		llPx = ll;
+		urPx = ur;
+	}
+
+	/**
+	 * Asigna las coordenadas del mundo real 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 void setCoorRealFromDouble(double ulx, double uly, double lrx, double lry) {
+		ulWc = new Point2D.Double(ulx, uly);
+		lrWc = new Point2D.Double(lrx, lry);
+	}*/
+
+	/**
+	 * Asigna las coordenadas pixel 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 void setCoorPixelFromDouble(double minx, double miny, double maxx, double maxy) {
+		ulPx = new Point2D.Double(minx, miny);
+		lrPx = new Point2D.Double(maxx, maxy);
+	}*/
+
+	/**
+	 * Asigna la coordenada X de la esquina superior izquierda en coordenadas reales
+	 * @param ulx
+	 */
+	public void setUlxWc(double ulx) {
+		ulWc = new Point2D.Double(ulx, ulWc.getY());
+	}
+	
+	/**
+	 * Asigna la coordenada X de la esquina inferior izquierda en coordenadas reales
+	 * @param ulx
+	 */
+	public void setLlxWc(double llx) {
+		llWc = new Point2D.Double(llx, llWc.getY());
+	}
+
+	/**
+	 * Asigna la coordenada Y de la esquina superior izquierda en coordenadas reales
+	 * @param uly
+	 */
+	public void setUlyWc(double uly) {
+		ulWc = new Point2D.Double(ulWc.getX(), uly);
+	}
+	
+	/**
+	 * Asigna la coordenada Y de la esquina superior derecha en coordenadas reales
+	 * @param uly
+	 */
+	public void setUryWc(double ury) {
+		urWc = new Point2D.Double(urWc.getX(), ury);
+	}
+
+	/**
+	 * Asigna la coordenada X de la esquina superior izquierda en p�xeles
+	 * @param ulx
+	 */
+	public void setUlxPx(double ulx) {
+		ulPx = new Point2D.Double(ulx, ulPx.getY());
+	}
+	
+	/**
+	 * Asigna la coordenada X de la esquina inferior izquierda en p�xeles
+	 * @param llx
+	 */
+	public void setLlxPx(double llx) {
+		llPx = new Point2D.Double(llx, llPx.getY());
+	}
+
+	/**
+	 * Asigna la coordenada Y de la esquina superior izquierda en p�xeles
+	 * @param uly
+	 */
+	public void setUlyPx(double uly) {
+		ulPx = new Point2D.Double(ulPx.getX(), uly);
+	}
+	
+	/**
+	 * Asigna la coordenada Y de la esquina superior derecha en p�xeles
+	 * @param ury
+	 */
+	public void setUryPx(double ury) {
+		urPx = new Point2D.Double(urPx.getX(), ury);
+	}
+
+	/**
+	 * Asigna la coordenada X de la esquina inferior derecha en coordenadas reales
+	 * @param lrx
+	 */
+	public void setLrxWc(double lrx) {
+		lrWc = new Point2D.Double(lrx, lrWc.getY());
+	}
+	
+	/**
+	 * Asigna la coordenada Y de la esquina inferior izquierda en coordenadas reales
+	 * @param lly
+	 */
+	public void setLlyWc(double lly) {
+		llWc = new Point2D.Double(llWc.getX(), lly);
+	}
+	
+	/**
+	 * Asigna la coordenada X de la esquina superior derecha en coordenadas reales
+	 * @param urx
+	 */
+	public void setUrxWc(double urx) {
+		urWc = new Point2D.Double(urx, urWc.getY());
+	}
+
+	/**
+	 * Asigna la coordenada Y de la esquina inferior derecha en coordenadas reales
+	 * @param lry
+	 */
+	public void setLryWc(double lry) {
+		lrWc = new Point2D.Double(lrWc.getX(), lry);
+	}
+
+	/**
+	 * Asigna la coordenada X de la esquina inferior derecha en p�xeles
+	 * @param ulx
+	 */
+	public void setLrxPx(double lrx) {
+		lrPx = new Point2D.Double(lrx, lrPx.getY());
+	}
+	
+	/**
+	 * Asigna la coordenada X de la esquina superior derecha en p�xeles
+	 * @param ulx
+	 */
+	public void setUrxPx(double urx) {
+		urPx = new Point2D.Double(urx, urPx.getY());
+	}
+
+	/**
+	 * Asigna la coordenada Y de la esquina inferior derecha en p�xeles
+	 * @param uly
+	 */
+	public void setLryPx(double lry) {
+		lrPx = new Point2D.Double(lrPx.getX(), lry);
+	}
+	
+	/**
+	 * Asigna la coordenada Y de la esquina inferior derecha en p�xeles
+	 * @param uly
+	 */
+	public void setLlyPx(double lly) {
+		llPx = new Point2D.Double(llPx.getX(), lly);
+	}
+
+	/**
+	 * Asigna la matriz de transformaci�n
+	 * @param at AffineTransform
+	 */
+	public void setAffineTransform(AffineTransform at) {
+		this.at = at;
+	}
+
+	/**
+	 * Obtiene las coordenadas del mundo real para la petici�n de recorte
+	 * @return double[]
+	 */
+	public double[] getWcCoordinatesToClip() {
+		/*Point2D ul = new Point2D.Double(getPxMinX(), getPxMinY());
+		Point2D lr = new Point2D.Double(getPxMaxX(), getPxMaxY());
+		at.transform(ul, ul);
+		at.transform(lr, lr);
+		return new double[]{ul.getX(), ul.getY(), lr.getX(), lr.getY()};*/
+		return new double[]{ulWc.getX(), ulWc.getY(), lrWc.getX(), lrWc.getY()};
+	}
+	
+	/**
+	 * Gets the pixel coordinates to clip
+	 * @return double[]
+	 */
+	public double[] getPxCoordinatesToClip() {
+		return new double[]{ulPx.getX(), ulPx.getY(), lrPx.getX(), lrPx.getY()};
+	}
+
+	/**
+	 * Obtiene el tama�o en pixeles de la imagen de la petici�n de recorte
+	 * @return double[]
+	 */
+	public double[] getPxSizeToClip() {
+		return new double[]{(getPxMaxX() - getPxMinX()), (getPxMaxY() - getPxMinY())};
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.lang.Object#clone()
+	 */
+	public Object clone() {
+		ClippingData data = new ClippingData();
+		data.ulWc = (Point2D)this.ulWc.clone();
+		data.llWc = (Point2D)this.llWc.clone();
+		data.lrWc = (Point2D)this.lrWc.clone();
+		data.urWc = (Point2D)this.urWc.clone();
+		data.ulPx = (Point2D)this.ulPx.clone();
+		data.llPx = (Point2D)this.llPx.clone();
+		data.lrPx = (Point2D)this.lrPx.clone();
+		data.urPx = (Point2D)this.urPx.clone();
+		data.pxWidth = this.pxWidth;
+		data.pxHeight = this.pxHeight;
+		data.ratioWidthHeight = this.ratioWidthHeight;
+		if(this.at!=null)
+			data.at = (AffineTransform)this.at.clone();
+		return data;
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ClippingData.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/tool/VRTFileCreator.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/tool/VRTFileCreator.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/tool/VRTFileCreator.java	(revision 8183)
@@ -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.tools.app.basic.tool.raw.tool;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+/**
+ * This class is user to create a VRT file. It writes the file when the
+ * "writeFile" method is called. If some params are not seted the deafult values
+ * will bi used.
+ * 
+ * @author Jorge Piera Llodr� (piera_jor@gva.es)
+ */
+public class VRTFileCreator {
+	private Writer writer             = null;
+	private File   m_File             = null;
+	private int    width              = 0;
+	private int    height             = 0;
+	private int    bands              = 0;
+	private int    headerSize         = 0;
+	private int    fileSize           = 0;
+	private String rawFile            = null;
+	private String dataType           = null;
+	private int    dataSize           = 0;
+	private String byteOrder          = null;
+	private String interleaving       = null;
+	private String outputHeaderFormat = null;
+	
+	public VRTFileCreator(File m_File) {
+		super();		
+		this.m_File = m_File;
+	}
+	
+	public VRTFileCreator(String file) {
+		super();		
+		this.m_File = new File(file);
+	}
+	
+	/**
+	 * It writes the VRT file
+	 * @throws IOException
+	 */
+	public void writeFile() throws IOException{
+		if (!m_File.exists()){
+			m_File.createNewFile();
+		}
+		writer = new FileWriter(m_File);
+		createVRTFile();
+		writer.close();	
+	}
+	
+	/**
+	 * It creates the VRT File
+	 * @throws IOException
+	 */
+	private void createVRTFile() throws IOException{
+		writer.write(getXMLVRTDatasetHeaderTag());
+		
+		for (int i=0 ; i<getBands() ; i++){
+			createOneBand(i+1);
+		}
+		
+		writer.write(getXMLVRTDatasetEndTag());
+	}
+	
+	/**
+	 * IT creates all the XML tags for one band
+	 * @param band Band number
+	 * @throws IOException
+	 */
+	private void createOneBand(int band) throws IOException {
+		writer.write(getXMLVRTRasterBandHeaderTag(band));
+		writer.write(getXMLSourceFilenameTag());
+		writer.write(getXMLByteOrderTag());
+		writer.write(getXMLImageOffsetTag(band));
+		writer.write(getXMLPixelOffsetTag());
+		writer.write(getXMLLineOffsetTag());
+		writer.write(getXMLVRTRasterBandEndTag());
+	}
+
+	/**
+	 * Creates the header of the VRTDataset XML tag. It contains the width and the
+	 * height.
+	 * @return The VRTDataset XML tag
+	 */
+	private String getXMLVRTDatasetHeaderTag() {
+		StringBuffer buffer = new StringBuffer();
+		buffer.append("<VRTDataset rasterXSize=\"" + getImageWidth() + "\" ");
+		buffer.append("rasterYSize=\"" + getImageHeight() + "\">\n");
+		return buffer.toString();
+	}	
+	
+	/**
+	 * Creates the end of the VRTDataset XML tag
+	 * @return The VRTDataset XML tag
+	 */
+	private String getXMLVRTDatasetEndTag() {
+		StringBuffer buffer = new StringBuffer();
+		buffer.append("</VRTDataset>\n");
+		return buffer.toString();
+	}
+	
+	/**
+	 * Creates the header of the VRTRasterBand XML tag. It contains the image data
+	 * type.
+	 * @return The VRTRasterBand XML tag
+	 */
+	private String getXMLVRTRasterBandHeaderTag(int band) {
+		StringBuffer buffer = new StringBuffer();
+		buffer.append("\t<VRTRasterBand dataType=\"" + getDataType() + "\" ");
+		buffer.append("band=\"" + band + "\" ");
+		buffer.append("subClass=\"VRTRawRasterBand\">\n");
+		return buffer.toString();
+	}
+
+	/**
+	 * Creates the end of the VRTRasterBand XML tag
+	 * @return The VRTRasterBand XML tag
+	 */
+	private String getXMLVRTRasterBandEndTag() {
+		StringBuffer buffer = new StringBuffer();
+		buffer.append("\t</VRTRasterBand>\n");
+		return buffer.toString();
+	}		
+	
+	
+	/**
+	 * Creates the SourceFilename XML tag: The raw file path
+	 * @return The SourceFilename XML tag
+	 */
+	private String getXMLSourceFilenameTag() {
+		StringBuffer buffer = new StringBuffer();
+		buffer.append("\t\t<SourceFilename relativetoVRT=\"1\">");
+		buffer.append(getRawFile());
+		buffer.append("</SourceFilename>\n");
+		return buffer.toString();
+	}
+
+	/**
+	 * Creates the ByteOrder XML tag. Possible values are specified in
+	 * VRTFileOptions class.
+	 * @return The ByteOrder XML tag
+	 */
+	private String getXMLByteOrderTag() {
+		StringBuffer buffer = new StringBuffer();
+		buffer.append("\t\t<ByteOrder>");
+		buffer.append(getByteOrder());
+		buffer.append("</ByteOrder>\n");
+		return buffer.toString();
+	}	
+	
+	/**
+	 * Creates the ImageOffset XML tag: The image data starts from the byte number
+	 * specified by this value
+	 * @return The ImageOffset XML tag
+	 */
+	private String getXMLImageOffsetTag(int band) {
+		StringBuffer buffer = new StringBuffer();
+		buffer.append("\t\t<ImageOffset>");
+		buffer.append(VRTFormatUtils.getImageOffset(this, band));
+		buffer.append("</ImageOffset>\n");
+		return buffer.toString();
+	}
+
+	/**
+	 * Creates the PixelOffset XML tag: The byte offeset between pixels
+	 * @return The PixelOffset XML tag
+	 */
+	private String getXMLPixelOffsetTag() {
+		StringBuffer buffer = new StringBuffer();
+		buffer.append("\t\t<PixelOffset>");
+		buffer.append(VRTFormatUtils.getPixelOffset(this));
+		buffer.append("</PixelOffset>\n");
+		return buffer.toString();
+	}
+
+	/**
+	 * Creates the LineOffset XML tag.
+	 * @return The LineOffset XML tag
+	 */
+	private String getXMLLineOffsetTag() {
+		StringBuffer buffer = new StringBuffer();
+		buffer.append("\t\t<LineOffset>");
+		buffer.append(VRTFormatUtils.getLineOffset(this));
+		buffer.append("</LineOffset>\n");
+		return buffer.toString();
+	}
+
+	/**
+	 * @return Returns the bands.
+	 */
+	public int getBands() {
+		return bands;
+	}
+
+	/**
+	 * @param bands The bands to set.
+	 */
+	public void setBands(int bands) {
+		this.bands = bands;
+	}
+
+	/**
+	 * @return Returns the byteOrder.
+	 */
+	public String getByteOrder() {
+		return byteOrder;
+	}
+
+	/**
+	 * @param byteOrder The byteOrder to set.
+	 */
+	public void setByteOrder(String byteOrder) {
+		this.byteOrder = byteOrder;
+	}
+
+	/**
+	 * @return Returns the dataType.
+	 */
+	public String getDataType() {
+		return dataType;
+	}
+
+	/**
+	 * @param dataType The dataType to set.
+	 */
+	public void setDataType(String dataType) {
+		this.dataType = dataType;
+	}
+
+	/**
+	 * @return Returns the fileSize.
+	 */
+	public int getFileSize() {
+		return fileSize;
+	}
+
+	/**
+	 * @param fileSize The fileSize to set.
+	 */
+	public void setFileSize(int fileSize) {
+		this.fileSize = fileSize;
+	}
+
+	/**
+	 * @return Returns the headerSize.
+	 */
+	public int getHeaderSize() {
+		return headerSize;
+	}
+
+	/**
+	 * @param headerSize The headerSize to set.
+	 */
+	public void setHeaderSize(int headerSize) {
+		this.headerSize = headerSize;
+	}
+
+	/**
+	 * @return Returns the height.
+	 */
+	public int getImageHeight() {
+		return height;
+	}
+
+	/**
+	 * @param height The height to set.
+	 */
+	public void setImageHeight(int height) {
+		this.height = height;
+	}
+
+	/**
+	 * @return Returns the interleaving.
+	 */
+	public String getInterleaving() {
+		return interleaving;
+	}
+
+	/**
+	 * @param interleaving The interleaving to set.
+	 */
+	public void setInterleaving(String interleaving) {
+		this.interleaving = interleaving;
+	}
+
+	/**
+	 * @return Returns the outputHeaderFormat.
+	 */
+	public String getOutputHeaderFormat() {
+		return outputHeaderFormat;
+	}
+
+	/**
+	 * @param outputHeaderFormat The outputHeaderFormat to set.
+	 */
+	public void setOutputHeaderFormat(String outputHeaderFormat) {
+		this.outputHeaderFormat = outputHeaderFormat;
+	}
+
+	/**
+	 * @return Returns the width.
+	 */
+	public int getImageWidth() {
+		return width;
+	}
+
+	/**
+	 * @param width The width to set.
+	 */
+	public void setImageWidth(int width) {
+		this.width = width;
+	}
+
+	/**
+	 * @return Returns the rawFile.
+	 */
+	public String getRawFile() {
+		return rawFile;
+	}
+
+	/**
+	 * @param rawFile The rawFile to set.
+	 */
+	public void setRawFile(String rawFile) {
+		this.rawFile = rawFile;
+	}
+
+	/**
+	 * @return Returns the m_File.
+	 */
+	public File getM_File() {
+		return m_File;
+	}
+
+	/**
+	 * @return Returns the dataSize.
+	 */
+	public int getDataSize() {
+		return dataSize;
+	}
+
+	/**
+	 * @param dataSize The dataSize to set.
+	 */
+	public void setDataSize(int dataSize) {
+		this.dataSize = dataSize;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/tool/VRTFileCreator.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/tool/VRTFormatOptions.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/tool/VRTFormatOptions.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/tool/VRTFormatOptions.java	(revision 8183)
@@ -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.tools.app.basic.tool.raw.tool;
+
+import java.util.Vector;
+/**
+ * This class contains some information to manage the VRT file formats. It has
+ * the possible values for the params.
+ * 
+ * @author Jorge Piera Llodr� (piera_jor@gva.es)
+ */
+public class VRTFormatOptions {
+	public static final String INTERLEAVING_PIXEL = "Pixel";
+	public static final String INTERLEAVING_BAND  = "Band";
+	public static final String INTERLEAVING_LINE  = "Line";
+
+	public static final String DATA_TYPE_BYTE     = "Byte";
+	public static final String DATA_TYPE_UINT16   = "Uint16";
+	public static final String DATA_TYPE_INT16    = "Int16";
+	public static final String DATA_TYPE_UINT32   = "UInt32";
+	public static final String DATA_TYPE_INT32    = "Int32";
+	public static final String DATA_TYPE_FLOAT32  = "Float32";
+	public static final String DATA_TYPE_FLOAT64  = "Float64";
+	public static final String DATA_TYPE_CINT16   = "CInt16";
+	public static final String DATA_TYPE_CINT32   = "CInt32";
+	public static final String DATA_TYPE_CFLOAT32 = "CFloat32";
+	public static final String DATA_TYPE_CFLOAT64 = "CFloat64";
+
+	public static final String BYTE_ORDER_LSB     = "LSB";
+	public static final String BYTE_ORDER_MSB     = "MSB";
+
+	public static final String OUTPUT_FORMAT_VRT  = "VRT";
+	
+	/**
+	 * Return the supported image data types 
+	 * @return
+	 * One vector of data types
+	 */
+	public static Vector getDataTypes() {
+		Vector vector = new Vector();
+		vector.add(new UIOption(DATA_TYPE_BYTE, 8));
+		vector.add(new UIOption(DATA_TYPE_UINT32, 16));
+		vector.add(new UIOption(DATA_TYPE_INT16, 16));
+		vector.add(new UIOption(DATA_TYPE_UINT32, 32));
+		vector.add(new UIOption(DATA_TYPE_INT32, 32));
+		vector.add(new UIOption(DATA_TYPE_FLOAT32, 32));
+		vector.add(new UIOption(DATA_TYPE_FLOAT64, 64));
+		vector.add(new UIOption(DATA_TYPE_CINT16, 16));
+		vector.add(new UIOption(DATA_TYPE_CINT32, 32));
+		vector.add(new UIOption(DATA_TYPE_CFLOAT32, 32));
+		vector.add(new UIOption(DATA_TYPE_CFLOAT64, 64));
+		return vector;
+	}
+
+	/**
+	 * Return the supported byte order
+	 * @return
+	 * One vector of byte order
+	 */
+	public static Vector getByteOrder() {
+		Vector vector = new Vector();
+		vector.add(new UIOption(BYTE_ORDER_LSB, "LSB (Swapped)"));
+		vector.add(new UIOption(BYTE_ORDER_MSB, "MSB (Unswapped)"));
+		return vector;
+	}
+
+	/**
+	 * Return the types of interleavings
+	 * @return
+	 *One vector  of interleavings
+	 */
+	public static Vector getInterleaving() {
+		Vector vector = new Vector();
+		vector.add(new UIOption(INTERLEAVING_PIXEL));
+		vector.add(new UIOption(INTERLEAVING_BAND));
+		vector.add(new UIOption(INTERLEAVING_LINE));
+		return vector;
+	}
+
+	/**
+	 * Return the supported output header formats
+	 * @return
+	 * One vector of header formats
+	 */
+	public static Vector getOutputHeaderFormats() {
+		Vector vector = new Vector();
+		vector.add(new UIOption(OUTPUT_FORMAT_VRT));
+		return vector;
+	}
+
+	/**
+	 * This class is used to separate the string that is showes in the user
+	 * interface of the other string used in the vrt file format.
+	 * 
+	 * @author Jorge Piera Llodr� (piera_jor@gva.es)
+	 */
+	public static class UIOption {
+		private String uiName        = null;
+		private String vrtOptionName = null;
+		private int    dataSize      = 0;
+
+		public UIOption(String vrtOptionName, String uiName) {
+			super();
+			this.uiName = uiName;
+			this.vrtOptionName = vrtOptionName;
+		}
+
+		public UIOption(String vrtOptionName) {
+			super();
+			this.uiName = vrtOptionName;
+			this.vrtOptionName = vrtOptionName;
+		}
+
+		public UIOption(String vrtOptionName, int dataSize) {
+			super();
+			this.uiName = vrtOptionName;
+			this.vrtOptionName = vrtOptionName;
+			this.dataSize = dataSize;
+		}
+
+		/**
+		 * @return Returns the uiName.
+		 */
+		public String getUiName() {
+			return uiName;
+		}
+
+		/**
+		 * @return Returns the vrtOptionName.
+		 */
+		public String getVrtOptionName() {
+			return vrtOptionName;
+		}
+
+		/**
+		 * @return Returns the uiName.
+		 */
+		public String toString() {
+			return uiName;
+		}
+
+		/**
+		 * @return Returns the dataSize.
+		 */
+		public int getDataSize() {
+			return dataSize;
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/tool/VRTFormatOptions.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/tool/VRTFormatUtils.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/tool/VRTFormatUtils.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/tool/VRTFormatUtils.java	(revision 8183)
@@ -0,0 +1,145 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.raw.tool;
+/**
+ * This class has some utils to create a VRT file. It has methods to obtaint the
+ * VRT parameters that will be written in the file
+ * 
+ * @author Jorge Piera Llodr� (piera_jor@gva.es)
+ */
+public class VRTFormatUtils {
+
+	/**
+	 * It calculates the ImageOffSet parameter value.
+	 * @param dataSize Type of each pixel
+	 * @param headerSize Header file size
+	 * @param interLeaving Type of interleaving
+	 * @param band Band number
+	 * @param numBands Number of bands
+	 * @param width Image width
+	 * @param height Image height
+	 * @return ImageOffSet parameter value
+	 */
+	public static String getImageOffset(int dataSize, int headerSize,
+			String interLeaving, int band, int numBands, int width, int height) {
+		int imageOffSet = 0;
+		if (interLeaving.equals(VRTFormatOptions.INTERLEAVING_PIXEL)) {
+			imageOffSet = 1;
+
+		} else
+			if (interLeaving.equals(VRTFormatOptions.INTERLEAVING_BAND)) {
+				imageOffSet = width * height;
+
+			} else
+				if (interLeaving.equals(VRTFormatOptions.INTERLEAVING_LINE)) {
+					imageOffSet = width * numBands;
+				}
+		imageOffSet = imageOffSet * (dataSize / 8);
+		imageOffSet = imageOffSet * (band - 1);
+		imageOffSet = imageOffSet + headerSize;
+		return String.valueOf(imageOffSet);
+	}
+	
+	/**
+	 * It calculates the ImageOffSet parameter value.
+	 * @param fileCreator
+	 * Contains all the params
+	 * @param band
+	 * Band to obtain the image offset
+	 * @return
+	 */
+	public static String getImageOffset(VRTFileCreator fileCreator, int band) {
+		return getImageOffset(fileCreator.getDataSize(), fileCreator.getHeaderSize(),
+				fileCreator.getInterleaving(), band, fileCreator.getBands(),
+				fileCreator.getImageWidth(), fileCreator.getImageHeight());
+	}
+	
+	/**
+	 * It calculates the ImageOffSet parameter value.
+	 * @param dataSize Type of each pixel
+	 * @param interLeaving Type of interleaving Band number
+	 * @param numBands Number of bands
+	 * @param width Image width
+	 * @return ImageOffSet parameter value
+	 */
+	public static String getLineOffset(int dataSize, String interLeaving, int numBands, int width) {
+
+		int lineOffSet = 0;
+		if (interLeaving.equals(VRTFormatOptions.INTERLEAVING_PIXEL)) {
+			lineOffSet = width * numBands;
+
+		} else
+			if (interLeaving.equals(VRTFormatOptions.INTERLEAVING_BAND)) {
+				lineOffSet = width;
+
+			} else
+				if (interLeaving.equals(VRTFormatOptions.INTERLEAVING_LINE)) {
+					lineOffSet = width * numBands;
+				}
+
+		lineOffSet = lineOffSet * (dataSize / 8);
+		return String.valueOf(lineOffSet); 
+	}
+	
+	/**
+	 * It calculates the LineOffSet parameter value.
+	 * @param fileCreator Contains all the params
+	 * @return
+	 */
+	public static String getLineOffset(VRTFileCreator fileCreator) {
+		return getLineOffset(fileCreator.getDataSize(), fileCreator.getInterleaving(), fileCreator.getBands(), fileCreator.getImageWidth());
+	}
+	
+	/**
+	 * It calculates the ImageOffSet parameter value.
+	 * @param dataSize Type of each pixel
+	 * @param interLeaving Type of interleaving
+	 * @param numBands Number of bands
+	 * @return ImageOffSet parameter value
+	 */
+	public static String getPixelOffset(int dataSize, String interLeaving, int numBands) {
+		int pixelOffSet = 0;
+		if (interLeaving.equals(VRTFormatOptions.INTERLEAVING_PIXEL)) {
+			pixelOffSet = numBands;
+
+		} else
+			if (interLeaving.equals(VRTFormatOptions.INTERLEAVING_BAND)) {
+				pixelOffSet = 1;
+
+			} else
+				if (interLeaving.equals(VRTFormatOptions.INTERLEAVING_LINE)) {
+					pixelOffSet = 1;
+				}
+
+		pixelOffSet = pixelOffSet * (dataSize / 8);
+		return String.valueOf(pixelOffSet);
+	}
+	
+	/**
+	 * It calculates the PixelOffSet parameter value.
+	 * @param fileCreator Contains all the params
+	 * @return
+	 */
+	public static String getPixelOffset(VRTFileCreator fileCreator) {
+		return getPixelOffset(fileCreator.getDataSize(), fileCreator.getInterleaving(), fileCreator.getBands());
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/tool/VRTFormatUtils.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/tool
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/OpenRawFileControlsPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/OpenRawFileControlsPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/OpenRawFileControlsPanel.java	(revision 8183)
@@ -0,0 +1,243 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.raw.ui.main;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.io.File;
+
+import javax.swing.JPanel;
+
+import org.gvsig.gui.beans.openfile.OpenFileContainer;
+import org.gvsig.raster.tools.app.basic.tool.raw.tool.VRTFormatOptions;
+/**
+ * This class contains all the components of a open raw file
+ * panel. It doesn't has the main buttons.
+ * @author Jorge Piera Llodr� (piera_jor@gva.es)
+ */
+public class OpenRawFileControlsPanel extends JPanel {
+  private static final long serialVersionUID = 6493641545774147712L;
+	private final int               PANELS_WIDTH            = 510;
+	private OpenFileContainer       openFilePanel           = null;
+	private GeometryPropertiesPanel geometryPropertiesPanel = null;
+	private OutputHeaderFormatPanel outputHeaderFormatPanel = null;
+	private boolean                 calculateFileSize       = true;
+
+	/**
+	 * Constructor
+	 * @param rawFileName
+	 * Raw file name
+	 */
+	public OpenRawFileControlsPanel(String rawFileName) {
+		super();
+		initialize();
+		openFilePanel.getTOpen().setText(rawFileName);
+	}
+
+	/**
+	 * This method initializes this
+	 * 
+	 */
+	private void initialize() {
+		GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
+		gridBagConstraints2.insets = new java.awt.Insets(5, 0, 5, 0);
+		gridBagConstraints2.gridy = 2;
+		gridBagConstraints2.gridx = 0;
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.insets = new java.awt.Insets(5, 0, 5, 0);
+		gridBagConstraints1.gridy = 1;
+		gridBagConstraints1.gridx = 0;
+		GridBagConstraints gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.gridx = 0;
+		this.setLayout(new GridBagLayout());
+		this.add(getOpenFilePanel(), gridBagConstraints);
+		this.add(getGeometryPropertiesPanel(), gridBagConstraints1);
+		this.add(getOutputHeaderFormatPanel(), gridBagConstraints2);
+		new CalculateFileSize();
+	}
+
+	/**
+	 * This method initializes openFilePanel	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	private OpenFileContainer getOpenFilePanel() {
+		if (openFilePanel == null) {
+			openFilePanel = new OpenFileContainer(PANELS_WIDTH, 50, false);
+			openFilePanel.setPreferredSize(new java.awt.Dimension(PANELS_WIDTH, 50));
+		}
+		return openFilePanel;
+	}
+
+	/**
+	 * This method initializes geometryPropertiesPanel	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	private GeometryPropertiesPanel getGeometryPropertiesPanel() {
+		if (geometryPropertiesPanel == null) {
+			geometryPropertiesPanel = new GeometryPropertiesPanel();
+		}
+		return geometryPropertiesPanel;
+	}
+
+	/**
+	 * This method initializes outputHeaderFormatPanel	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	private OutputHeaderFormatPanel getOutputHeaderFormatPanel() {
+		if (outputHeaderFormatPanel == null) {
+			outputHeaderFormatPanel = new OutputHeaderFormatPanel();
+		}
+		return outputHeaderFormatPanel;
+	}
+
+	/**
+	 * Sets the file size into the text field
+	 * @param fileSize
+	 */
+	public void setFileSize(int fileSize) {
+		getGeometryPropertiesPanel().setFileSize(fileSize);
+	}
+
+	/**
+	 * Gets the data type
+	 * @return
+	 */
+	public VRTFormatOptions.UIOption getDataType() {
+		return getGeometryPropertiesPanel().getDataType();
+	}
+
+	/**
+	 * Gets the byte order
+	 * @return
+	 */
+	public String getByteOrder() {
+		return getGeometryPropertiesPanel().getByteOrder();
+	}
+
+	/**
+	 * Gets the type of interleaving
+	 * @return
+	 */
+	public String getInterleaving() {
+		return getGeometryPropertiesPanel().getInterleaving();
+	}
+
+	/**
+	 * gets the image width
+	 * @return
+	 */
+	public int getImageWidth() {
+		return getGeometryPropertiesPanel().getImageWidth();
+	}
+
+	/**
+	 * gets the image height
+	 * @return
+	 */
+	public int getImageHeight() {
+		return getGeometryPropertiesPanel().getImageHeight();
+	}
+
+	/**
+	 * gets the number of bands
+	 * @return
+	 */
+	public int getNumberOfBands() {
+		return getGeometryPropertiesPanel().getNumberOfBands();
+	}
+
+	/**
+	 * gets the header size
+	 * @return
+	 */
+	public int getHeaderSize() {
+		return getGeometryPropertiesPanel().getHeaderSize();
+	}
+
+	/**
+	 * gets the selected outputformat
+	 * @return
+	 */
+	public String getOutputHeaderFormat() {
+		return getOutputHeaderFormatPanel().getOutputHeaderFormat();
+	}
+
+	/**
+	 * Gets the RAW file
+	 * @return
+	 */
+	public File getFile() {
+		return getOpenFilePanel().getFile();
+	}
+
+	/**
+	 * This method is used by the listener to stop the
+	 * thread that calculates the file size
+	 *
+	 */
+	public void stopThread() {
+		calculateFileSize = false;
+	}
+
+	/**
+	 * This class is a thread that try if the textbox (where
+	 * the file to open is written) contains a valid file and
+	 * calculate its size.
+	 * @author Jorge Piera Llodr� (piera_jor@gva.es)
+	 */
+	public class CalculateFileSize implements Runnable {
+		volatile Thread myThread = null;
+
+		public CalculateFileSize() {
+			if (myThread == null) {
+				myThread = new Thread(this);
+				myThread.start();
+			}
+		}
+
+		/*
+		 *  (non-Javadoc)
+		 * @see java.lang.Runnable#run()
+		 */
+		public void run() {
+			while (calculateFileSize) {
+				File file = getFile();
+				if ((file.exists() && (file.isFile()))) {
+					getGeometryPropertiesPanel().setFileSize(file.length());
+				} else {
+					getGeometryPropertiesPanel().setFileSize(0);
+				}
+				try {
+					Thread.sleep(1000);
+				} catch (InterruptedException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+			}
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/OpenRawFileControlsPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/OpenRawFileDefaultPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/OpenRawFileDefaultPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/OpenRawFileDefaultPanel.java	(revision 8183)
@@ -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.raster.tools.app.basic.tool.raw.ui.main;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.JPanel;
+
+import org.gvsig.raster.tools.app.basic.tool.raw.ui.listener.OpenRawFileDefaultViewListener;
+/**
+ * This is the main open raw file panel. It is composed by all the other panels
+ * 
+ * @author Jorge Piera Llodr� (piera_jor@gva.es)
+ */
+public class OpenRawFileDefaultPanel extends JPanel{
+  private static final long serialVersionUID = 6224308303746649872L;
+	private OpenRawFileControlsPanel controlsPanel = null;
+	private OpenRawFileButtonsPanel  buttonsPanel  = null;
+
+	private String                   rawFileName   = null;
+
+	public OpenRawFileDefaultPanel(String rawFileName) {
+		super();
+		this.rawFileName = rawFileName;
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 * 
+	 */
+	private void initialize() {
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.insets = new java.awt.Insets(0, 0, 0, 0);
+		gridBagConstraints1.gridy = 1;
+		gridBagConstraints1.gridx = 0;
+		GridBagConstraints gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 0);
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.gridx = 0;
+		this.setLayout(new GridBagLayout());
+		this.add(getControlsPanel(), gridBagConstraints);
+		this.add(getButtonsPanel(), gridBagConstraints1);
+
+	}
+
+	/**
+	 * This method initializes controlsPanel	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	public OpenRawFileControlsPanel getControlsPanel() {
+		if (controlsPanel == null) {
+			controlsPanel = new OpenRawFileControlsPanel(rawFileName);
+			controlsPanel.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.SoftBevelBorder.RAISED));
+		}
+		return controlsPanel;
+	}
+
+	/**
+	 * This method initializes buttonsPanel	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	private OpenRawFileButtonsPanel getButtonsPanel() {
+		if (buttonsPanel == null) {
+			buttonsPanel = new OpenRawFileButtonsPanel();
+		}
+		return buttonsPanel;
+	}
+
+	/**
+	 * Sets the buttons listener
+	 * @param listener
+	 * Buttons listener
+	 */
+	public void setActionListener(OpenRawFileDefaultViewListener listener) {
+		getButtonsPanel().setActionListener(listener);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/OpenRawFileDefaultPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/OutputHeaderFormatPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/OutputHeaderFormatPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/OutputHeaderFormatPanel.java	(revision 8183)
@@ -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.raster.tools.app.basic.tool.raw.ui.main;
+
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.raster.tools.app.basic.tool.raw.tool.VRTFormatOptions;
+import org.gvsig.utils.swing.JComboBox;
+
+/**
+ * This class implements one part of the open raw file panel. It contains the
+ * combobox to select the "output header format".
+ * 
+ * @author Jorge Piera Llodr� (piera_jor@gva.es)
+ */
+public class OutputHeaderFormatPanel extends JPanel {
+  private static final long serialVersionUID = 1244938224958397171L;
+	private JPanel    labelsPanel            = null;
+	private JPanel    fieldsPanel            = null;
+	private JPanel    OutputFormatTextPanel  = null;
+	private JPanel    outputFormatLabelPanel = null;
+	private JLabel    outputFormatLabel      = null;
+	private JComboBox outputFormatText       = null;
+	private final int WIDTH                  = 510;
+	private final int HEIGHT                 = 25;
+	private final int LABELS_PANEL_WIDTH     = 250;
+	private final int TEXTS_PANEL_WIDTH      = 250;
+	private final int LABELS_WIDTH           = 245;
+	private final int LABELS_HEIGHT          = 19;
+	private final int TEXTS_WIDTH            = 245;
+	private final int TEXTS_HEIGHT           = 19;
+	
+	/**
+	 * This is the default constructor
+	 */
+	public OutputHeaderFormatPanel() {
+		super();
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 * @return void
+	 */
+	private void initialize() {
+		this.setLayout(new GridBagLayout());
+		this.setPreferredSize(new Dimension(WIDTH, HEIGHT));
+		this.add(getLabelsPanel(), new GridBagConstraints());
+		this.add(getFieldsPanel(), new GridBagConstraints());
+	}
+
+	/**
+	 * This method initializes jPanel3	
+	 * @return javax.swing.JPanel	
+	 */
+	private JPanel getOutputFormatLabelPanel() {
+		if (outputFormatLabelPanel == null) {
+			outputFormatLabel = new JLabel();
+			outputFormatLabel.setText(PluginServices.getText(this, "output_header_format"));
+			FlowLayout flowLayout4 = new FlowLayout();
+			flowLayout4.setHgap(0);
+			flowLayout4.setAlignment(FlowLayout.LEFT);
+			flowLayout4.setVgap(1);
+			outputFormatLabelPanel = new JPanel();
+			outputFormatLabelPanel.setPreferredSize(new Dimension(LABELS_WIDTH, LABELS_HEIGHT));
+			outputFormatLabelPanel.setLayout(flowLayout4);
+			outputFormatLabelPanel.add(outputFormatLabel, null);
+		}
+		return outputFormatLabelPanel;
+	}
+
+	/**
+	 * This method initializes jPanel	
+	 * @return javax.swing.JPanel	
+	 */
+	private JPanel getLabelsPanel() {
+		if (labelsPanel == null) {
+			labelsPanel = new JPanel();
+			labelsPanel.setPreferredSize(new Dimension(LABELS_PANEL_WIDTH, HEIGHT));
+			labelsPanel.add(getOutputFormatLabelPanel(), null);
+		}
+		return labelsPanel;
+	}
+
+	/**
+	 * This method initializes jPanel	
+	 * @return javax.swing.JPanel	
+	 */
+	private JPanel getFieldsPanel() {
+		if (fieldsPanel == null) {
+			fieldsPanel = new JPanel();
+			fieldsPanel.setPreferredSize(new Dimension(TEXTS_PANEL_WIDTH, HEIGHT));
+			fieldsPanel.add(getOutputFormatTextPanel(), null);
+		}
+		return fieldsPanel;
+	}
+
+	/**
+	 * This method initializes jPanel	
+	 * @return javax.swing.JPanel	
+	 */
+	private JPanel getOutputFormatTextPanel() {
+		if (OutputFormatTextPanel == null) {
+			FlowLayout flowLayout = new FlowLayout();
+			flowLayout.setHgap(0);
+			flowLayout.setAlignment(FlowLayout.LEFT);
+			flowLayout.setVgap(1);
+			OutputFormatTextPanel = new JPanel();
+			OutputFormatTextPanel.setPreferredSize(new Dimension(TEXTS_WIDTH, TEXTS_HEIGHT));
+			OutputFormatTextPanel.setLayout(flowLayout);
+			OutputFormatTextPanel.add(getOutputFormatText(), null);
+		}
+		return OutputFormatTextPanel;
+	}
+
+	/**
+	 * This method initializes pronunciacionText	
+	 * @return javax.swing.JTextField	
+	 */
+	private JComboBox getOutputFormatText() {
+		if (outputFormatText == null) {
+			outputFormatText = new JComboBox(VRTFormatOptions.getOutputHeaderFormats());
+			outputFormatText.setPreferredSize(new Dimension(TEXTS_WIDTH, TEXTS_HEIGHT));
+		}
+		return outputFormatText;
+	}
+
+	/**
+	 * gets the selected outputformat
+	 * @return
+	 */
+	public String getOutputHeaderFormat() {
+		return ((VRTFormatOptions.UIOption) getOutputFormatText().getSelectedItem()).getVrtOptionName();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/OutputHeaderFormatPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/GeometryPropertiesLeftPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/GeometryPropertiesLeftPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/GeometryPropertiesLeftPanel.java	(revision 8183)
@@ -0,0 +1,380 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.raw.ui.main;
+
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.text.NumberFormat;
+
+import javax.swing.JFormattedTextField;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.utils.StringUtilities;
+
+/**
+ * This panel contains the left panel of the "Set Geometry" panel. It is the
+ * imput to write the image width, the heigth, the number of bands and the image
+ * header size.
+ * 
+ * @author Jorge Piera Llodr� (piera_jor@gva.es)
+ */
+public class GeometryPropertiesLeftPanel extends JPanel {
+  private static final long serialVersionUID = 1254390565246946002L;
+	private JPanel              bandsLabelPanel      = null;
+	private JPanel              headerSizeLabelPanel = null;
+	private JPanel              heigthLabelPanel     = null;
+	private JLabel              heigthLabel          = null;
+	private JPanel              labelsPanel          = null;
+	private JPanel              fieldsPanel          = null;
+	private JPanel              widthTextPanel       = null;
+	private JPanel              heigthTextPanel      = null;
+	private JPanel              widthLabelPanel      = null;
+	private JLabel              widthLabel           = null;
+	private JLabel              bandsLabel           = null;
+	private JPanel              bandsTextPanel       = null;
+	private JPanel              headerSizeTextPanel  = null;
+	private JFormattedTextField widthText            = null;
+	private JLabel              headerSizeLabel      = null;
+	private JFormattedTextField heigthText           = null;
+	private JFormattedTextField bandsText            = null;
+	private JFormattedTextField headerSizeText       = null;
+
+	private final int           WIDTH                = 245;
+	private final int           HEIGHT               = 110;
+	private final int           LABELS_PANEL_WIDTH   = 120;
+	private final int           TEXTS_PANEL_WIDTH    = 125;
+	private final int           LABELS_WIDTH         = 120;
+	private final int           LABELS_HEIGHT        = 19;
+	private final int           TEXTS_WIDTH          = 120;
+	private final int           TEXTS_HEIGHT         = 19;
+	
+	/**
+	 * This is the default constructor
+	 */
+	public GeometryPropertiesLeftPanel() {
+		super();
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 * @return void
+	 */
+	private void initialize() {
+		this.setLayout(new GridBagLayout());
+		this.setPreferredSize(new java.awt.Dimension(WIDTH, HEIGHT));
+		this.add(getLabelsPanel(), new GridBagConstraints());
+		this.add(getFieldsPanel(), new GridBagConstraints());
+	}
+
+	/**
+	 * This method initializes pX
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getBandsLabelPanel() {
+		if (bandsLabelPanel == null) {
+			bandsLabel = new JLabel();
+			bandsLabel.setText(PluginServices.getText(this, "bands_number"));
+			FlowLayout flowLayout2 = new FlowLayout();
+			flowLayout2.setAlignment(java.awt.FlowLayout.LEFT);
+			bandsLabelPanel = new JPanel();
+			bandsLabelPanel.setLayout(flowLayout2);
+			bandsLabelPanel.setPreferredSize(new java.awt.Dimension(LABELS_WIDTH, LABELS_HEIGHT));
+			bandsLabelPanel.add(bandsLabel, null);
+			flowLayout2.setVgap(1);
+			flowLayout2.setHgap(0);
+		}
+		return bandsLabelPanel;
+	}
+
+	/**
+	 * This method initializes pY
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getHeaderSizeLabelPanel() {
+		if (headerSizeLabelPanel == null) {
+			headerSizeLabel = new JLabel();
+			headerSizeLabel.setText(PluginServices.getText(this, "header_Size"));
+			FlowLayout flowLayout1 = new FlowLayout();
+			flowLayout1.setAlignment(java.awt.FlowLayout.LEFT);
+			headerSizeLabelPanel = new JPanel();
+			headerSizeLabelPanel.setLayout(flowLayout1);
+			headerSizeLabelPanel.setPreferredSize(new java.awt.Dimension(LABELS_WIDTH, LABELS_HEIGHT));
+			headerSizeLabelPanel.add(headerSizeLabel, null);
+			flowLayout1.setHgap(0);
+			flowLayout1.setVgap(1);
+		}
+		return headerSizeLabelPanel;
+	}
+
+	/**
+	 * This method initializes pLatitud
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getHeigthLabelPanel() {
+		if (heigthLabelPanel == null) {
+			heigthLabel = new JLabel();
+			heigthLabel.setText(PluginServices.getText(this, "alto"));
+			FlowLayout flowLayout3 = new FlowLayout();
+			flowLayout3.setAlignment(java.awt.FlowLayout.LEFT);
+			heigthLabelPanel = new JPanel();
+			heigthLabelPanel.setLayout(flowLayout3);
+			heigthLabelPanel.setPreferredSize(new java.awt.Dimension(LABELS_WIDTH, LABELS_HEIGHT));
+			flowLayout3.setHgap(0);
+			flowLayout3.setVgap(1);
+			heigthLabelPanel.add(heigthLabel, null);
+		}
+		return heigthLabelPanel;
+	}
+
+	/**
+	 * This method initializes jPanel3
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getWidthLabelPanel() {
+		if (widthLabelPanel == null) {
+			widthLabel = new JLabel();
+			widthLabel.setText(PluginServices.getText(this, "ancho"));
+			FlowLayout flowLayout4 = new FlowLayout();
+			flowLayout4.setHgap(0);
+			flowLayout4.setAlignment(java.awt.FlowLayout.LEFT);
+			flowLayout4.setVgap(1);
+			widthLabelPanel = new JPanel();
+			widthLabelPanel.setPreferredSize(new java.awt.Dimension(LABELS_WIDTH, LABELS_HEIGHT));
+			widthLabelPanel.setLayout(flowLayout4);
+			widthLabelPanel.add(widthLabel, null);
+		}
+		return widthLabelPanel;
+	}
+
+	/**
+	 * This method initializes jPanel
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getLabelsPanel() {
+		if (labelsPanel == null) {
+			labelsPanel = new JPanel();
+			labelsPanel.setPreferredSize(new java.awt.Dimension(LABELS_PANEL_WIDTH, HEIGHT));
+			labelsPanel.add(getWidthLabelPanel(), null);
+			labelsPanel.add(getHeigthLabelPanel(), null);
+			labelsPanel.add(getBandsLabelPanel(), null);
+			labelsPanel.add(getHeaderSizeLabelPanel(), null);
+		}
+		return labelsPanel;
+	}
+
+	/**
+	 * This method initializes jPanel
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getFieldsPanel() {
+		if (fieldsPanel == null) {
+			fieldsPanel = new JPanel();
+			fieldsPanel.setPreferredSize(new java.awt.Dimension(TEXTS_PANEL_WIDTH, HEIGHT));
+			fieldsPanel.add(getWidthTextPanel(), null);
+			fieldsPanel.add(getHeigthTextPanel(), null);
+			fieldsPanel.add(getBandsTextPanel(), null);
+			fieldsPanel.add(getHeaderSizeTextPanel(), null);
+		}
+		return fieldsPanel;
+	}
+
+	/**
+	 * This method initializes jPanel
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getWidthTextPanel() {
+		if (widthTextPanel == null) {
+			FlowLayout flowLayout = new FlowLayout();
+			flowLayout.setHgap(0);
+			flowLayout.setAlignment(java.awt.FlowLayout.LEFT);
+			flowLayout.setVgap(1);
+			widthTextPanel = new JPanel();
+			widthTextPanel.setPreferredSize(new java.awt.Dimension(TEXTS_WIDTH, TEXTS_HEIGHT));
+			widthTextPanel.setLayout(flowLayout);
+			widthTextPanel.add(getWidthText(), null);
+		}
+		return widthTextPanel;
+	}
+
+	/**
+	 * This method initializes jPanel1
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getHeigthTextPanel() {
+		if (heigthTextPanel == null) {
+			FlowLayout flowLayout5 = new FlowLayout();
+			flowLayout5.setHgap(0);
+			flowLayout5.setAlignment(java.awt.FlowLayout.LEFT);
+			flowLayout5.setVgap(1);
+			heigthTextPanel = new JPanel();
+			heigthTextPanel.setPreferredSize(new java.awt.Dimension(TEXTS_WIDTH, TEXTS_HEIGHT));
+			heigthTextPanel.setLayout(flowLayout5);
+			heigthTextPanel.add(getHeigthText(), null);
+		}
+		return heigthTextPanel;
+	}
+
+	/**
+	 * This method initializes jPanel2
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getHeaderSizeTextPanel() {
+		if (headerSizeTextPanel == null) {
+			FlowLayout flowLayout8 = new FlowLayout();
+			flowLayout8.setHgap(0);
+			flowLayout8.setAlignment(FlowLayout.LEFT);
+			flowLayout8.setVgap(1);
+			headerSizeTextPanel = new JPanel();
+			headerSizeTextPanel.setPreferredSize(new java.awt.Dimension(TEXTS_WIDTH, TEXTS_HEIGHT));
+			headerSizeTextPanel.setLayout(flowLayout8);
+			headerSizeTextPanel.add(getHeaderSizeText(), null);
+		}
+		return headerSizeTextPanel;
+	}
+
+	/**
+	 * This method initializes oficialTextPanel
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getBandsTextPanel() {
+		if (bandsTextPanel == null) {
+			FlowLayout flowLayout9 = new FlowLayout();
+			flowLayout9.setHgap(0);
+			flowLayout9.setAlignment(FlowLayout.LEFT);
+			flowLayout9.setVgap(1);
+			bandsTextPanel = new JPanel();
+			bandsTextPanel.setPreferredSize(new java.awt.Dimension(TEXTS_WIDTH, TEXTS_HEIGHT));
+			bandsTextPanel.setLayout(flowLayout9);
+			bandsTextPanel.add(getBandsText(), null);
+		}
+		return bandsTextPanel;
+	}
+
+	/**
+	 * This method initializes pronunciacionText
+	 * @return javax.swing.JTextField
+	 */
+	private JFormattedTextField getWidthText() {
+		if (widthText == null) {
+			widthText = new JFormattedTextField(NumberFormat.getIntegerInstance());
+			widthText.setPreferredSize(new Dimension(TEXTS_WIDTH, TEXTS_HEIGHT));
+			widthText.setText("0");
+		}
+		return widthText;
+	}
+
+	/**
+	 * This method initializes etimologyText
+	 * @return javax.swing.JTextField
+	 */
+	private JFormattedTextField getHeigthText() {
+		if (heigthText == null) {
+			heigthText = new JFormattedTextField(NumberFormat.getIntegerInstance());
+			heigthText.setPreferredSize(new Dimension(TEXTS_WIDTH, TEXTS_HEIGHT));
+			heigthText.setText("0");
+		}
+		return heigthText;
+	}
+
+	/**
+	 * This method initializes bandsText
+	 * @return javax.swing.JTextField
+	 */
+	private JFormattedTextField getBandsText() {
+		if (bandsText == null) {
+			bandsText = new JFormattedTextField(NumberFormat.getIntegerInstance());
+			bandsText.setPreferredSize(new Dimension(TEXTS_WIDTH, TEXTS_HEIGHT));
+			bandsText.setText("0");
+		}
+		return bandsText;
+	}
+
+	/**
+	 * This method initializes headerSizeText
+	 * @return javax.swing.JTextField
+	 */
+	private JFormattedTextField getHeaderSizeText() {
+		if (headerSizeText == null) {
+			headerSizeText = new JFormattedTextField(NumberFormat.getIntegerInstance());
+			headerSizeText.setPreferredSize(new Dimension(TEXTS_WIDTH, TEXTS_HEIGHT));
+			headerSizeText.setText("0");
+		}
+		return headerSizeText;
+	}
+
+	/**
+	 * gets the image width
+	 * @return
+	 */
+	public int getImageWidth() {
+		try {
+			String buffer = StringUtilities.replace(getWidthText().getText(), ".", "");
+			buffer = StringUtilities.replace(buffer, ",", "");
+			return Integer.parseInt(buffer);
+		} catch (NumberFormatException e) {
+			return 0;
+		}
+	}
+
+	/**
+	 * gets the image height
+	 * @return
+	 */
+	public int getImageHeight() {
+		try {
+			String buffer = StringUtilities.replace(getHeigthText().getText(), ".", "");
+			buffer = StringUtilities.replace(buffer, ",", "");
+			return Integer.parseInt(buffer);
+		} catch (NumberFormatException e) {
+			return 0;
+		}
+	}
+
+	/**
+	 * gets the number of bands
+	 * @return
+	 */
+	public int getNumberOfBands() {
+		try {
+			return Integer.valueOf(getBandsText().getText()).intValue();
+		} catch (NumberFormatException e) {
+			return 0;
+		}
+	}
+
+	/**
+	 * gets the header size
+	 * @return
+	 */
+	public int getHeaderSize() {
+		try {
+			return Integer.valueOf(getHeaderSizeText().getText()).intValue();
+		} catch (NumberFormatException e) {
+			return 0;
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/GeometryPropertiesLeftPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/GeometryPropertiesRigthPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/GeometryPropertiesRigthPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/GeometryPropertiesRigthPanel.java	(revision 8183)
@@ -0,0 +1,375 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.raw.ui.main;
+
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.raster.tools.app.basic.tool.raw.tool.VRTFormatOptions;
+import org.gvsig.utils.swing.JComboBox;
+
+/**
+ * This panel contains the rigth panel of the "Set Geometry"
+ * panel. It is the imput to write the file size in bytes,
+ * the data type, the byte order and the type of
+ * interleaving.
+ * @author Jorge Piera Llodr� (piera_jor@gva.es)
+ */
+public class GeometryPropertiesRigthPanel extends JPanel{
+  private static final long serialVersionUID = 1L;
+
+	private JPanel     byteOrderLabelPanel    = null;
+	private JPanel     interleavingLabelPanel = null;
+	private JPanel     dataTypeLabelPanel     = null;
+	private JLabel     dataTypeLabel          = null;
+	private JPanel     labelsPanel            = null;
+	private JPanel     fieldsPanel            = null;
+	private JPanel     fileSizeTextPanel      = null;
+	private JPanel     dataTypeTextPanel      = null;
+	private JPanel     fileSizeLabelPanel     = null;
+	private JLabel     fileSizeLabel          = null;
+	private JLabel     byteOrderLabel         = null;
+	private JPanel     byteOrderTextPanel     = null;
+	private JPanel     interleavingTextPanel  = null;
+	private JTextField fileSizeText           = null;
+	private JLabel     interleavingLabel      = null;
+	private JComboBox  dataTypeText           = null;
+	private JComboBox  byteOrderText          = null;
+	private JComboBox  interleavingText       = null;
+
+	private final int  WIDTH                  = 245;
+	private final int  HEIGHT                 = 110;
+	private final int  LABELS_PANEL_WIDTH     = 120;
+	private final int  TEXTS_PANEL_WIDTH      = 125;
+	private final int  LABELS_WIDTH           = 120;
+	private final int  LABELS_HEIGHT          = 19;
+	private final int  TEXTS_WIDTH            = 120;
+	private final int  TEXTS_HEIGHT           = 19;
+	
+	/**
+	 * This is the default constructor
+	 */
+	public GeometryPropertiesRigthPanel() {
+		super();
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 * 
+	 * @return void
+	 */
+	private void initialize() {
+
+		this.setLayout(new GridBagLayout());
+		this.setPreferredSize(new java.awt.Dimension(WIDTH, HEIGHT));
+		this.add(getLabelsPanel(), new GridBagConstraints());
+		this.add(getFieldsPanel(), new GridBagConstraints());
+	}
+
+	/**
+	 * This method initializes pX	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	private JPanel getByteOrderLabelPanel() {
+		if (byteOrderLabelPanel == null) {
+			byteOrderLabel = new JLabel();
+			byteOrderLabel.setText(PluginServices.getText(this, "byte_order"));
+			FlowLayout flowLayout2 = new FlowLayout();
+			flowLayout2.setAlignment(java.awt.FlowLayout.LEFT);
+			byteOrderLabelPanel = new JPanel();
+			byteOrderLabelPanel.setLayout(flowLayout2);
+			byteOrderLabelPanel.setPreferredSize(new java.awt.Dimension(LABELS_WIDTH, LABELS_HEIGHT));
+			byteOrderLabelPanel.add(byteOrderLabel, null);
+			flowLayout2.setVgap(1);
+			flowLayout2.setHgap(0);
+		}
+		return byteOrderLabelPanel;
+	}
+
+	/**
+	 * This method initializes pY	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	private JPanel getInterleavingLabelPanel() {
+		if (interleavingLabelPanel == null) {
+			interleavingLabel = new JLabel();
+			interleavingLabel.setText(PluginServices.getText(this, "type_of_interleaving"));
+			FlowLayout flowLayout1 = new FlowLayout();
+			flowLayout1.setAlignment(java.awt.FlowLayout.LEFT);
+			interleavingLabelPanel = new JPanel();
+			interleavingLabelPanel.setLayout(flowLayout1);
+			interleavingLabelPanel.setPreferredSize(new java.awt.Dimension(LABELS_WIDTH, LABELS_HEIGHT));
+			interleavingLabelPanel.add(interleavingLabel, null);
+			flowLayout1.setHgap(0);
+			flowLayout1.setVgap(1);
+		}
+		return interleavingLabelPanel;
+	}
+
+	/**
+	 * This method initializes pLatitud	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	private JPanel getDataTypeLabelPanel() {
+		if (dataTypeLabelPanel == null) {
+			dataTypeLabel = new JLabel();
+			dataTypeLabel.setText(PluginServices.getText(this, "data_type"));
+			FlowLayout flowLayout3 = new FlowLayout();
+			flowLayout3.setAlignment(java.awt.FlowLayout.LEFT);
+			dataTypeLabelPanel = new JPanel();
+			dataTypeLabelPanel.setLayout(flowLayout3);
+			dataTypeLabelPanel.setPreferredSize(new java.awt.Dimension(LABELS_WIDTH, LABELS_HEIGHT));
+			flowLayout3.setHgap(0);
+			flowLayout3.setVgap(1);
+			dataTypeLabelPanel.add(dataTypeLabel, null);
+		}
+		return dataTypeLabelPanel;
+	}
+
+	/**
+	 * This method initializes jPanel3	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	private JPanel getFileSizeLabelPanel() {
+		if (fileSizeLabelPanel == null) {
+			fileSizeLabel = new JLabel();
+			fileSizeLabel.setText(PluginServices.getText(this, "file_size_in_bytes"));
+			FlowLayout flowLayout4 = new FlowLayout();
+			flowLayout4.setHgap(0);
+			flowLayout4.setAlignment(java.awt.FlowLayout.LEFT);
+			flowLayout4.setVgap(1);
+			fileSizeLabelPanel = new JPanel();
+			fileSizeLabelPanel.setPreferredSize(new java.awt.Dimension(LABELS_WIDTH, LABELS_HEIGHT));
+			fileSizeLabelPanel.setLayout(flowLayout4);
+			fileSizeLabelPanel.add(fileSizeLabel, null);
+		}
+		return fileSizeLabelPanel;
+	}
+
+	/**
+	 * This method initializes jPanel	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	private JPanel getLabelsPanel() {
+		if (labelsPanel == null) {
+			labelsPanel = new JPanel();
+			labelsPanel.setPreferredSize(new java.awt.Dimension(LABELS_PANEL_WIDTH, HEIGHT));
+			labelsPanel.add(getFileSizeLabelPanel(), null);
+			labelsPanel.add(getDataTypeLabelPanel(), null);
+			labelsPanel.add(getByteOrderLabelPanel(), null);
+			labelsPanel.add(getInterleavingLabelPanel(), null);
+		}
+		return labelsPanel;
+	}
+
+	/**
+	 * This method initializes jPanel	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	private JPanel getFieldsPanel() {
+		if (fieldsPanel == null) {
+			fieldsPanel = new JPanel();
+			fieldsPanel.setPreferredSize(new java.awt.Dimension(TEXTS_PANEL_WIDTH, HEIGHT));
+			fieldsPanel.add(getFileSizeTextPanel(), null);
+			fieldsPanel.add(getDataTypeTextPanel(), null);
+			fieldsPanel.add(getByteOrderTextPanel(), null);
+			fieldsPanel.add(getInterleavingTextPanel(), null);
+		}
+		return fieldsPanel;
+	}
+
+	/**
+	 * This method initializes jPanel	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	private JPanel getFileSizeTextPanel() {
+		if (fileSizeTextPanel == null) {
+			FlowLayout flowLayout = new FlowLayout();
+			flowLayout.setHgap(0);
+			flowLayout.setAlignment(java.awt.FlowLayout.LEFT);
+			flowLayout.setVgap(1);
+			fileSizeTextPanel = new JPanel();
+			fileSizeTextPanel.setPreferredSize(new java.awt.Dimension(TEXTS_WIDTH, TEXTS_HEIGHT));
+			fileSizeTextPanel.setLayout(flowLayout);
+			fileSizeTextPanel.add(getFileSizeText(), null);
+		}
+		return fileSizeTextPanel;
+	}
+
+	/**
+	 * This method initializes jPanel1	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	private JPanel getDataTypeTextPanel() {
+		if (dataTypeTextPanel == null) {
+			FlowLayout flowLayout5 = new FlowLayout();
+			flowLayout5.setHgap(0);
+			flowLayout5.setAlignment(java.awt.FlowLayout.LEFT);
+			flowLayout5.setVgap(1);
+			dataTypeTextPanel = new JPanel();
+			dataTypeTextPanel.setPreferredSize(new java.awt.Dimension(TEXTS_WIDTH, TEXTS_HEIGHT));
+			dataTypeTextPanel.setLayout(flowLayout5);
+			dataTypeTextPanel.add(getDataTypeText(), null);
+		}
+		return dataTypeTextPanel;
+	}
+
+	/**
+	 * This method initializes jPanel2	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	private JPanel getInterleavingTextPanel() {
+		if (interleavingTextPanel == null) {
+			FlowLayout flowLayout8 = new FlowLayout();
+			flowLayout8.setHgap(0);
+			flowLayout8.setAlignment(FlowLayout.LEFT);
+			flowLayout8.setVgap(1);
+			interleavingTextPanel = new JPanel();
+			interleavingTextPanel.setPreferredSize(new java.awt.Dimension(TEXTS_WIDTH, TEXTS_HEIGHT));
+			interleavingTextPanel.setLayout(flowLayout8);
+			interleavingTextPanel.add(getInterleavingText(), null);
+		}
+		return interleavingTextPanel;
+	}
+
+	/**
+	 * This method initializes oficialTextPanel	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	private JPanel getByteOrderTextPanel() {
+		if (byteOrderTextPanel == null) {
+			FlowLayout flowLayout9 = new FlowLayout();
+			flowLayout9.setHgap(0);
+			flowLayout9.setAlignment(FlowLayout.LEFT);
+			flowLayout9.setVgap(1);
+			byteOrderTextPanel = new JPanel();
+			byteOrderTextPanel.setPreferredSize(new java.awt.Dimension(TEXTS_WIDTH, TEXTS_HEIGHT));
+			byteOrderTextPanel.setLayout(flowLayout9);
+			byteOrderTextPanel.add(getByteOrderText(), null);
+		}
+		return byteOrderTextPanel;
+	}
+
+	/**
+	 * This method initializes pronunciacionText	
+	 * 	
+	 * @return javax.swing.JTextField	
+	 */
+	private JTextField getFileSizeText() {
+		if (fileSizeText == null) {
+			fileSizeText = new JTextField();
+			fileSizeText.setPreferredSize(new Dimension(TEXTS_WIDTH, TEXTS_HEIGHT));
+			fileSizeText.setText("0");
+			fileSizeText.setEnabled(false);
+		}
+		return fileSizeText;
+	}
+
+	/**
+	 * This method initializes etimologyText	
+	 * 	
+	 * @return javax.swing.JTextField	
+	 */
+	private JComboBox getDataTypeText() {
+		if (dataTypeText == null) {
+			dataTypeText = new JComboBox(VRTFormatOptions.getDataTypes());
+			dataTypeText.setPreferredSize(new Dimension(TEXTS_WIDTH, TEXTS_HEIGHT));
+		}
+		return dataTypeText;
+	}
+
+	/**
+	 * This method initializes bandsText	
+	 * 	
+	 * @return javax.swing.JTextField	
+	 */
+	private JComboBox getByteOrderText() {
+		if (byteOrderText == null) {
+			byteOrderText = new JComboBox(VRTFormatOptions.getByteOrder());
+			byteOrderText.setPreferredSize(new Dimension(TEXTS_WIDTH, TEXTS_HEIGHT));
+		}
+		return byteOrderText;
+	}
+
+	/**
+	 * This method initializes headerSizeText	
+	 * 	
+	 * @return javax.swing.JTextField	
+	 */
+	private JComboBox getInterleavingText() {
+		if (interleavingText == null) {
+			interleavingText = new JComboBox(VRTFormatOptions.getInterleaving());
+			interleavingText.setPreferredSize(new Dimension(TEXTS_WIDTH, TEXTS_HEIGHT));
+		}
+		return interleavingText;
+	}
+
+	/**
+	 * Sets the file size into the text field
+	 * @param fileSize
+	 */
+	public void setFileSize(long fileSize) {
+		getFileSizeText().setText(String.valueOf(fileSize));
+	}
+
+	/**
+	 * Gets the data type
+	 * @return
+	 */
+	public VRTFormatOptions.UIOption getDataType() {
+		return (VRTFormatOptions.UIOption) getDataTypeText().getSelectedItem();
+	}
+
+	/**
+	 * Gets the byte order
+	 * @return
+	 */
+	public String getByteOrder() {
+		return ((VRTFormatOptions.UIOption) getByteOrderText().getSelectedItem()).getVrtOptionName();
+	}
+
+	/**
+	 * Gets the type of interleaving
+	 * @return
+	 */
+	public String getInterleaving() {
+		return ((VRTFormatOptions.UIOption) getInterleavingText().getSelectedItem()).getVrtOptionName();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/GeometryPropertiesRigthPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/GeometryPropertiesPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/GeometryPropertiesPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/GeometryPropertiesPanel.java	(revision 8183)
@@ -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.raster.tools.app.basic.tool.raw.ui.main;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.raster.tools.app.basic.tool.raw.tool.VRTFormatOptions;
+
+/**
+ * This panel implements all the geometry properties panel. The "guess image
+ * geometry" button can be enabled or disabled changing the
+ * GUESS_IMAGE_BUTTON_VISIBLE attribute value.
+ * 
+ * @author Jorge Piera Llodr� (piera_jor@gva.es)
+ */
+public class GeometryPropertiesPanel extends JPanel {
+  private static final long serialVersionUID = -3099735931714632591L;
+	private final int                    WIDTH                      = 510;
+	private final int                    HEIGHT                     = 155;
+	private boolean                      GUESS_IMAGE_BUTTON_VISIBLE = false;
+	private GeometryPropertiesLeftPanel  leftPanel                  = null;
+	private GeometryPropertiesRigthPanel rigthPanel                 = null;
+	private GuessImagePanel              guessImagePanel            = null;
+
+	public GeometryPropertiesPanel() {
+		super();
+		initialize();		
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
+		gridBagConstraints2.insets = new java.awt.Insets(0, 0, 0, 0);
+		gridBagConstraints2.gridy = 1;
+		gridBagConstraints2.gridx = 0;
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.insets = new java.awt.Insets(0, 2, 0, 0);
+		gridBagConstraints1.gridy = 0;
+		gridBagConstraints1.gridx = 1;
+		GridBagConstraints gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 0);
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.gridx = 0;
+		this.setLayout(new GridBagLayout());
+		this.setSize(new java.awt.Dimension(WIDTH, HEIGHT));
+		this.setPreferredSize(new java.awt.Dimension(WIDTH, HEIGHT));
+		this.setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this, "select_image_geometry"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+		this.add(getLeftPanel(), gridBagConstraints);
+		this.add(getRigthPanel(), gridBagConstraints1);
+		if (GUESS_IMAGE_BUTTON_VISIBLE) {
+			this.add(getGuessImagePanel(), gridBagConstraints2);
+		}
+	}
+
+	/**
+	 * This method initializes leftPanel
+	 * @return javax.swing.JPanel
+	 */
+	private GeometryPropertiesLeftPanel getLeftPanel() {
+		if (leftPanel == null) {
+			leftPanel = new GeometryPropertiesLeftPanel();
+		}
+		return leftPanel;
+	}
+
+	/**
+	 * This method initializes rigthPanel
+	 * @return javax.swing.JPanel
+	 */
+	private GeometryPropertiesRigthPanel getRigthPanel() {
+		if (rigthPanel == null) {
+			rigthPanel = new GeometryPropertiesRigthPanel();
+		}
+		return rigthPanel;
+	}
+
+	/**
+	 * This method initializes guessImagePanel
+	 * @return javax.swing.JPanel
+	 */
+	private GuessImagePanel getGuessImagePanel() {
+		if (guessImagePanel == null) {
+			guessImagePanel = new GuessImagePanel();
+		}
+		return guessImagePanel;
+	}
+
+	/**
+	 * Sets the file size into the text field
+	 * @param fileSize
+	 */
+	public void setFileSize(long fileSize) {
+		getRigthPanel().setFileSize(fileSize);
+	}
+
+	/**
+	 * Gets the data type
+	 * @return
+	 */
+	public VRTFormatOptions.UIOption getDataType() {
+		return getRigthPanel().getDataType();
+	}
+
+	/**
+	 * Gets the byte order
+	 * @return
+	 */
+	public String getByteOrder() {
+		return getRigthPanel().getByteOrder();
+	}
+
+	/**
+	 * Gets the type of interleaving
+	 * @return
+	 */
+	public String getInterleaving() {
+		return getRigthPanel().getInterleaving();
+	}
+
+	/**
+	 * gets the image width
+	 * @return
+	 */
+	public int getImageWidth() {
+		return getLeftPanel().getImageWidth();
+	}
+
+	/**
+	 * gets the image height
+	 * @return
+	 */
+	public int getImageHeight() {
+		return getLeftPanel().getImageHeight();
+	}
+
+	/**
+	 * gets the number of bands
+	 * @return
+	 */
+	public int getNumberOfBands() {
+		return getLeftPanel().getNumberOfBands();
+	}
+
+	/**
+	 * gets the header size
+	 * @return
+	 */
+	public int getHeaderSize() {
+		return getLeftPanel().getHeaderSize();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/GeometryPropertiesPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/GuessImagePanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/GuessImagePanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/GuessImagePanel.java	(revision 8183)
@@ -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.raster.tools.app.basic.tool.raw.ui.main;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+
+/**
+ * This panel is a JButton for the "Guess image geometry" option.
+ * 
+ * @author Jorge Piera Llodr� (piera_jor@gva.es)
+ */
+public class GuessImagePanel extends JPanel {
+	private static final long serialVersionUID = 6081119425437983640L;
+	private final int BUTTON_WIDTH     = 250;
+	private final int BUTTON_HEIGHT    = 19;
+
+	private JButton   guessImageButton = null;
+
+	public GuessImagePanel() {
+		super();
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		GridBagConstraints gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 0);
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.gridx = 0;
+		this.setLayout(new GridBagLayout());
+		this.add(getGuessImageButton(), gridBagConstraints);
+
+	}
+
+	/**
+	 * This method initializes guessImageButton	
+	 * 	
+	 * @return javax.swing.JButton	
+	 */
+	private JButton getGuessImageButton() {
+		if (guessImageButton == null) {
+			guessImageButton = new JButton();
+			guessImageButton.setPreferredSize(new java.awt.Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
+			guessImageButton.setText(PluginServices.getText(this, "guess_image_geometry"));
+
+		}
+		return guessImageButton;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/GuessImagePanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/OpenRawFileButtonsPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/OpenRawFileButtonsPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/OpenRawFileButtonsPanel.java	(revision 8183)
@@ -0,0 +1,117 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.raw.ui.main;
+
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.raster.tools.app.basic.tool.raw.ui.listener.OpenRawFileDefaultViewListener;
+
+/**
+ * This class contains the main buttons of the open raw file panel window.
+ * 
+ * @author Jorge Piera Llodr� (piera_jor@gva.es)
+ */
+public class OpenRawFileButtonsPanel extends JPanel {
+  private static final long serialVersionUID = -2708844842333915176L;
+
+	private final int WIDTH          = 500;
+	private final int HEIGHT         = 35;
+	private final int BUTTONS_WIDTH  = 80;
+	private final int BUTTONS_HEIGHT = 25;
+
+	private JButton   openButton     = null;
+	private JButton   closeButton    = null;
+
+	public OpenRawFileButtonsPanel() {
+		super();
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
+		gridBagConstraints3.insets = new java.awt.Insets(5, 3, 5, 5);
+		gridBagConstraints3.gridy = 0;
+		gridBagConstraints3.gridx = 3;
+		GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
+		gridBagConstraints2.insets = new java.awt.Insets(5, 3, 5, 2);
+		gridBagConstraints2.gridy = 0;
+		gridBagConstraints2.gridx = 2;
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.insets = new java.awt.Insets(5, 3, 5, 2);
+		gridBagConstraints1.gridy = 0;
+		gridBagConstraints1.gridx = 1;
+		GridBagConstraints gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 2);
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.gridx = 0;
+		this.setLayout(new GridBagLayout());
+		this.setSize(new java.awt.Dimension(WIDTH, HEIGHT));
+		this.add(getOpenButton(), gridBagConstraints2);
+		this.add(getCloseButton(), gridBagConstraints3);
+	}
+	
+	/**
+	 * This method initializes openButton	
+	 * @return javax.swing.JButton	
+	 */
+	private JButton getOpenButton() {
+		if (openButton == null) {
+			openButton = new JButton();
+			openButton.setPreferredSize(new Dimension(BUTTONS_WIDTH, BUTTONS_HEIGHT));
+			openButton.setText(PluginServices.getText(this, "accept"));
+			openButton.setActionCommand("open");
+		}
+		return openButton;
+	}
+
+	/**
+	 * This method initializes closeButton	
+	 * @return javax.swing.JButton	
+	 */
+	private JButton getCloseButton() {
+		if (closeButton == null) {
+			closeButton = new JButton();
+			closeButton.setPreferredSize(new Dimension(BUTTONS_WIDTH, BUTTONS_HEIGHT));
+			closeButton.setText(PluginServices.getText(this, "close"));
+			closeButton.setActionCommand("close");
+		}
+		return closeButton;
+	}
+	
+	/**
+	 * Sets the buttons listener
+	 * @param listener Buttons listener
+	 */
+	public void setActionListener(OpenRawFileDefaultViewListener listener) {
+		openButton.addActionListener(listener);
+		closeButton.addActionListener(listener);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/OpenRawFileButtonsPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/OpenRawFileDefaultView.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/OpenRawFileDefaultView.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/OpenRawFileDefaultView.java	(revision 8183)
@@ -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.tools.app.basic.tool.raw.ui.main;
+
+import java.io.File;
+
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.andami.ui.mdiManager.WindowInfo;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.tool.raw.ui.listener.OpenRawFileDefaultViewListener;
+
+/**
+ * This class implemens the View interface to add the open raw panel in gvSIG
+ * 
+ * @author Jorge Piera Llodr� (piera_jor@gva.es)
+ */
+public class OpenRawFileDefaultView extends OpenRawFileDefaultPanel implements IWindow {
+  private static final long serialVersionUID = -686663312171728878L;
+	private File imageFile = null;
+	
+	/**
+	 * Constructor. It create and sets the listener for the window buttons.
+	 * @param rawFile Raw file name
+	 */
+	public OpenRawFileDefaultView(String rawFileName) {
+		super(rawFileName);
+		setActionListener(new OpenRawFileDefaultViewListener(this));
+		RasterToolsUtil.addWindow(this);	
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.andami.ui.mdiManager.IWindow#getWindowInfo()
+	 */
+	public WindowInfo getWindowInfo() {
+		WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG);
+		m_viewinfo.setTitle(RasterToolsUtil.getText(this, "open_raw_file"));
+		m_viewinfo.setHeight(270);
+		m_viewinfo.setWidth(540);
+		return m_viewinfo;
+	}
+
+	/**
+	 * @return Returns the imageFile.
+	 */
+	public File getImageFile() {
+		return imageFile;
+	}
+
+	/**
+	 * @param imageFile The imageFile to set.
+	 */
+	public void setImageFile(File imageFile) {
+		this.imageFile = imageFile;
+	}
+
+	public Object getWindowProfile() {
+		return WindowInfo.DIALOG_PROFILE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main/OpenRawFileDefaultView.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/main
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/listener/OpenRawFileDefaultViewListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/listener/OpenRawFileDefaultViewListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/listener/OpenRawFileDefaultViewListener.java	(revision 8183)
@@ -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.tools.app.basic.tool.raw.ui.listener;
+
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.IOException;
+
+import javax.swing.JOptionPane;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.tool.raw.tool.VRTFileCreator;
+import org.gvsig.raster.tools.app.basic.tool.raw.ui.main.OpenRawFileControlsPanel;
+import org.gvsig.raster.tools.app.basic.tool.raw.ui.main.OpenRawFileDefaultView;
+
+/**
+ * Listener for the open raw file window. It implements actions for the "open
+ * file" and for the "close window" buttons.
+ * 
+ * @author Jorge Piera Llodr� (piera_jor@gva.es)
+ */
+public class OpenRawFileDefaultViewListener implements ActionListener {
+	private OpenRawFileDefaultView openRawView = null;
+
+	/**
+	 * Contructor
+	 * @param view Open raw file view
+	 */
+	public OpenRawFileDefaultViewListener(OpenRawFileDefaultView view) {
+		super();
+		this.openRawView = view;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+	 */
+	public void actionPerformed(ActionEvent event) {
+		if (event.getActionCommand() == "close") {
+			closeButtonActionPerformed();
+		} else
+			if (event.getActionCommand() == "open") {
+				openButtonActionPerformed();
+			}
+	}
+
+	/**
+	 * Open raw file button action
+	 */
+	private void openButtonActionPerformed() {
+		OpenRawFileControlsPanel controls = openRawView.getControlsPanel();
+		if (!(controls.getFile().exists())) {
+			JOptionPane.showMessageDialog((Component) PluginServices.getMainFrame(), PluginServices.getText(this, "file_doesn_exists"));
+			return;
+		}
+		if (controls.getOutputHeaderFormat().equals("VRT")) {
+			String vrtFileName = controls.getFile().getAbsolutePath().replaceAll("\\.raw", ".vrt");
+			VRTFileCreator vrt = new VRTFileCreator(vrtFileName);
+			vrt.setImageWidth(controls.getImageWidth());
+			vrt.setImageHeight(controls.getImageHeight());
+			vrt.setBands(controls.getNumberOfBands());
+			vrt.setHeaderSize(controls.getHeaderSize());
+			vrt.setDataType(controls.getDataType().getVrtOptionName());
+			vrt.setDataSize(controls.getDataType().getDataSize());
+			vrt.setByteOrder(controls.getByteOrder());
+			vrt.setInterleaving(controls.getInterleaving());
+			vrt.setRawFile(controls.getFile().getName());
+			try {
+				vrt.writeFile();
+				openRawView.setImageFile(vrt.getM_File());
+			} catch (IOException e) {
+				RasterSwingLibrary.messageBoxError("cant_create_vrt_file", this, e);
+			}
+		}
+		closeButtonActionPerformed();
+	}
+
+	/**
+	 * Close window
+	 */
+	private void closeButtonActionPerformed() {
+		OpenRawFileControlsPanel controls = openRawView.getControlsPanel();
+		controls.stopThread();
+		PluginServices.getMDIManager().closeWindow(openRawView);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/listener/OpenRawFileDefaultViewListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui/listener
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw/ui
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/raw
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ROIDataModel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ROIDataModel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ROIDataModel.java	(revision 8183)
@@ -0,0 +1,371 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.app.basic.tool.roi;
+
+import java.awt.Image;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import javax.swing.JComboBox;
+import javax.swing.table.DefaultTableModel;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.app.project.documents.view.toolListeners.StatusBarListener;
+import org.gvsig.fmap.dal.coverage.exception.GridException;
+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.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.mapcontext.MapContextLocator;
+import org.gvsig.fmap.mapcontext.MapContextManager;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
+import org.gvsig.fmap.mapcontext.layers.vectorial.GraphicLayer;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseMovementBehavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.PointBehavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.PolygonBehavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.PolylineBehavior;
+import org.gvsig.gui.beans.table.TableContainer;
+import org.gvsig.gui.beans.table.exceptions.NotInitializeException;
+import org.gvsig.gui.beans.table.models.IModel;
+import org.gvsig.metadata.exceptions.MetadataException;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.roi.ROI;
+import org.gvsig.raster.roi.VectorialROI;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.swing.roi.ROIPanel;
+import org.gvsig.raster.swing.roi.ROIPanelDataModel;
+import org.gvsig.raster.tools.app.basic.tool.roi.ui.listener.DrawMouseViewListener;
+
+/**
+ * Data model for ROIs panel
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class ROIDataModel implements ROIPanelDataModel {
+	private FLayer                      fLayer             = null;
+	private MapControl                  mapControl         = null;
+	private AbstractViewPanel           view               = null;
+	private GraphicLayer                graphicLayer       = null;
+	private String                      previousTool       = null;
+	private MapContextManager           mapContextManager  = MapContextLocator.getMapContextManager();
+	private ROIFeatureManager           roiFeatureManager  = null;
+	private Image                       curImage           = null;
+	private LinkedHashMap<String, ROI>  rois               = null;
+	private ROIPanel                    panel              = null;
+	private List<FLyrVect>              fLyrsList          = null;
+	private File                        roiFile            = null;
+	
+	public class LayerElement {
+		private FLyrVect     lyr  = null;
+		public LayerElement(FLyrVect lyr) {
+			this.lyr = lyr;
+		}
+		
+		public FLyrVect getLayer() {
+			return lyr;
+		}
+		
+		public String toString() {
+			return lyr.getName();
+		}
+	}
+	
+	public ROIDataModel(List<FLyrVect> vectLayers) {
+		this.fLyrsList = vectLayers;
+	}
+	
+	public void setROIPanel(ROIPanel panel) {
+		this.panel = panel;
+		JComboBox list = panel.getLayerList(ROIPanel.FLYRS_COMBO);
+		list.removeAllItems();
+		for (int i = 0; i < fLyrsList.size(); i++) {
+			list.addItem(new LayerElement(fLyrsList.get(i)));
+		}
+	}
+	
+	public ROIPanel getROIPanel() {
+		return panel;
+	}
+	
+	public RasterDataStore getRasterDataStore() {
+		return ((FLyrRaster)fLayer).getDataStore();
+	}
+	
+	/**
+	 * Sets the layer 
+	 * @param layer
+	 * @throws GridException 
+	 */
+	public void setLayer(FLayer layer) throws GridException {
+		fLayer = layer;
+		if (view == null) {
+			IWindow[] list = PluginServices.getMDIManager().getAllWindows();
+			for (int i = 0; i < list.length; i++) {
+				if (list[i] instanceof AbstractViewPanel)
+					view = (AbstractViewPanel) list[i];
+			}
+			if (view == null)
+				return;
+			mapControl = view.getMapControl();
+			graphicLayer = view.getMapControl().getMapContext().getGraphicsLayer();
+
+			/*
+			 * Guardar la herramienta actual para recuperarla m�s tarde, por
+			 * ejemplo al cerrar el contenedor del este panel.
+			 */
+			previousTool = mapControl.getCurrentTool();
+
+			// Listener de eventos de movimiento que pone las coordenadas del
+			// rat�n en la barra de estado
+			StatusBarListener sbl = new StatusBarListener(mapControl);
+
+			DrawMouseViewListener drawMouseViewListener = new DrawMouseViewListener(this);
+			mapControl.addBehavior("drawPolygonROI", new Behavior[] {
+					new PolygonBehavior(drawMouseViewListener),
+					new MouseMovementBehavior(sbl) });
+			mapControl.addBehavior("drawLineROI", new Behavior[] {
+					new PolylineBehavior(drawMouseViewListener),
+					new MouseMovementBehavior(sbl) });
+			mapControl.addBehavior("drawPointROI", new Behavior[] {
+					new PointBehavior(drawMouseViewListener),
+					new MouseMovementBehavior(sbl) });
+		}
+
+		try {
+			roiFeatureManager = new ROIFeatureManager(fLayer.getMetadataID().toString());
+		} catch (MetadataException e) {
+			throw new GridException("Can't create ROI",e); 
+		}
+		clearROIs();
+		loadROIs();
+	}
+	
+	/**
+	 * Elimina todas las filas de la tabla de rois as� como la ROI y objetos
+	 * FGraphic asociados (borr�ndolos tambi�n de la vista) a cada una.
+	 * 
+	 */
+	public void clearROIs() {
+		try {
+			panel.getTable().removeAllRows();
+		} catch (NotInitializeException e) {
+			RasterSwingLibrary.messageBoxError("error_tabla_rois", this, e);
+		}
+
+		boolean repaint = roiFeatureManager.clear(graphicLayer);
+
+		if (repaint)
+			getMapControl().rePaintDirtyLayers();
+		getRois().clear();
+	}
+	
+	private LinkedHashMap<String, ROI> getRois() {
+		if (rois == null)
+			rois = new LinkedHashMap<String, ROI>();
+		return rois;
+	}
+	
+	/**
+	 * Cargar las ROIs asociadas a la capa, si las hay.
+	 * 
+	 * @throws GridException
+	 * 
+	 */
+	private void loadROIs() throws GridException {
+		List<ROI> roisArray = null;
+		try {
+			roisArray = ((FLyrRaster) fLayer).getRois();
+		} catch (ROIException e) {
+			RasterSwingLibrary.messageBoxError("problems_loading_rois", this, e);
+		}
+		loadROIs(roisArray);
+	}
+
+	@SuppressWarnings("deprecation")
+	private void loadROIs(List<ROI> roisArray) throws GridException {
+		if (roisArray != null) {
+			ISymbol symbol = null;
+			int nPoints, nPolygons, nLines;
+
+			FeatureStore store = graphicLayer.getFeatureStore();
+			try {
+				store.edit();
+
+				for (Iterator<ROI> iter = roisArray.iterator(); iter.hasNext();) {
+					ROI roi = (ROI) iter.next();
+
+					nPoints = 0;
+					nPolygons = 0;
+					nLines = 0;
+
+					Object row[] = ((IModel) panel.getTable().getModel()).getNewLine();
+					row[0] = roi.getName();
+					row[4] = roi.getColor();
+
+					addROI(roi);
+					VectorialROI vectorialROI = (VectorialROI) roi;
+					for (Iterator<Geometry> iterator = vectorialROI.getGeometries().iterator(); iterator.hasNext();) {
+						Geometry geometry = (Geometry) iterator.next();
+						symbol = mapContextManager.getSymbolManager().createSymbol(geometry.getType(), roi.getColor());
+						switch (geometry.getType()) {
+						case Geometry.TYPES.POINT:
+							nPoints++;
+							break;
+						case Geometry.TYPES.SURFACE:
+							nPolygons++;
+							break;
+						case Geometry.TYPES.CURVE:
+							nLines++;
+							break;
+						}
+						EditableFeature feature = roiFeatureManager.addROIFeature(vectorialROI, graphicLayer, geometry, symbol);
+
+						store.insert(feature);
+					}
+					row[1] = new Integer(nPolygons);
+					row[2] = new Integer(nLines);
+					row[3] = new Integer(nPoints);
+					((DefaultTableModel)panel.getTable().getModel()).addRow(row);
+				}
+				store.finishEditing();
+			} catch (DataException e) {
+				throw new GridException("Error loading ROIs from layer " + fLayer.getName(), e);
+			}
+			selectDrawRoiTool();
+			getMapControl().drawGraphics();
+		}
+	}
+	
+	public void addROI(ROI roi) {
+		getRois().put(roi.getName(), roi);
+	}
+	
+	public void selectDrawRoiTool() {
+		if (mapControl != null)
+			if (panel.getButton(ROIPanel.POLYGON_BUTTON).isSelected()) {
+				Image img = IconThemeHelper.getImageIcon("polygon-cursor").getImage();
+				curImage = img;
+				mapControl.setTool("drawPolygonROI");
+			} else if (panel.getButton(ROIPanel.LINE_BUTTON).isSelected()) {
+				Image img = IconThemeHelper.getImageIcon("line-cursor").getImage();
+				curImage = img;
+				mapControl.setTool("drawLineROI");
+			} else if (panel.getButton(ROIPanel.POINT_BUTTON).isSelected()) {
+				Image img = IconThemeHelper.getImageIcon("point-cursor").getImage();
+				curImage = img;
+				mapControl.setTool("drawPointROI");
+			}
+	}
+
+	public void changeRoiName(String currentName, String newName)
+	throws DataException {
+		getROI(currentName).setName(newName);
+		getRois().put(newName, getRois().remove(currentName));
+		roiFeatureManager.changeROIName(currentName, newName, graphicLayer);
+	}
+
+	/**
+	 * Elimina la ROI correspondiente al nombre <code>roiName</code> as� como
+	 * sus objetos FGraphic asociados (borr�ndolos tambi�n de la vista). (NO
+	 * elimina la fila correspondiente en la tabla del panel).
+	 * 
+	 * @param roiName
+	 *            Nombre de la ROI a eliminar.
+	 */
+	public void removeROI(String roiName) {
+		getRois().remove(roiName);
+		boolean repaint = roiFeatureManager.removeROI(roiName, graphicLayer);
+		if (repaint) {
+			getMapControl().rePaintDirtyLayers();
+		}
+	}
+	
+	/**
+	 * Borra de capa GraphicsLayer de mapContext los gr�ficos pertenecientes a
+	 * las rois del panel. Si la GraphicsLayer se queda sin gr�ficos se eliminan
+	 * tambien los s�mbolos de esta.
+	 */
+	public void clearRoiGraphics() {
+		roiFeatureManager.clearFeaturesFromGraphicLayer(graphicLayer);
+	}
+
+	public MapControl getMapControl() {
+		return mapControl;
+	}
+	
+	public TableContainer getTable() {
+		return panel.getTable();
+	}
+	
+	public ROI getROI(String roiName) {
+		return (ROI) getRois().get(roiName);
+	}
+	
+	public GraphicLayer getGraphicLayer() {
+		return graphicLayer;
+	}
+	
+	public void setPreviousTool() {
+		if (previousTool != null)
+			getMapControl().setTool(previousTool);
+	}
+	
+	public List<ROI> getROIs() {
+		return new ArrayList<ROI>(getRois().values());
+	}
+	
+	public void setROIs(List<ROI> roisArray) throws GridException {
+		loadROIs(roisArray);
+	}
+	
+	public FLayer getFLayer() {
+		return fLayer;
+	}
+	
+	public ROIFeatureManager getRoiFeatureManager() {
+		return roiFeatureManager;
+	}
+	
+	public Image getToolImage() {
+		return curImage;
+	}
+	
+	public void setROIFile(File file) {
+		this.roiFile = file;
+	}
+	
+	public File getROIFile() {
+		return this.roiFile;
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ROIDataModel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ui/ROIWindow.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ui/ROIWindow.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ui/ROIWindow.java	(revision 8183)
@@ -0,0 +1,93 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2011-2012 Prodevelop S.L
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.app.basic.tool.roi.ui;
+
+import java.awt.BorderLayout;
+
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.andami.ui.mdiManager.IWindowListener;
+import org.gvsig.andami.ui.mdiManager.WindowInfo;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ROIWindow extends JPanel implements IWindow, IWindowListener {
+    
+    private static final long serialVersionUID = -4401123724140025094L;
+
+    private WindowInfo info;
+
+    private Object profile = WindowInfo.EDITOR_PROFILE;
+
+	private IWindowListener listener;
+
+    public ROIWindow(JComponent panel, String title, int w, int h) {
+        this.setLayout(new BorderLayout());
+        add(panel, BorderLayout.CENTER);
+
+        info = new WindowInfo(WindowInfo.PALETTE | WindowInfo.RESIZABLE);
+        info.setTitle(title);
+        info.setWidth(w);
+        info.setHeight(h);
+    }
+    
+    public void addIWindowListener(IWindowListener listener) {
+    	this.listener = listener;
+    }
+
+    public WindowInfo getWindowInfo() {
+        return info;
+    }
+
+    public Object getWindowProfile() {
+        return profile;
+    }
+    
+    public void close() {
+		try {
+			PluginServices.getMDIManager().closeWindow(this);
+			IWindow[] list = PluginServices.getMDIManager().getAllWindows();
+			for (int i = 0; i < list.length; i++) {
+				if(list[i] instanceof AbstractViewPanel) {
+					((AbstractViewPanel)list[i]).getMapControl().getMapContext().invalidate();
+				}
+			}
+		} catch (ArrayIndexOutOfBoundsException e) {
+			//Si la ventana no se puede eliminar no hacemos nada
+		}
+	}
+
+	public void windowActivated() {
+		if(listener != null)
+			listener.windowActivated();
+	}
+
+	public void windowClosed() {
+		if(listener != null)
+			listener.windowClosed();
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ui/ROIWindow.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ui/listener/DrawMouseViewListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ui/listener/DrawMouseViewListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ui/listener/DrawMouseViewListener.java	(revision 8183)
@@ -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.tools.app.basic.tool.roi.ui.listener;
+
+import java.awt.Color;
+import java.awt.Image;
+import java.awt.geom.Point2D;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.primitive.GeneralPathX;
+import org.gvsig.fmap.mapcontext.MapContextLocator;
+import org.gvsig.fmap.mapcontext.layers.vectorial.GraphicLayer;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolManager;
+import org.gvsig.fmap.mapcontrol.tools.BehaviorException;
+import org.gvsig.fmap.mapcontrol.tools.Events.MeasureEvent;
+import org.gvsig.fmap.mapcontrol.tools.Events.PointEvent;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.PointListener;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.PolylineListener;
+import org.gvsig.gui.beans.table.exceptions.NotInitializeException;
+import org.gvsig.raster.roi.VectorialROI;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.swing.roi.ROIPanel;
+import org.gvsig.raster.tools.app.basic.tool.roi.ROIDataModel;
+import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IFillSymbol;
+import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.ILineSymbol;
+import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.IMarkerSymbol;
+import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.SimpleMarkerSymbol;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("deprecation")
+public class DrawMouseViewListener implements PolylineListener, PointListener {
+	private static final GeometryManager	geomManager     = GeometryLocator.getGeometryManager();
+	private static final Logger 			logger 		    = LoggerFactory.getLogger(DrawMouseViewListener.class);
+	private ROIDataModel 					roiDataModel 	= null;
+	private VectorialROI 					roi 		    = null;
+	private SymbolManager                   symbolManager   = MapContextLocator.getSymbolManager();
+
+	public DrawMouseViewListener(ROIDataModel roiManagerPanel) {
+		this.roiDataModel = roiManagerPanel;
+	}
+
+	public void pointFixed(MeasureEvent event) throws BehaviorException {
+
+	}
+
+	public void points(MeasureEvent event) throws BehaviorException {
+
+	}
+
+	public void polylineFinished(MeasureEvent event) throws BehaviorException {
+		GeneralPathX gp = event.getGP();
+		Geometry geometry = null;
+		try{
+			if (roiDataModel.getMapControl().getCurrentTool().equals("drawPolygonROI"))
+				geometry = geomManager.createSurface(gp, SUBTYPES.GEOM2D);
+			else
+				geometry = geomManager.createCurve(gp, SUBTYPES.GEOM2D);
+		} catch(CreateGeometryException e) {
+			logger.error("Error creating the envelope", e);
+		}
+		String roiName = "";
+
+		int selectedRow;
+		try {
+			selectedRow = roiDataModel.getTable().getSelectedRow();
+			roiName = (String)roiDataModel.getTable().getModel().getValueAt(selectedRow,0);
+			roi = (VectorialROI)roiDataModel.getROI(roiName);
+			if(roi == null) {
+				RasterSwingLibrary.messageBoxError("error_roi_not_selected", roiDataModel, new NullPointerException("ROI no seleccionada DrawMouseViewListener L 61"));
+				return;
+			}
+			roi.addGeometry(geometry);
+			roi.setID(System.currentTimeMillis());
+			int numGeometries;
+
+			ISymbol sym = null;
+			Color geometryColor = (Color)roiDataModel.getTable().getModel().getValueAt(selectedRow, 4);
+
+			if(roiDataModel.getROIPanel().getButton(ROIPanel.POLYGON_BUTTON).isSelected()){
+				numGeometries = ((Integer)roiDataModel.getTable().getModel().getValueAt(selectedRow,1)).intValue();
+				roiDataModel.getTable().getModel().setValueAt(new Integer(numGeometries+1), selectedRow, 1);
+				sym = symbolManager.createSymbol(IFillSymbol.SYMBOL_NAME, geometryColor);
+			}
+			else{
+				numGeometries = ((Integer)roiDataModel.getTable().getModel().getValueAt(selectedRow,2)).intValue();
+				roiDataModel.getTable().getModel().setValueAt(new Integer(numGeometries+1), selectedRow, 2);
+				sym = symbolManager.createSymbol(ILineSymbol.SYMBOL_NAME, geometryColor);
+			}
+
+			GraphicLayer graphicLayer = roiDataModel.getGraphicLayer();
+
+			FeatureStore store = graphicLayer.getFeatureStore();
+			if(!store.isEditing())
+				store.edit();
+			EditableFeature feature = roiDataModel.getRoiFeatureManager().addROIFeature(roi, graphicLayer, geometry, sym);
+			store.insert(feature);
+
+//			FGraphic fGraphic = new FGraphic(geometry,graphicLayer.addSymbol(sym));
+//			graphicLayer.addGraphic(fGraphic);
+//			tablePanel.getRoiGraphics(roiName).add(fGraphic);
+			roiDataModel.getMapControl().drawGraphics();
+		} catch (NotInitializeException e) {
+			RasterSwingLibrary.messageBoxError("error_tabla_rois", roiDataModel, e);
+		} catch (DataException e) {
+			RasterSwingLibrary.messageBoxError("error_tabla_rois", roiDataModel, e);
+		}
+
+	}
+
+	public boolean cancelDrawing() {
+		return true;
+	}
+
+	public Image getImageCursor() {
+		return roiDataModel.getToolImage();
+	}
+
+	public void point(PointEvent event) throws BehaviorException {
+		Point2D point = event.getPoint();
+		Point2D p= roiDataModel.getMapControl().getViewPort().toMapPoint(point);
+		Geometry geometry = null;
+		try {
+			geometry = geomManager.createPoint(p.getX(), p.getY(), SUBTYPES.GEOM2D);
+		} catch (CreateGeometryException e1) {
+			logger.error("Error creating a point", e1);
+		}
+		String roiName = "";
+		int selectedRow;
+		try {
+			selectedRow = roiDataModel.getTable().getSelectedRow();
+			roiName = (String)roiDataModel.getTable().getModel().getValueAt(selectedRow,0);
+			roi = (VectorialROI)roiDataModel.getROI(roiName);
+			roi.addGeometry(geometry);
+			int numPoints = ((Integer)roiDataModel.getTable().getModel().getValueAt(selectedRow,3)).intValue();
+			roiDataModel.getTable().getModel().setValueAt(new Integer(numPoints+1), selectedRow, 3);
+			//tablePanel.getTable().getModel().setValueAt(new Integer(roi.getValues()), selectedRow, 5);
+
+			Color geometryColor = (Color)roiDataModel.getTable().getModel().getValueAt(selectedRow, 4);
+			ISymbol sym =
+					symbolManager.createSymbol(
+					IMarkerSymbol.SYMBOL_NAME, geometryColor);
+			((SimpleMarkerSymbol)sym).setStyle(SimpleMarkerSymbol.CIRCLE_STYLE);
+
+			GraphicLayer graphicLayer = roiDataModel.getGraphicLayer();
+
+			FeatureStore store = graphicLayer.getFeatureStore();
+			if(!store.isEditing())
+				store.edit();
+			EditableFeature feature = roiDataModel.getRoiFeatureManager()
+					.addROIFeature(roi, graphicLayer, geometry, sym);
+			store.insert(feature);
+			
+//			FGraphic fGraphic = new FGraphic(geometry,graphicLayer.addSymbol(sym));
+//			tablePanel.getMapControl().getMapContext().getGraphicsLayer().addGraphic(fGraphic);
+//			tablePanel.getRoiGraphics(roiName).add(fGraphic);
+			roiDataModel.getMapControl().drawGraphics();
+		} catch (NotInitializeException e) {
+			RasterSwingLibrary.messageBoxError("error_tabla_rois", roiDataModel, e);
+		} catch (DataException e) {
+			RasterSwingLibrary.messageBoxError("error_tabla_rois", roiDataModel, e);
+		}
+	}
+
+	public void pointDoubleClick(PointEvent event) throws BehaviorException {
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ui/listener/DrawMouseViewListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ui/listener/ROIsTablePanelListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ui/listener/ROIsTablePanelListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ui/listener/ROIsTablePanelListener.java	(revision 8183)
@@ -0,0 +1,340 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.app.basic.tool.roi.ui.listener;
+
+import java.awt.Color;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.util.List;
+
+import javax.swing.JFileChooser;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.filechooser.FileFilter;
+import javax.swing.table.DefaultTableModel;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.app.ApplicationLocator;
+import org.gvsig.app.project.documents.Document;
+import org.gvsig.app.project.documents.view.BaseViewDocument;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.exception.FileNotExistsException;
+import org.gvsig.fmap.dal.coverage.exception.GridException;
+import org.gvsig.fmap.dal.coverage.exception.ROIException;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters;
+import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
+import org.gvsig.gui.beans.table.exceptions.NotInitializeException;
+import org.gvsig.gui.beans.table.models.IModel;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.roi.ROI;
+import org.gvsig.raster.roi.ROIReader;
+import org.gvsig.raster.roi.ROIWriter;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.swing.roi.ROIPanel;
+import org.gvsig.raster.tools.app.basic.tool.roi.ROIDataModel;
+import org.gvsig.raster.tools.app.basic.tool.roi.ROIDataModel.LayerElement;
+import org.gvsig.raster.tools.app.basic.tool.roi.ROIFeatureManager;
+import org.gvsig.raster.tools.app.basic.tool.roi.ui.ROIWindow;
+
+/**
+ * Listener para el panel ROIsTablePanel
+ *
+ * @author Diego Guerrero Sevilla (diego.guerrero@uclm.es)
+ *
+ */
+public class ROIsTablePanelListener implements ButtonsPanelListener, ActionListener, ListSelectionListener, TableModelListener {
+	private ROIPanel       panel              = null;
+	private ROIDataModel   dataModel          = null;
+	private String 		   roiSelectedName    = "";
+	private ROIWindow      window             = null;
+	private File           lastDirectory      = null;
+	private String         defaultROIFileName = null;
+
+	public ROIsTablePanelListener(
+			ROIPanel panel, 
+			ROIDataModel dataModel,
+			ROIWindow window) {
+		this.panel = panel;
+		this.dataModel = dataModel;
+		this.window = window;
+	}
+	
+	public void setDefaultROIFileName(String defaultROIFileName) {
+		this.defaultROIFileName = defaultROIFileName;
+	}
+	
+	public void setPathToROI(File ROI) {
+		this.lastDirectory = ROI;
+	}
+	
+	public void actionButtonPressed(ButtonsPanelEvent e) {
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if (e.getSource() == panel.getButton(ROIPanel.NEW_BUTTON)) {
+			String roiName;
+			try {
+				roiName = "ROI-" + String.valueOf(System.currentTimeMillis());
+				Object row [] = ((IModel)panel.getTable().getModel()).getNewLine();
+				row[0]= roiName;
+				((DefaultTableModel)panel.getTable().getModel()).addRow(row);
+				
+				ROI roi = RasterLocator.getManager().createVectorialROI(dataModel.getRasterDataStore());
+				roi.setName(roiName);
+				roi.setColor((Color)row[4]);
+				dataModel.addROI(roi);
+				
+				panel.getTable().setSelectedIndex(panel.getTable().getRowCount()-1);
+				dataModel.selectDrawRoiTool();
+				panel.setToolsEnabled(true);
+			} catch (NotInitializeException e1) {
+				RasterSwingLibrary.messageBoxError("error_tabla_rois", panel, e1);
+				window.close();
+			}
+		} else if (e.getSource() == panel.getButton(ROIPanel.DELETE_BUTTON)) {
+			try {
+				if (panel.getTable().getSelectedRows().length > 0) {
+					String className = (String)panel.getTable().getModel().getValueAt(panel.getTable().getSelectedRow(),0);
+					dataModel.removeROI(className);
+					int selectedRow = panel.getTable().getSelectedRow();
+					((DefaultTableModel)panel.getTable().getModel()).removeRow(selectedRow);
+					selectedRow = selectedRow >= panel.getTable().getRowCount() ? panel.getTable().getRowCount() - 1 : selectedRow; 
+					panel.getTable().setSelectedIndex(selectedRow);
+				}
+			} catch (NotInitializeException e1) {
+				RasterSwingLibrary.messageBoxError("error_tabla_rois", panel, e1);
+				window.close();
+			}
+		} else if (e.getSource() == panel.getButton(ROIPanel.POINT_BUTTON)) {
+			panel.getButton(ROIPanel.POINT_BUTTON).setSelected(true);
+			panel.getButton(ROIPanel.LINE_BUTTON).setSelected(false);
+			panel.getButton(ROIPanel.POLYGON_BUTTON).setSelected(false);
+			dataModel.selectDrawRoiTool();
+		} else if (e.getSource() == panel.getButton(ROIPanel.LINE_BUTTON)) {
+			panel.getButton(ROIPanel.LINE_BUTTON).setSelected(true);
+			panel.getButton(ROIPanel.POINT_BUTTON).setSelected(false);
+			panel.getButton(ROIPanel.POLYGON_BUTTON).setSelected(false);
+			dataModel.selectDrawRoiTool();
+		} else if (e.getSource() == panel.getButton(ROIPanel.POLYGON_BUTTON)) {
+			panel.getButton(ROIPanel.POLYGON_BUTTON).setSelected(true);
+			panel.getButton(ROIPanel.LINE_BUTTON).setSelected(false);
+			panel.getButton(ROIPanel.POINT_BUTTON).setSelected(false);
+			dataModel.selectDrawRoiTool();
+		} else if (e.getSource() == panel.getButton(ROIPanel.EXPORT_BUTTON)) {
+			showChooserDialog(ROIPanel.EXPORT_BUTTON);
+		} else if (e.getSource() == panel.getButton(ROIPanel.IMPORT_BUTTON)) {
+			showChooserDialog(ROIPanel.IMPORT_BUTTON);
+		} else if (e.getSource() == panel.getButton(ROIPanel.REMOVE_ROI_FILE_BUTTON)) {
+			if(RasterSwingLibrary.messageBoxYesOrNot("remove_roi_file_link", null)) {
+				dataModel.clearROIs();
+				removeLinkBetweenFileROIAndLayer();
+			}
+		} else if (e.getSource() == panel.getButton(ROIPanel.ADDFLYR_BUTTON)) {
+			Object obj = panel.getLayerList(ROIPanel.FLYRS_COMBO).getSelectedItem();
+			if(obj instanceof LayerElement) {
+				FLyrVect lyrVect = ((LayerElement)obj).getLayer();
+				ROIReader reader = null;
+				try {
+					reader = RasterLocator.getManager().createVectorialROIReader(
+							lyrVect.getFeatureStore(), 
+							dataModel.getRasterDataStore(), 
+							getProjectionFromLayer());
+
+					List<ROI> rois = reader.read(dataModel.getROIs());
+					dataModel.clearROIs();
+					dataModel.setROIs(rois);
+					
+					DataStoreParameters params = lyrVect.getDataStore().getParameters();
+					if(params instanceof FilesystemStoreParameters)
+						dataModel.setROIFile(((FilesystemStoreParameters)params).getFile());
+				} catch (ROIException e1) {
+					RasterSwingLibrary.messageBoxError("error_file_not_valid", panel, e1);
+				} catch (GridException e1) {
+					RasterSwingLibrary.messageBoxError("error_file_not_valid", panel, e1);
+				}
+			}
+		}
+	}
+	
+	private void removeLinkBetweenFileROIAndLayer() {
+		try {
+			((FLyrRaster)dataModel.getFLayer()).setROIsFiles(null);
+		} catch (RmfSerializerException e) {
+			RasterSwingLibrary.messageBoxError("error_saving_rois_rmf", panel, e);
+		}
+	}
+
+	private void showChooserDialog(int action) {
+		JFileChooser fileChooser = new JFileChooser();
+		fileChooser.removeChoosableFileFilter(fileChooser.getAcceptAllFileFilter());
+		fileChooser.addChoosableFileFilter(new ShpFileFilter());
+		fileChooser.setSelectedFile(new File(defaultROIFileName));
+		File oldROIFile = dataModel.getROIFile();
+		if(oldROIFile != null) {
+			fileChooser.setCurrentDirectory(oldROIFile);
+			fileChooser.setSelectedFile(oldROIFile);
+		} else
+			fileChooser.setCurrentDirectory(lastDirectory);
+		if(action == ROIPanel.IMPORT_BUTTON) {
+			if (fileChooser.showOpenDialog(panel.getComponent()) == JFileChooser.APPROVE_OPTION) {
+				File file = fileChooser.getSelectedFile();
+				loadROIFromFile(file);
+			}
+		}
+		if(action == ROIPanel.EXPORT_BUTTON) {
+			if (fileChooser.showSaveDialog(panel.getComponent()) == JFileChooser.APPROVE_OPTION) {
+				File file = fileChooser.getSelectedFile();
+				saveROIToFile(file);
+			}
+		}
+	}
+	
+	private void saveROIToFile(File file) {
+		lastDirectory = new File(file.getParent());
+		if(file.exists()) {
+			if(!RasterSwingLibrary.messageBoxYesOrNot("raster_error_file_exists", null))
+				return;
+		}
+		ROIWriter writer = RasterLocator.getManager().createROIWriter(
+				file.getPath(), 
+				getProjectionFromLayer());
+		writer.write(dataModel.getROIs());
+		dataModel.setROIFile(file);
+	}
+	
+	private void loadROIFromFile(File file) {
+		lastDirectory = new File(file.getParent());
+		try {
+			ROIReader reader = RasterLocator.getManager().createROIReader( 
+					file.getPath(), 
+					dataModel.getRasterDataStore(), 
+					getProjectionFromLayer());
+			dataModel.clearROIs();
+			List<ROI> rois = reader.read(dataModel.getROIs());
+			dataModel.setROIFile(file);
+			dataModel.setROIs(rois);
+		} catch (FileNotExistsException e1) {
+			RasterSwingLibrary.messageBoxError("error_file_not_found", panel, e1);
+		} catch (ROIException e1) {
+			RasterSwingLibrary.messageBoxError("problems_loading_rois", panel, e1);
+		} catch (GridException e1) {
+			RasterSwingLibrary.messageBoxError("problems_loading_rois", panel, e1);
+		} 
+	}
+	
+	/**
+	 * Gets the projection from the layer or from the view if the 
+	 * layer does not have
+	 * @return
+	 */
+	private IProjection getProjectionFromLayer() {
+		IProjection proj = dataModel.getFLayer().getProjection();
+		if(proj == null) {
+			Document doc = ApplicationLocator.getManager().getActiveDocument();
+			if(doc instanceof BaseViewDocument)
+				proj = ((BaseViewDocument)doc).getProjection();
+		}
+		return proj;
+	}
+
+	public void valueChanged(ListSelectionEvent e) {
+		try {
+			if (panel.getTable().getSelectedRows().length <= 0) {
+				panel.setToolsEnabled(false);
+				dataModel.setPreviousTool();
+			} else {
+				panel.setToolsEnabled(true);
+				dataModel.selectDrawRoiTool();
+
+				int selectedRow = panel.getTable().getSelectedRow();
+				roiSelectedName = (String)panel.getTable().getTable().getJTable().getValueAt(selectedRow,0);
+			}
+		} catch (NotInitializeException e1) {
+			RasterSwingLibrary.messageBoxError("error_rois_table", panel, e1);
+		}
+	}
+
+	@SuppressWarnings("deprecation")
+	public void tableChanged(TableModelEvent e) {
+		//Cambio de color en una ROI:
+		try {
+			if(e.getColumn() == 4) {
+				String roiName = (String)panel.getTable().getTable().getJTable().getValueAt(e.getFirstRow(),0);
+				if(dataModel.getMapControl() != null) {
+					ROIFeatureManager roiFeatureManager = dataModel.getRoiFeatureManager();
+					Color color = (Color) panel.getTable().getTable().getJTable().getValueAt(e.getFirstRow(), 4);
+					roiFeatureManager.changeColor(dataModel.getGraphicLayer(), roiName, color);
+					dataModel.getROI(roiName).setColor(color);
+					dataModel.getMapControl().drawGraphics();
+					dataModel.getMapControl().getMapContext().invalidate();
+				}
+			} else if(e.getColumn() == 0) {
+				String newName = (String)panel.getTable().getTable().getJTable().getValueAt(e.getFirstRow(),0);
+				dataModel.changeRoiName(roiSelectedName, newName);
+				roiSelectedName = newName;
+			}
+		} catch (DataException e1) {
+			RasterSwingLibrary.messageBoxError(
+					"error_getting_roi_features", panel, e1);
+		}
+	}
+}
+
+/**
+ * Filtro para el selector de expresiones matem�ticas.
+ * @author Alejandro Mu�oz (alejandro.munoz@uclm.es)
+ *
+ */
+class ShpFileFilter extends FileFilter {
+
+	final static String exp = "shp";
+	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();
+			if (exp.equals(extension)){
+				return true;
+			} else {
+				return false;
+			}
+		}
+		return false;
+	}
+
+	public String getDescription() {
+		return "Shape file .shp";
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ui/listener/ROIsTablePanelListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ui/listener/ROIPanelListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ui/listener/ROIPanelListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ui/listener/ROIPanelListener.java	(revision 8183)
@@ -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.tools.app.basic.tool.roi.ui.listener;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.andami.ui.mdiManager.IWindowListener;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
+import org.gvsig.gui.beans.table.exceptions.NotInitializeException;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.roi.ROI;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.tool.roi.ROIDataModel;
+import org.gvsig.raster.tools.app.basic.tool.roi.ui.ROIWindow;
+
+/**
+ * Listener for the main panel which manage the ROIs of a raster layer
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ROIPanelListener implements ButtonsPanelListener, IWindowListener {
+	private ROIWindow          window         = null;
+	private ROIDataModel       dataModel      = null;
+
+	public ROIPanelListener(ROIWindow window, ROIDataModel dataModel) {
+		this.window = window;
+		this.dataModel = dataModel;
+	}
+	
+	public void actionButtonPressed(ButtonsPanelEvent e) {
+		//Al pulsar Aceptar o Aplicar se ejecuta el aceptar del panel
+		if (e.getButton() == ButtonsPanel.BUTTON_APPLY || e.getButton() == ButtonsPanel.BUTTON_ACCEPT) {
+			List<ROI> rois = dataModel.getROIs();
+			((FLyrRaster)dataModel.getFLayer()).setRois(rois);
+			try {
+				if(dataModel.getROIFile() != null) {
+					List<File> fileList = new ArrayList<File>();
+					fileList.add(dataModel.getROIFile());
+					((FLyrRaster)dataModel.getFLayer()).setROIsFiles(fileList);
+				}
+			} catch (RmfSerializerException e1) {
+				RasterSwingLibrary.messageBoxError("error_saving_rois_rmf", this, e1);
+			}
+		}
+
+		// Al pulsar Cancelar la ventana se cierra y se refresca la vista
+		if (e.getButton() == ButtonsPanel.BUTTON_CANCEL) {
+			window.close();
+		}
+
+		// Al pulsar Aceptar simplemente la ventana se cierra
+		if (e.getButton() == ButtonsPanel.BUTTON_ACCEPT) {
+			window.close();
+		}
+	}
+	
+	public void windowClosed() {
+		FeatureStore graphicStore = dataModel.getGraphicLayer().getFeatureStore();
+		if(graphicStore.isEditing()) {
+			try {
+				graphicStore.finishEditing();
+			} catch (DataException e) {
+				e.printStackTrace();
+			}
+		}
+		dataModel.clearRoiGraphics();
+		dataModel.getMapControl().rePaintDirtyLayers();
+		dataModel.setPreviousTool();
+	}
+	
+	public void windowActivated() {
+		try {
+			if (dataModel.getTable().getSelectedRows().length == 1) {
+				dataModel.getROIPanel().setToolsEnabled(true);
+				dataModel.selectDrawRoiTool();
+			}
+		} catch (NotInitializeException e) {
+			RasterSwingLibrary.messageBoxError("error_tabla_rois", this, e);
+		}
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ui/listener/ROIPanelListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ui/listener
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ui
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ROIFeatureManager.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ROIFeatureManager.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ROIFeatureManager.java	(revision 8183)
@@ -0,0 +1,247 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.app.basic.tool.roi;
+
+
+import java.awt.Color;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureReference;
+import org.gvsig.fmap.dal.feature.FeatureSet;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.mapcontext.layers.vectorial.GraphicLayer;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.raster.roi.ROI;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Manages a table of ROI with its related list of Features.
+ * 
+ * @author <a href="mailto:cordinyana@gvsig.org">C�sar Ordi�ana</a>
+ */
+public class ROIFeatureManager {
+	protected static final Logger logger = LoggerFactory.getLogger(ROIFeatureManager.class);
+	private Map<String, List<FeatureReference>> roiNameToFeatureList = Collections
+			.synchronizedMap(new HashMap<String, List<FeatureReference>>());
+
+	private final String layerId;
+
+	public ROIFeatureManager(String layerId) {
+		this.layerId = layerId;
+	}
+
+	/**
+	 * Returns a read-only {@link Map} of ROI names to {@link FeatureReference}
+	 * {@link List} objects.
+	 * 
+	 * @return the roiNameToFeatureList the table of {@link FeatureReference}
+	 *         objects per {@link ROI}.
+	 */
+	public Map<String, List<FeatureReference>> getRoiNameToFeatureList() {
+		return Collections.unmodifiableMap(roiNameToFeatureList);
+	}
+
+	public EditableFeature addROIFeature(ROI roi, GraphicLayer graphicLayer,
+			Geometry geometry, ISymbol symbol) throws DataException {
+		int symbolPos = graphicLayer.addSymbol(symbol);
+		EditableFeature feature = createEditableFeature(
+				graphicLayer.getFeatureStore(), 
+				roi, 
+				geometry, 
+				symbolPos);
+
+		addROIFeature(roi, feature.getReference());
+
+		return feature;
+	}
+
+	public void addROIFeature(ROI roi, FeatureReference feature) {
+		List<FeatureReference> featureList = roiNameToFeatureList.get(roi.getName());
+
+		if (featureList == null) {
+			featureList = new ArrayList<FeatureReference>();
+			roiNameToFeatureList.put(roi.getName(), featureList);
+		}
+
+		featureList.add(feature);
+	}
+
+	public boolean clear(GraphicLayer layer) {
+		return clear(layer, false);
+	}
+
+	public void clearFeaturesFromGraphicLayer(GraphicLayer layer) {
+		clear(layer, true);
+	}
+
+	private boolean clear(GraphicLayer layer, boolean onlyRemoveFromLayer) {
+		boolean anythingCleared = false;
+		//Evita un ConcurrentModificationException ya que no se puede leer y borrar a la vez de roiNameToFeatureList
+		List<String> roiNameList = new ArrayList<String>();
+
+		for (Iterator<String> iterator = roiNameToFeatureList.keySet().iterator(); 
+			iterator.hasNext();) {
+			String roiName = iterator.next();
+			roiNameList.add(roiName);
+		}
+
+		for (int i = 0; i < roiNameList.size(); i++) {
+			String roiName = roiNameList.get(i);
+			anythingCleared = removeGraphics(layer, getROIId(roiName)) ? true : anythingCleared;
+			if(onlyRemoveFromLayer)
+				roiNameToFeatureList.remove(roiName);
+		}
+
+		return anythingCleared;
+	}
+
+	public boolean removeROI(String roiName, GraphicLayer layer) {
+		removeGraphics(layer, getROIId(roiName));
+		return roiNameToFeatureList.remove(roiName) != null;
+	}
+	
+	public void changeColor(GraphicLayer lyr, String roiName, Color color) {
+		DisposableIterator iterator = null;
+		FeatureSet featureSet = null;
+		FeatureStore store = lyr.getFeatureStore();
+		try{
+			store.beginComplexNotification();
+			if (!store.isEditing()){
+				store.edit();
+			}
+			featureSet = store.getFeatureSet();
+			for (iterator = featureSet.fastIterator(); iterator.hasNext();) {
+				Feature feature = (Feature) iterator.next();
+				Object obj = feature.get(GraphicLayer.FEATURE_ATTR_GROUPID);
+				if (obj instanceof String && ((String)obj).equals(getROIId(roiName))) {
+					int symbolPos = feature.getInt(GraphicLayer.FEATURE_ATTR_IDSYMBOL);
+					ISymbol symbol = lyr.getSymbol(symbolPos);
+					symbol.setColor(color);
+				}
+			}
+			store.finishEditing();
+			store.endComplexNotification();
+		} catch (DataException e) {
+			logger.error("Error clearing all the geometry of the graphic layer", e);
+		} finally {
+			if (featureSet != null) {
+				featureSet.dispose();
+			}
+			if (iterator != null) {
+				iterator.dispose();
+			}
+		}
+	}
+	
+	public boolean removeGraphics(GraphicLayer lyr, String prefix) {
+		boolean anythingCleared = false;
+		DisposableIterator iterator = null;
+		FeatureSet featureSet = null;
+		FeatureStore store = lyr.getFeatureStore();
+		try{
+			//List<Feature> list = new ArrayList<Feature>();
+			store.beginComplexNotification();
+			if (!store.isEditing()){
+				store.edit();
+			}
+			featureSet = store.getFeatureSet();
+			for (iterator = featureSet.fastIterator(); iterator.hasNext();) {
+				Feature feature = (Feature) iterator.next();
+				Object obj = feature.get(GraphicLayer.FEATURE_ATTR_GROUPID);
+				if (obj instanceof String && ((String)obj).startsWith(prefix)) {
+					//list.add(feature.getCopy());
+					anythingCleared = true;
+					iterator.remove();
+					//featureSet.delete(feature); //ConcurrentModificationException!!! Lo a�ado a una lista para eliminarlo posteriormente
+				}
+			}
+			/*anythingCleared = list.size() > 0;
+			for (int i = 0; i < list.size(); i++) {
+				store.delete(list.get(i));
+			}*/
+			store.finishEditing();
+			store.endComplexNotification();
+		} catch (DataException e) {
+			logger.error("Error clearing all the geometry of the graphic layer", e);
+		} finally {
+			if (featureSet != null) {
+				featureSet.dispose();
+			}
+			if (iterator != null) {
+				iterator.dispose();
+			}
+		}
+		return anythingCleared;
+	}
+	
+	public String getROIId(String roiName) {
+		return getROIPrefix().concat(roiName);
+	}
+	
+	private String getROIPrefix() {
+		return layerId.concat("-");
+	}
+
+	public void changeROIName(String oldName, String newName, GraphicLayer layer)
+	throws DataException {
+		List<FeatureReference> featureList = roiNameToFeatureList.remove(oldName);
+		if (featureList != null) {
+			roiNameToFeatureList.put(newName, featureList);
+			String newroiid = getROIId(newName);
+			FeatureStore store = layer.getFeatureStore();
+			store.edit();
+			for (int i = 0; i < featureList.size(); i++) {
+				FeatureReference ref = featureList.get(i);
+				EditableFeature editable = ref.getFeature().getEditable();
+				editable.set(GraphicLayer.FEATURE_ATTR_GROUPID, newroiid);
+				store.update(editable);
+			}
+			store.finishEditing();
+		}
+	}
+
+	public List<FeatureReference> getROIFeatures(String roiName) {
+		return Collections.unmodifiableList(roiNameToFeatureList.get(roiName));
+	}
+
+	private EditableFeature createEditableFeature(FeatureStore store, ROI roi,
+			Geometry geometry, int symbolPos) throws DataException {
+
+		EditableFeature feature = store.createNewFeature();
+		feature.set(GraphicLayer.FEATURE_ATTR_GROUPID, getROIId(roi.getName()));
+		feature.setGeometry(GraphicLayer.FEATURE_ATTR_GEOMETRY, geometry);
+		feature.setInt(GraphicLayer.FEATURE_ATTR_IDSYMBOL, symbolPos);
+
+		return feature;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ROIFeatureManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ROIManagerTocMenuEntry.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ROIManagerTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ROIManagerTocMenuEntry.java	(revision 8183)
@@ -0,0 +1,220 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.app.basic.tool.roi;
+
+import java.io.File;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.Icon;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.dal.coverage.exception.GridException;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.layers.ILayerState;
+import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
+import org.gvsig.raster.swing.RasterSwingLocator;
+import org.gvsig.raster.swing.roi.ROIPanel;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.tool.roi.ui.ROIWindow;
+import org.gvsig.raster.tools.app.basic.tool.roi.ui.listener.ROIPanelListener;
+import org.gvsig.raster.tools.app.basic.tool.roi.ui.listener.ROIsTablePanelListener;
+
+/**
+ * Punto de entrada del menu del gestor de ROIs.
+ *
+ * @author Diego Guerrero Sevilla (diego.guerrero@uclm.es
+ */
+public class ROIManagerTocMenuEntry extends AbstractTocContextMenuAction implements IGenericToolBarMenuItem {
+	static private ROIManagerTocMenuEntry singleton  = null;
+
+	/**
+	 * Nadie puede crear una instancia a esta clase �nica, hay que usar el
+	 * getSingleton()
+	 */
+	private ROIManagerTocMenuEntry() {}
+
+	/**
+	 * Devuelve un objeto unico a dicha clase
+	 * @return
+	 */
+	static public ROIManagerTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new ROIManagerTocMenuEntry();
+		return singleton;
+	}
+
+	public String getGroup() {
+		return "RasterLayer";
+	}
+
+	public int getGroupOrder() {
+		return 10;
+	}
+
+	public int getOrder() {
+		return 60;
+	}
+
+	public String getText() {
+		return RasterToolsUtil.getText(this, "regiones_interes");
+	}
+
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof ILayerState))
+			return false;
+
+		if (!((ILayerState) selectedItems[0]).isOpen())
+			return false;
+
+		return true;
+	}
+
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof FLyrRaster))
+			return false;
+
+		return true;
+	}
+
+	public void execute(ITocItem item, FLayer[] selectedItems) {
+		FLayer fLayer = null;
+
+		if (selectedItems.length != 1)
+			return;
+
+		fLayer = selectedItems[0];
+
+		if (!(fLayer instanceof FLyrRaster))
+			return;
+
+
+		ROIPanel panel = RasterSwingLocator.getSwingManager().createROIPanel();
+		ROIDataModel dataModel = new ROIDataModel(getLFLyrVects());
+		dataModel.setROIPanel(panel);
+		ROIWindow window = new ROIWindow(panel.getComponent(), "ROI", 500, 265);
+		try {
+			dataModel.setLayer(selectedItems[0]);
+		} catch (GridException e) {
+
+		}
+
+		ROIPanelListener panelListener = new ROIPanelListener(window, dataModel);
+		ROIsTablePanelListener tableListener = new ROIsTablePanelListener(panel, dataModel, window);
+		tableListener.setPathToROI(getROIDefaultPath(fLayer));
+		tableListener.setDefaultROIFileName(getDefaultROIFileName(fLayer));
+
+		panel.addButtonsListener(tableListener, panelListener);
+		panel.addTableListeners(tableListener, tableListener);
+		window.addIWindowListener(panelListener);
+
+		RasterToolsUtil.addWindow(window);
+	}
+
+	private String getDefaultROIFileName(FLayer fLayer) {
+		return fLayer.getName() + "_ROI.shp";
+	}
+
+	private File getROIDefaultPath(FLayer layer) {
+		File path = getROIPathFromLayer(layer);
+		if(path != null)
+			return path;
+		else
+			return getPathFromLayer(layer);
+	}
+
+	/**
+	 * Gets the path of the first provider
+	 * @param layer
+	 * @return
+	 */
+	private File getPathFromLayer(FLayer layer) {
+		if(!(layer instanceof FLyrRaster))
+			return null;
+		URI[] uriList = ((FLyrRaster)layer).getDataStore().getURIByProvider();
+		if(uriList != null && uriList.length > 0) {
+		    URI uri = uriList[0];
+		    if("FILE".equalsIgnoreCase(uri.getScheme())){
+		        return new File(uri).getParentFile();
+		    }
+		}
+		return null;
+	}
+
+	/**
+	 * Gets the path of the first ROI file
+	 * @param layer
+	 * @return
+	 */
+	private File getROIPathFromLayer(FLayer layer) {
+		if(!(layer instanceof FLyrRaster))
+			return null;
+		List<File> uriList = ((FLyrRaster)layer).getDataStore().getROIFileListFromRmf();
+		if(uriList != null && uriList.size() > 0) {
+			String path = uriList.get(0).getAbsolutePath();
+			String uri = path.substring(0, path.lastIndexOf(File.separator));
+			if(uri != null)
+				return new File(uri);
+		}
+		return null;
+	}
+
+
+	/**
+	 * Gets the list of vectorial layers loaded in all views
+	 * @return
+	 */
+	public List<FLyrVect> getLFLyrVects() {
+		List<FLyrVect> list = new ArrayList<FLyrVect>();
+		IWindow[] w = PluginServices.getMDIManager().getAllWindows();
+		for (int i = 0; i < w.length; i++) {
+			if(w[i] instanceof AbstractViewPanel) {
+				FLayers lys = ((AbstractViewPanel)w[i]).getMapControl().getMapContext().getLayers();
+				for (int j = 0; j < lys.getLayersCount(); j++) {
+					if(lys.getLayer(j) instanceof FLyrVect)
+						list.add((FLyrVect)lys.getLayer(j));
+				}
+			}
+		}
+		return list;
+	}
+
+	public Icon getIcon() {
+		return IconThemeHelper.getImageIcon("layer-modify-roi");
+	}
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi/ROIManagerTocMenuEntry.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/roi
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/pixelincrease/PixelIncreaseBehavior.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/pixelincrease/PixelIncreaseBehavior.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/pixelincrease/PixelIncreaseBehavior.java	(revision 8183)
@@ -0,0 +1,85 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.pixelincrease;
+
+import java.awt.event.MouseEvent;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.fmap.mapcontrol.tools.BehaviorException;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener;
+import org.gvsig.raster.swing.pixelinspector.PixelInspector;
+
+
+/**
+ * Behavior para que se a�ada a los Behavior del Mapcontrol y poder
+ * gestionar el evento de mover el rat�n sobre la vista de gvSIG.
+ *
+ * 12-may-2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class PixelIncreaseBehavior extends Behavior {
+
+	private PixelInspector observer = null;
+	
+	/**
+	 * Constructor. Asigna el dialogo
+	 * @param dialog
+	 */
+	public PixelIncreaseBehavior(PixelInspector observer) {
+		this.observer = observer;
+	}
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.IBehavior#getListener()
+	 */
+	public ToolListener getListener() {
+		return null;
+	}
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.IBehavior#mouseMoved(java.awt.event.MouseEvent)
+	 */
+	public void mouseMoved(MouseEvent e) throws BehaviorException {
+		IWindow active = PluginServices.getMDIManager().getActiveWindow();
+		if(active instanceof AbstractViewPanel) {
+			//System.out.println(((IView)active).getMapControl().getX() + " " + ((IView)active).getMapControl().getWidth());
+			//System.out.println(((IView)active).getMapControl().getY() + " " + ((IView)active).getMapControl().getHeight());
+			observer.setClear(false);
+			observer.setDataBuffer(((AbstractViewPanel)active).getMapControl().getImage());
+			//Calcula la posici�n donde se empezar� a dibujar en el componente. Para ello en ancho y el alto del componente
+			//se ponen en la misma escala que la vista (w / scale), se calcula el punto medio del componente y se le resta el punto seleccionado
+			//en la vista
+			int pX = ((observer.getWidth() / observer.getScale()) >> 1) - e.getX();
+			int pY = ((observer.getHeight() / observer.getScale()) >> 1) - e.getY();
+			observer.setViewCoordinates((int)e.getPoint().getX(), (int)e.getPoint().getY());
+			observer.setPosX(pX);
+			observer.setPosY(pY);
+			observer.repaint();
+		}	
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/pixelincrease/PixelIncreaseBehavior.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/pixelincrease/PixelIncreaseDialog.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/pixelincrease/PixelIncreaseDialog.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/pixelincrease/PixelIncreaseDialog.java	(revision 8183)
@@ -0,0 +1,393 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.pixelincrease;
+
+import java.awt.BorderLayout;
+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 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.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.andami.ui.mdiManager.WindowInfo;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.fmap.mapcontrol.tools.CompoundBehavior;
+import org.gvsig.raster.swing.pixelinspector.PixelInspector;
+
+
+
+/**
+ * Panel del zoom de la vista sobre el cursor.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class PixelIncreaseDialog extends JPanel implements IWindow, MouseListener, PixelInspector {
+    final private static long      serialVersionUID = -3370601314380922368L;
+    private JPopupMenu             menu = null;
+    /**
+     * Ancho y alto de la ventana
+     */
+    private int                    width = 170;
+    private int                    height = 170;
+    /**
+     * 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 WindowInfo 				m_viewinfo = null;
+    private boolean					clear = false;
+    private Color					color = Color.red;
+    private JCheckBoxMenuItem[] 	entry = new JCheckBoxMenuItem[6];
+    
+	/**
+	 * Constructor de la ventana de dialogo para gvSIG.
+	 */
+	public PixelIncreaseDialog() {
+		BorderLayout layout = new BorderLayout();
+		setLayout(layout);
+		setSize(width, height);
+		addMouseListener(this);
+		
+		IWindow active = PluginServices.getMDIManager().getActiveWindow();
+		if(active instanceof AbstractViewPanel) {
+			img = ((AbstractViewPanel)active).getImage();
+			WindowInfo wInfo = PluginServices.getMDIManager().getWindowInfo(active);
+			posWindowX = wInfo.getX() + wInfo.getWidth() - width;
+			posWindowY = wInfo.getY();
+		}	
+		
+		CompoundBehavior.setAllControlsBehavior(new PixelIncreaseBehavior(this));
+		initMenu();
+		
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.tools.app.basic.tool.pixelincrease.PixelInspector#setViewCoordinates(int, int)
+	 */
+	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(PluginServices.getText(this, "green")) == 0) {
+					color = Color.GREEN;
+					entry[4].setSelected(false);
+					entry[5].setSelected(true);
+				}
+				if(txt.compareTo(PluginServices.getText(this, "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( PluginServices.getText(this, "red") );
+	    entry[4].addActionListener( al );
+	    entry[4].setSelected(true);
+	    menu.add(entry[4]);
+	    entry[5] = new JCheckBoxMenuItem( PluginServices.getText(this, "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);
+		}
+	}
+
+	/**
+	 * @see com.iver.mdiApp.ui.MDIManager.IWindow#getWindowInfo()
+	 */
+	public WindowInfo getWindowInfo() {
+		m_viewinfo = new WindowInfo(WindowInfo.MODELESSDIALOG);
+    	m_viewinfo.setTitle(PluginServices.getText(this, "increase"));
+    	m_viewinfo.setX(posWindowX);
+    	m_viewinfo.setY(posWindowY);
+		return m_viewinfo;
+	}
+
+	/**
+	 * 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 alto del control
+	 */
+	public int getHeight() {
+		return (h == 0) ? height : h;
+	}
+
+	/**
+	 * Obtiene el ancho del control
+	 */
+	public int getWidth() {
+		return (w == 0) ? width : w;
+	}
+
+	/**
+	 * 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 view) {
+		this.img = view;
+	}
+
+	/*
+	 * (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) {
+	}
+
+	public Object getWindowProfile() {
+		return WindowInfo.PROPERTIES_PROFILE;
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/pixelincrease/PixelIncreaseDialog.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/pixelincrease
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TranspOpacitySliderPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TranspOpacitySliderPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TranspOpacitySliderPanel.java	(revision 8183)
@@ -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.tools.app.basic.tool.properties.panel;
+
+import java.awt.FlowLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.JCheckBox;
+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.andami.PluginServices;
+
+/**
+ * Panel con el slider para regular la opacidad de la capa.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TranspOpacitySliderPanel extends JPanel implements ActionListener, FocusListener, ChangeListener{
+	final private static long serialVersionUID = 0;
+	private JCheckBox         cbTransparencia  = null;
+	private JCheckBox         cbOpacidad       = null;
+	private JSlider           slOpacidad       = null;
+	private JTextField        tOpacidad        = null;
+
+	/**
+	 * Constructor.
+	 */
+	public TranspOpacitySliderPanel() {
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 * @return void
+	 */
+	private void initialize() {
+		setBorder(BorderFactory.createTitledBorder(null, PluginServices.getText(this, "opacidad"), TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));
+		setLayout(new FlowLayout());
+		add(getOpacityCheck(), null);
+		add(getOpacitySlider(), null);
+		add(getOpacityText(), null);
+	}
+
+	/**
+	 * Inicializa controles a sus valores por defecto
+	 */
+	public void initControls() {
+		this.getOpacityText().setText("100");
+		this.setActiveOpacityControl(false);
+	}
+
+	/**
+	 * This method initializes jCheckBox
+	 * @return javax.swing.JCheckBox
+	 */
+	public JCheckBox getTransparencyCheck() {
+		if (cbTransparencia == null) {
+			cbTransparencia = new JCheckBox();
+			cbTransparencia.setText(PluginServices.getText(this, "activar"));
+			cbTransparencia.addActionListener(this);
+		}
+
+		return cbTransparencia;
+	}
+
+	/**
+	 * This method initializes jCheckBox1
+	 * @return javax.swing.JCheckBox
+	 */
+	public JCheckBox getOpacityCheck() {
+		if (cbOpacidad == null) {
+			cbOpacidad = new JCheckBox();
+			cbOpacidad.setText(PluginServices.getText(this, "activar"));
+			cbOpacidad.addActionListener(this);
+			cbOpacidad.addFocusListener(this);
+		}
+
+		return cbOpacidad;
+	}
+
+	/**
+	 * This method initializes jSlider
+	 * @return javax.swing.JSlider
+	 */
+	public JSlider getOpacitySlider() {
+		if (slOpacidad == null) {
+			slOpacidad = new JSlider();
+//			 slOpacidad.setPreferredSize(new java.awt.Dimension(wSlider, 16));
+			slOpacidad.addChangeListener(this);
+		}
+
+		return slOpacidad;
+	}
+
+	/**
+	 * This method initializes jTextField3
+	 * @return javax.swing.JTextField
+	 */
+	public JTextField getOpacityText() {
+		if (tOpacidad == null) {
+			tOpacidad = new JTextField();
+			tOpacidad.setPreferredSize(new java.awt.Dimension(30, 19));
+			tOpacidad.addActionListener(this);
+			tOpacidad.addFocusListener(this);
+		}
+
+		return tOpacidad;
+	}
+
+	/**
+	 * Activa/Desactiva los controles de opacidad
+	 * @param active
+	 */
+	public void setActiveOpacityControl(boolean active) {
+		this.getOpacityCheck().setSelected(active);
+		this.getOpacitySlider().setEnabled(active);
+		this.getOpacityText().setEnabled(active);
+	}
+
+	/**
+	 * Asigna el valor de opacidad a los controles de la ventana para que cuando
+	 * esta se abra tenga los valores seleccionados en la imagen.
+	 * @param alpha
+	 */
+	public void setOpacity(int alpha) {
+		int opacityPercent = (int) ((alpha * 100) / 255);
+		this.getOpacityText().setText(String.valueOf(opacityPercent));
+		this.getOpacitySlider().setValue(opacityPercent);
+		this.setActiveOpacityControl(true);
+
+		if (opacityPercent == 100)
+			this.setActiveOpacityControl(false);
+	}
+
+	/**
+	 * Eventos sobre TextField y CheckBox. Controla eventos de checkbox de
+	 * opacidad, transparencia, recorte de colas y los textfield de opacidad,
+	 * valores de transparencia por banda y porcentaje de recorte.
+	 */
+	public void actionPerformed(ActionEvent e) {
+		// Evento sobre el checkbox de opacidad
+		if (e.getSource().equals(getOpacityCheck())) {
+			// Check de opacidad activado -> Activar controles de opacidad
+			if (getOpacityCheck().isSelected()) {
+				getOpacitySlider().setEnabled(true);
+				getOpacityText().setEnabled(true);
+			} else {
+				getOpacitySlider().setEnabled(false);
+				getOpacityText().setEnabled(false);
+			}
+		}
+
+		//Evento sobre el textfield de opacidad
+		if (e.getSource().equals(getOpacityText()))
+			checkOpacityText();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.FocusListener#focusGained(java.awt.event.FocusEvent)
+	 */
+	public void focusGained(FocusEvent e) {
+//	pTrans.updateTextBox();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.FocusListener#focusLost(java.awt.event.FocusEvent)
+	 */
+	public void focusLost(FocusEvent e) {
+		checkOpacityText();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see javax.swing.event.ChangeListener#stateChanged(javax.swing.event.ChangeEvent)
+	 */
+	public void stateChanged(ChangeEvent e) {
+		// Ponemos el valor del texto de la opacidad de pendiendo de la posici�n del
+		// Slider
+		if (e.getSource().equals(getOpacitySlider())) {
+			getOpacityText().setText(String.valueOf(getOpacitySlider().getValue()));
+		}
+	}
+
+	/**
+	 * Controla que si el formato introducido en el textfield de opacidad es
+	 * numerico se actualiza la posici�n del slider. Si es numerico pero excede
+	 * del rango 0-100 pone el valor a 0 o a 100 dependiendo de si excede por
+	 * arriba o por abajo
+	 */
+	private void checkOpacityText() {
+		String op = getOpacityText().getText();
+		int value = 0;
+
+		try {
+			if (op == null)
+				throw new NumberFormatException();
+
+			value = Integer.parseInt(op);
+
+			if (value > 100)
+				getOpacityText().setText("100");
+			else
+				if (value < 0)
+					getOpacityText().setText("0");
+
+			getOpacitySlider().setValue(value);
+		} catch (NumberFormatException exc) {
+			getOpacityText().setText("100");
+			getOpacitySlider().setValue(100);
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TranspOpacitySliderPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TranspByPixelPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TranspByPixelPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TranspByPixelPanel.java	(revision 8183)
@@ -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.tools.app.basic.tool.properties.panel;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.util.ArrayList;
+import java.util.EventObject;
+import java.util.Iterator;
+
+import javax.swing.DefaultListModel;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.ListSelectionModel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.fmap.dal.coverage.datastruct.TransparencyRange;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.tool.properties.control.TranspByPixelEventListener;
+import org.gvsig.raster.tools.app.basic.tool.properties.control.TranspByPixelListener;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+
+/**
+ * Panel con los controles para la transparencia por pixel. Incluye los textbox
+ * para a�adir un RGB a la lista.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TranspByPixelPanel extends JPanel {
+	private static final long               serialVersionUID       = -1131297200332579683L;
+	private boolean                         controlEnabled         = false;
+	private JCheckBox                       activeCheck            = null;
+	private JList                           jList                  = null;
+	private JPanel                          pixelSelector          = null;
+	private JPanel                          activeControl          = null;
+	private JPanel                          pEast                  = null;
+	private JPanel                          pCenter                = null;
+	private JPanel                          pButtons               = null;
+	private JButton                         bAdd                   = null;
+	private JButton                         bRemove                = null;
+	private JButton                         bSelectColor           = null;
+	private JScrollPane                     jScrollList            = null;
+	private TranspByPixelRGBInputPanel      pWest                  = null;
+	private TranspByPixelAndOrSelectorPanel pOperation             = null;
+	private TranspByPixelListener           listener               = null;
+	private ArrayList<TranspByPixelEventListener>
+	                                        actionCommandListeners = new ArrayList<TranspByPixelEventListener>();
+
+	/**
+	 * This is the default constructor
+	 */
+	public TranspByPixelPanel() {
+		initialize();
+		// Inicializa el TranspByPixelListener
+		getListener();
+		setControlEnabled(false);
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		setLayout(new BorderLayout());
+		add(getActiveControl(), BorderLayout.NORTH);
+		add(getPixelSelector(), BorderLayout.CENTER);
+	}
+
+	/**
+	 * Obtiene el panel con los controles principales para introducir valores RGB
+	 * en la lista
+	 * @return JPanel
+	 */
+	private JPanel getPixelSelector() {
+		if (pixelSelector == null) {
+
+			pixelSelector = new JPanel();
+			pixelSelector.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 11, 5, 11));
+
+			pixelSelector.setLayout(new BorderLayout(5, 5));
+
+			JPanel jpanel1 = new JPanel();
+			jpanel1.setLayout(new BorderLayout(5, 5));
+			jpanel1.add(getPRGBInput(), BorderLayout.CENTER);
+			jpanel1.add(getPCenter(), BorderLayout.EAST);
+
+			pixelSelector.add(jpanel1, BorderLayout.CENTER);
+			pixelSelector.add(getPList(), BorderLayout.EAST);
+		}
+		return pixelSelector;
+	}
+
+	/**
+	 * Obtiene el panel con el control de activaci�n
+	 * @return JPanel
+	 */
+	private JPanel getActiveControl() {
+		if (activeControl == null){
+			activeControl = new JPanel();
+			FlowLayout fl = new FlowLayout();
+			fl.setAlignment(FlowLayout.LEFT);
+			activeControl.setLayout(fl);
+			activeControl.add(getActiveCheck());
+		}
+		return activeControl;
+	}
+
+	/**
+	 * Obtiene el check que activa y desactiva la transparencia por pixel.
+	 * @return JCheckBox
+	 */
+	public JCheckBox getActiveCheck() {
+		if(activeCheck == null) {
+			activeCheck = new JCheckBox(PluginServices.getText(this, "activar"));
+			activeCheck.setSelected(false);
+		}
+		return activeCheck;
+	}
+
+	/**
+	 * This method initializes jPanel
+	 * @return
+	 */
+	public TranspByPixelRGBInputPanel getPRGBInput() {
+		if (pWest == null) {
+			pWest = new TranspByPixelRGBInputPanel();
+		}
+		return pWest;
+	}
+
+	/**
+	 * This method initializes jPanel1
+	 * @return javax.swing.JPanel
+	 */
+	public JPanel getPList() {
+		if (pEast == null) {
+			GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
+			gridBagConstraints3.fill = java.awt.GridBagConstraints.BOTH;
+			gridBagConstraints3.gridx = 0;
+			gridBagConstraints3.gridy = 0;
+			gridBagConstraints3.weightx = 1.0;
+			gridBagConstraints3.weighty = 1.0;
+			gridBagConstraints3.insets = new java.awt.Insets(0,0,0,0);
+			pEast = new JPanel();
+			pEast.setLayout(new GridBagLayout());
+			pEast.add(getJScrollList(), gridBagConstraints3);
+		}
+		return pEast;
+	}
+
+	/**
+	 * This method initializes pCenter
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getPCenter() {
+		if (pCenter == null) {
+			GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+			gridBagConstraints1.insets = new java.awt.Insets(0,0,0,0);
+			gridBagConstraints1.gridy = 1;
+			gridBagConstraints1.gridx = 0;
+			GridBagConstraints gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.insets = new java.awt.Insets(0,0,0,0);
+			gridBagConstraints.gridy = 0;
+			gridBagConstraints.gridx = 0;
+			pCenter = new JPanel();
+			pCenter.setLayout(new GridBagLayout());
+			pCenter.add(getPButtons(), gridBagConstraints);
+			pCenter.add(getPOperation(), gridBagConstraints1);
+		}
+		return pCenter;
+	}
+
+
+	/**
+	 * Obtiene el bot�n de a�adir elemento de la lista en la transparencia 
+	 * por pixel.
+	 *
+	 * @return javax.swing.JButton
+	 */
+	public JButton getBAdd() {
+		if (bAdd == null) {
+                        I18nManager i18nManager = ToolsLocator.getI18nManager();
+			bAdd = new JButton(i18nManager.getTranslation("add"));
+			bAdd.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
+			bAdd.setIcon(RasterToolsUtil.getIcon("forward-icon"));
+		}
+		return bAdd;
+	}
+
+	/**
+	 * Obtiene el bot�n de eliminar elemento de la lista en la transparencia 
+	 * por pixel.
+	 * @return javax.swing.JButton
+	 */
+	public JButton getBRemove() {
+		if (bRemove == null) {
+                        I18nManager i18nManager = ToolsLocator.getI18nManager();
+			bRemove = new JButton(i18nManager.getTranslation("remove"));
+			bRemove.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
+			bRemove.setIcon(RasterToolsUtil.getIcon("backward-icon"));
+			bRemove.setEnabled(false);
+		}
+		return bRemove;
+	}
+
+	/**
+	 * Obtiene el bot�n de color.
+	 * @return JButton
+	 */
+	public JButton getBSelectColor() {
+		if (bSelectColor == null) {
+			bSelectColor = new JButton();
+			bSelectColor.setIcon(RasterToolsUtil.getIcon("selectrgb-icon"));
+			bSelectColor.setPreferredSize(new Dimension(26, 26));
+			bSelectColor.setToolTipText(RasterToolsUtil.getText(this, "select_rgb"));
+		}
+		return bSelectColor;
+	}
+
+	/**
+	 * Obtiene el panel con los botones
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getPButtons() {
+		if (pButtons == null) {
+			pButtons = new JPanel();
+			pButtons.setLayout(new java.awt.GridBagLayout());
+
+			GridBagConstraints gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
+			gridBagConstraints.gridy = 0;
+			gridBagConstraints.gridx = 0;
+			gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+			pButtons.add(getBAdd(), gridBagConstraints);
+
+			gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
+			gridBagConstraints.gridy = 1;
+			gridBagConstraints.gridx = 0;
+			gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+			pButtons.add(getBRemove(), gridBagConstraints);
+
+			gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
+			gridBagConstraints.gridy = 2;
+			gridBagConstraints.gridx = 0;
+			pButtons.add(getBSelectColor(), gridBagConstraints);
+		}
+		return pButtons;
+	}
+
+	/**
+	 * This method initializes jPanel1
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	public TranspByPixelAndOrSelectorPanel getPOperation() {
+		if (pOperation == null) {
+			pOperation = new TranspByPixelAndOrSelectorPanel();
+			pOperation.setPreferredSize(new java.awt.Dimension(60,60));
+		}
+		return pOperation;
+	}
+
+	/**
+	 * This method initializes jList
+	 *
+	 * @return javax.swing.JList
+	 */
+	public JList getJList() {
+		if (jList == null) {
+			jList = new JList(new DefaultListModel());
+			jList.setFont(new java.awt.Font("Monospaced", java.awt.Font.PLAIN, 10));
+			jList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+		}
+		return jList;
+	}
+
+	/**
+	 * Inicializa el scroll para el jList
+	 * @return
+	 */
+	public JScrollPane getJScrollList() {
+		if (jScrollList == null) {
+			jScrollList = new JScrollPane();
+			jScrollList.setViewportView(getJList());
+			jScrollList.setPreferredSize(new java.awt.Dimension(160,100));
+		}
+		return jScrollList;
+	}
+
+	/**
+	 * Obtiene el ListModel de la lista
+	 * @return DefaultListModel
+	 */
+	public DefaultListModel getListModel(){
+		return (DefaultListModel) getJList().getModel();
+	}
+
+	/**
+	 * Activa o desactiva el control
+	 * @param enable True activa el control y false lo desactiva
+	 */
+	public void setControlEnabled(boolean enabled){
+		this.getActiveCheck().setSelected(enabled);
+		getJList().setEnabled(enabled);
+		if (enabled)
+			getJList().setBackground(Color.WHITE);
+		else
+			getJList().setBackground(this.getBackground());
+		getPRGBInput().setControlEnabled(enabled);
+		getBAdd().setEnabled(enabled);
+		getBSelectColor().setEnabled(enabled);
+
+		if (enabled)
+			getBRemove().setEnabled(getJList().getModel().getSize()>0);
+		else
+			getBRemove().setEnabled(false);
+
+		getPOperation().setControlEnabled(enabled);
+		controlEnabled = enabled;
+	}
+
+	/**
+	 * Obtiene true si el control est� activo y false si no lo est�
+	 * @return
+	 */
+	public boolean isControlEnabled(){
+		return controlEnabled;
+	}
+
+	/**
+	 * Asigna el n�mero de bandas activas
+	 * @param n N�mero de bandas
+	 */
+	public void setActiveBands(int n){
+		((TranspByPixelRGBInputPanel)getPRGBInput()).setActiveBands(n);
+	}
+
+	/**
+	 * Obtiene el array de entradas de valores a�adidos a la lista
+	 * @return ArrayList
+	 */
+	public ArrayList<TransparencyRange> getEntries() {
+		return getListener().getEntries();
+	}
+
+	/**
+	 * Obtiene la clase manejadora de eventos asociada a esta
+	 * @return TransparencyByPixelListener
+	 */
+	public TranspByPixelListener getListener() {
+		if (listener == null) {
+			listener = new TranspByPixelListener(this);
+		}
+		return listener;
+	}
+
+	/**
+	 * A�ade una entrada a la tabla
+	 * @param entry objeto TransparencyRange
+	 */
+	public void addStringElement(TransparencyRange entry){
+		getEntries().add(entry);
+		getListModel().addElement(entry.getStrEntry());
+		getBRemove().setEnabled(true);
+	}
+
+	/**
+	 * Borra las entradas de la tabla
+	 */
+	public void clear(){
+		getPRGBInput().clear();
+		getListModel().clear();
+		getEntries().clear();
+		getBRemove().setEnabled(false);
+	}
+
+	/**
+	 * A�adir un listener a la lista de eventos
+	 * @param listener
+	 */
+	public void addValueChangedListener(TranspByPixelEventListener listener) {
+		if (!actionCommandListeners.contains(listener))
+			actionCommandListeners.add(listener);
+	}
+
+	/**
+	 * Borrar un listener de la lista de eventos
+	 * @param listener
+	 */
+	public void removeValueChangedListener(TranspByPixelEventListener listener) {
+		actionCommandListeners.remove(listener);
+	}
+
+	/**
+	 * Dispara todos los manejadores que estan apuntando a este evento
+	 */
+	public void callValueChanged() {
+		Iterator<TranspByPixelEventListener> acIterator = actionCommandListeners.iterator();
+		while (acIterator.hasNext()) {
+			TranspByPixelEventListener listener = (TranspByPixelEventListener) acIterator.next();
+			listener.actionPixelListChanged(new EventObject(this));
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TranspByPixelPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/EnhancedPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/EnhancedPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/EnhancedPanel.java	(revision 8183)
@@ -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.tools.app.basic.tool.properties.panel;
+
+import java.awt.Dimension;
+import java.awt.GridLayout;
+
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.gui.beans.panelGroup.panels.AbstractPanel;
+import org.gvsig.gui.util.StatusComponent;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.layers.IRasterLayerActions;
+import org.gvsig.raster.tools.app.basic.tool.properties.control.EnhancedControl;
+
+/**
+ * Panel para los controles de brillo y contrase .
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class EnhancedPanel extends AbstractPanel {
+	private final static long               serialVersionUID = 0;
+	private EnhancedBrightnessContrastPanel contrastPanel     = null;
+	private EnhancedWithTrimPanel           trimPanel         = null;
+	private EnhancedControl                 enhancedControl   = null;
+	private FLyrRaster                      fLayer            = null;
+
+	/**
+	 * Contructor
+	 */
+	public EnhancedPanel() {
+		setLabel(Messages.getText("realce"));
+		initialize();
+	}
+
+
+	protected void initialize() {
+		setLayout(new GridLayout(1, 2));
+		add(getBrightnessContrastPanel());
+		add(getEnhancedWithTrimPanel());
+		this.setPreferredSize(new Dimension(100, 80));
+
+		this.setPriority(60);
+	}
+
+	public void initializeUI() {
+	}
+
+	/**
+	 * Obtiene el panel de brillo y contraste
+	 * @return EnhancedBrightnessContrastPanel
+	 */
+	public EnhancedBrightnessContrastPanel getBrightnessContrastPanel() {
+		if (contrastPanel == null) {
+			contrastPanel = new EnhancedBrightnessContrastPanel();
+		}
+		return contrastPanel;
+	}
+
+	/**
+	 * Obtiene el panel de realce con recorte de colas
+	 * @return EnhancedWithTrimPanel
+	 */
+	public EnhancedWithTrimPanel getEnhancedWithTrimPanel() {
+		if (trimPanel == null) {
+			trimPanel = new EnhancedWithTrimPanel();
+		}
+		return trimPanel;
+	}
+
+	public void accept() {
+		enhancedControl.accept();
+	}
+
+	public void apply() {
+		enhancedControl.apply();
+	}
+
+	public void cancel() {
+		enhancedControl.cancel();
+	}
+
+	public void setReference(Object ref) {
+		super.setReference(ref);
+
+		if (!(ref instanceof FLyrRaster))
+			return;
+
+		fLayer = (FLyrRaster) ref;
+
+		actionEnabled();
+		RasterFilterList rfl  = fLayer.getRender().getFilterList();
+
+		enhancedControl = new EnhancedControl(getPanelGroup(), this, fLayer, rfl);
+	}
+
+	private void actionEnabled() {
+		IRasterLayerActions actions = null;
+		if(fLayer instanceof IRasterLayerActions)
+			actions = ((IRasterLayerActions) fLayer);
+
+		if (!actions.isActionEnabled(IRasterLayerActions.BRIGHTNESSCONTRAST))
+			StatusComponent.setDisabled(getBrightnessContrastPanel());
+
+		if (!actions.isActionEnabled(IRasterLayerActions.ENHANCED))
+			StatusComponent.setDisabled(getEnhancedWithTrimPanel());
+
+		if (actions.isActionEnabled(IRasterLayerActions.ENHANCED) &&
+			!actions.isActionEnabled(IRasterLayerActions.TAILTRIM)) {
+			getEnhancedWithTrimPanel().getTrimSlider().setVisible(false);
+			getEnhancedWithTrimPanel().getTrimCheck().setVisible(false);
+		}
+
+		if (!actions.isActionEnabled(IRasterLayerActions.BRIGHTNESSCONTRAST) &&
+				!actions.isActionEnabled(IRasterLayerActions.ENHANCED))
+			setVisible(false);
+		else
+			setVisible(true);
+	}
+
+	public void selected() {
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/EnhancedPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/NoDataPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/NoDataPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/NoDataPanel.java	(revision 8183)
@@ -0,0 +1,389 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.properties.panel;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.text.DecimalFormat;
+import java.text.NumberFormat;
+import java.util.Locale;
+
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JFormattedTextField;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.RasterExtension;
+import org.gvsig.raster.util.BasePanel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Panel para la gestion del valor NoData en el panel de propiedades
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class NoDataPanel extends BasePanel implements ActionListener {
+	private static final long   serialVersionUID       = 7645641060812458944L;
+	private Logger              log                    = LoggerFactory.getLogger(NoDataPanel.class);
+	private static final String NULL_NODATA            = "not_defined";
+	private static final String NAN_NODATA             = "NaN";
+	private JLabel              jLabelValue            = null;
+	private JButton             buttonSave             = null;
+	private JButton             buttonDelete           = null;
+	private JButton             buttonDefaultValue     = null;
+	private JButton             buttonRestore          = null;
+	private JFormattedTextField jTextFieldValue        = null;
+	private JPanel              panelCenter            = null;
+	private JPanel              panelUp                = null;
+	private JPanel              panelDown              = null;
+	private JCheckBox           jCheckBoxNoDataEnabled = null;
+	private NoData              noData                 = null;
+	private int                 dataType               = Buffer.TYPE_UNDEFINED;
+	private FLyrRaster          lyr                    = null;
+
+	public NoDataPanel() {
+		init();
+		translate();
+	}
+
+	protected void translate() {
+		getButtonSave().setText(getText(this, "guardar"));
+		getButtonSave().setToolTipText(getText(this, "guardar_box_value"));
+		getButtonRestore().setText(getText(this, "restore"));
+		getButtonRestore().setToolTipText(getText(this, "restore_native_value"));
+		getButtonDefaultValue().setText(getText(this, "default_value"));
+		getButtonDefaultValue().setToolTipText(getText(this, "set_configuration_value"));
+		getButtonDelete().setText(getText(this, "delete"));
+		getButtonDelete().setToolTipText(getText(this, "delete_value"));
+		getCheckBoxNoDataEnabled().setText(getText(this, "tratar_nodata_transparente"));
+		getCheckBoxNoDataEnabled().setToolTipText(getCheckBoxNoDataEnabled().getText());
+		getLabelValue().setText(getText(this, "value") + ":");
+	}
+
+	private JButton getButtonSave() {
+		if (buttonSave == null) {
+			buttonSave = new JButton();
+			buttonSave.addActionListener(this);
+		}
+		return buttonSave;
+	}
+	
+	private JButton getButtonDelete() {
+		if (buttonDelete == null) {
+			buttonDelete = new JButton();
+			buttonDelete.addActionListener(this);
+		}
+		return buttonDelete;
+	}
+	
+	private JButton getButtonDefaultValue() {
+		if (buttonDefaultValue == null) {
+			buttonDefaultValue = new JButton();
+			buttonDefaultValue.addActionListener(this);
+		}
+		return buttonDefaultValue;
+	}
+	
+	private JButton getButtonRestore() {
+		if (buttonRestore == null) {
+			buttonRestore = new JButton();
+			buttonRestore.addActionListener(this);
+		}
+		return buttonRestore;
+	}
+
+	private JFormattedTextField getTextFieldValue() {
+		if (jTextFieldValue == null) {
+			DecimalFormat nf = (DecimalFormat)NumberFormat.getInstance(Locale.ENGLISH);
+			nf.applyPattern("##########.######");
+	        nf.setMaximumFractionDigits(6);
+			jTextFieldValue = new JFormattedTextField(nf);
+		}
+		return jTextFieldValue;
+	}
+
+	private JLabel getLabelValue() {
+		if (jLabelValue == null) {
+			jLabelValue = new JLabel();
+		}
+		return jLabelValue;
+	}
+
+	protected void init() {
+		GridBagConstraints gridBagConstraints;
+
+		setLayout(new GridBagLayout());
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.weightx = 1.0;
+		add(getPanelUp(), gridBagConstraints);
+
+		gridBagConstraints.gridy = 1;
+		add(getPanelCenter(), gridBagConstraints);
+
+		gridBagConstraints.gridy = 2;
+		add(getPanelDown(), gridBagConstraints);
+	}
+	
+	public JCheckBox getCheckBoxNoDataEnabled() {
+		if (jCheckBoxNoDataEnabled == null) {
+			jCheckBoxNoDataEnabled = new JCheckBox();
+			jCheckBoxNoDataEnabled.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+			jCheckBoxNoDataEnabled.setMargin(new Insets(0, 0, 0, 0));
+			jCheckBoxNoDataEnabled.addActionListener(this);
+		}
+		return jCheckBoxNoDataEnabled;
+	}
+	
+	
+	private void setCheckBoxValue(double d) {
+		getTextFieldValue().setText(d + "");
+	}
+	
+	private String getCheckBoxValue() {
+		String value = getTextFieldValue().getText();
+		try {
+			new Double(value);
+		} catch (NumberFormatException e) {
+			RasterSwingLibrary.messageBoxError("nodatavalue_not_valid", this);
+			return null;
+		}
+		return getTextFieldValue().getText();
+	}
+
+	public void setEnabledComponents(boolean b) {
+		getTextFieldValue().setEnabled(b);
+		getLabelValue().setEnabled(b);
+		getButtonDelete().setEnabled(b);
+		getButtonRestore().setEnabled(b);
+		getButtonSave().setEnabled(b);
+		getButtonDefaultValue().setEnabled(b);
+	}
+
+	public NoData getNoDataValue() {
+		return noData;
+	}
+	
+	/**
+	 * Loads the NoData value using the selected text. If the text is
+	 * null then it reads the text from the text field.
+	 * @param text
+	 */
+	private void loadNoDataFromText(String text) {
+		if(text == null) 
+			text = getCheckBoxValue();
+		
+                if(text == null || text.compareTo(getText(this, NULL_NODATA)) == 0) {
+			noData.setValue(null);
+			noData.save();
+			return;
+		}
+		
+		if(text.compareTo(NAN_NODATA) == 0) {
+			noData.setValue(Double.NaN);
+			noData.save();
+			return;
+		}
+		
+		Number number = null;
+		try {
+			switch (dataType) {
+			case Buffer.TYPE_BYTE:
+				if(text.contains(".")) 
+					text = text.substring(0, text.lastIndexOf("."));
+				number = new Byte(text);
+				break;
+			case Buffer.TYPE_SHORT:
+				if(text.contains(".")) 
+					text = text.substring(0, text.lastIndexOf("."));
+				number = new Short(text);
+				break;
+			case Buffer.TYPE_INT:
+				if(text.contains(".")) 
+					text = text.substring(0, text.lastIndexOf("."));
+				number = new Integer(text);
+				break;
+			case Buffer.TYPE_FLOAT:
+				number = new Float(text);
+				break;
+			case Buffer.TYPE_DOUBLE:
+				number = new Double(text);
+				break;
+			}
+			noData.setValue(number);
+			noData.save();
+		}catch (NumberFormatException e1) {
+			log.info("A number format exception in Nodata panel has happend", e1);
+		}
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		//Saves nodata value
+		if (e.getSource() == getButtonSave()) {
+			loadNoDataFromText(null);
+		}
+		
+		//Saves default nodata
+		if (e.getSource() == getButtonDefaultValue()) {
+			switch (dataType) {
+			case Buffer.TYPE_BYTE:
+				loadNoDataFromText(RasterLibrary.defaultByteNoDataValue + "");
+				break;
+			case Buffer.TYPE_SHORT:
+				loadNoDataFromText(RasterLibrary.defaultShortNoDataValue + "");
+				break;
+			case Buffer.TYPE_INT:
+				loadNoDataFromText(RasterLibrary.defaultIntegerNoDataValue + "");
+				break;
+			case Buffer.TYPE_FLOAT:
+				loadNoDataFromText(RasterLibrary.defaultFloatNoDataValue + "");
+				break;
+			case Buffer.TYPE_DOUBLE:
+				loadNoDataFromText(RasterLibrary.defaultDoubleNoDataValue + "");
+				break;
+			}
+			if(noData.isDefined()) {
+				setCheckBoxValue(noData.getValue().doubleValue());
+			}
+		}
+		
+		//Deletes nodata value
+		if (e.getSource() == getButtonDelete()) {
+			noData.delete();
+			noData.save();
+                        getTextFieldValue().setText(getText(this, NULL_NODATA));
+		}
+		
+		//Restores original nodata value
+		if (e.getSource() == getButtonRestore()) {
+			noData.restore();
+			noData.save();
+			if(noData.isDefined()) {
+				setCheckBoxValue(noData.getValue().doubleValue());
+			} else {
+				getTextFieldValue().setText(getText(this, NULL_NODATA));
+			}
+		}
+		
+		if(e.getSource() == getCheckBoxNoDataEnabled()) {
+			if (RasterExtension.autoRefreshView)
+				lyr.setNoDataTransparent(getCheckBoxNoDataEnabled().isSelected());
+		}
+		
+		if (RasterExtension.autoRefreshView) {
+			if (lyr == null || lyr.getDataStore() == null)
+				return;
+
+			lyr.setNoDataTransparent(getCheckBoxNoDataEnabled().isSelected());
+
+			// Redibujamos
+			lyr.getMapContext().invalidate();
+		}
+	}
+
+	/**
+	 * Assigns the data source
+	 * @param t
+	 */
+	public void setLayer(FLyrRaster layer) {
+		this.lyr = layer;
+		this.noData = layer.getNoDataValue();
+		this.dataType = layer.getDataStore().getDataType()[0];
+		if(noData.isDefined()) {
+			setCheckBoxValue(noData.getValue().doubleValue());
+		} else {
+			getTextFieldValue().setText(getText(this, NULL_NODATA));
+		}
+		getCheckBoxNoDataEnabled().setSelected(noData.isNoDataTransparent());
+	}
+
+	public JPanel getPanelCenter() {
+		if(panelCenter == null) {
+			panelCenter = new JPanel();
+			panelCenter.setLayout(new GridBagLayout());
+			
+			GridBagConstraints gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.fill = GridBagConstraints.NONE;
+			gridBagConstraints.insets = new Insets(2, 2, 2, 2);
+			panelCenter.add(getLabelValue(), gridBagConstraints);
+			
+			gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+			gridBagConstraints.weightx = 1.0;
+			gridBagConstraints.gridx = 1;
+			panelCenter.add(getTextFieldValue(), gridBagConstraints);
+			
+			gridBagConstraints.fill = GridBagConstraints.NONE;
+			gridBagConstraints.weightx = 0.0;
+			gridBagConstraints.gridx = 2;
+			panelCenter.add(getButtonSave(), gridBagConstraints);
+			
+			gridBagConstraints.gridx = 3;
+			panelCenter.add(getButtonDelete(), gridBagConstraints);
+
+		}
+		return panelCenter;
+	}
+
+	public JPanel getPanelUp() {
+		if(panelUp == null) {
+			panelUp = new JPanel();
+			panelUp.setLayout(new GridBagLayout());
+			
+			GridBagConstraints gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+			gridBagConstraints.weightx = 1.0;
+			gridBagConstraints.insets = new Insets(2, 2, 2, 2);
+			panelUp.add(getCheckBoxNoDataEnabled(), gridBagConstraints);
+		}
+		return panelUp;
+	}
+
+	public JPanel getPanelDown() {
+		if(panelDown == null) {
+			panelDown = new JPanel();
+			panelDown.setLayout(new GridBagLayout());
+			
+			GridBagConstraints gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+			gridBagConstraints.weightx = 1.0;
+			gridBagConstraints.insets = new Insets(2, 2, 2, 2);
+			panelDown.add(getButtonDefaultValue(), gridBagConstraints);
+			
+			gridBagConstraints.gridx = 1;
+			panelDown.add(getButtonRestore(), gridBagConstraints);
+		}
+		return panelDown;
+	}
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/NoDataPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TranspByPixelAndOrSelectorPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TranspByPixelAndOrSelectorPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TranspByPixelAndOrSelectorPanel.java	(revision 8183)
@@ -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.raster.tools.app.basic.tool.properties.panel;
+
+import java.awt.FlowLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+
+public class TranspByPixelAndOrSelectorPanel extends JPanel {
+	final private static long	serialVersionUID = 0;
+	private JPanel 				pBorder = null;
+	private JRadioButton 		rbAnd = null;
+	private JRadioButton 		rbOr = null;
+	private ButtonGroup 		group = null;
+	/**
+	 * This is the default constructor
+	 */
+	public TranspByPixelAndOrSelectorPanel() {
+		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(60, 60);
+		this.setPreferredSize(new java.awt.Dimension(52,50));
+		this.add(getJPanel(), null);
+		this.getRbAnd().setSelected(true);
+		group = new ButtonGroup();
+		group.add(this.getRbAnd());
+		group.add(this.getRbOr());
+	}
+
+	/**
+	 * This method initializes jPanel	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	private JPanel getJPanel() {
+		if (pBorder == null) {
+			GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+			gridBagConstraints1.gridx = 0;
+			gridBagConstraints1.anchor = java.awt.GridBagConstraints.WEST;
+			gridBagConstraints1.gridy = 0;
+			GridBagConstraints gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.gridx = 0;
+			gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+			gridBagConstraints.gridy = 1;
+			pBorder = new JPanel();
+			pBorder.setLayout(new GridBagLayout());
+			pBorder.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray,1));
+			pBorder.setPreferredSize(new java.awt.Dimension(60,60));
+			pBorder.add(getRbAnd(), gridBagConstraints1);
+			pBorder.add(getRbOr(), gridBagConstraints);
+		}
+		return pBorder;
+	}
+
+	/**
+	 * This method initializes jRadioButton	
+	 * 	
+	 * @return javax.swing.JRadioButton	
+	 */
+	public JRadioButton getRbAnd() {
+		if (rbAnd == null) {
+			rbAnd = new JRadioButton();
+			rbAnd.setText("And");
+			rbAnd.setPreferredSize(new java.awt.Dimension(60,25));
+		}
+		return rbAnd;
+	}
+
+	/**
+	 * This method initializes jRadioButton1	
+	 * 	
+	 * @return javax.swing.JRadioButton	
+	 */
+	public JRadioButton getRbOr() {
+		if (rbOr == null) {
+			rbOr = new JRadioButton();
+			rbOr.setText("Or");
+			rbOr.setPreferredSize(new java.awt.Dimension(60,25));
+		}
+		return rbOr;
+	}
+	
+	/**
+	 * Activa o desactiva el control
+	 * @param enable True activa el control y false lo desactiva
+	 */
+	public void setControlEnabled(boolean enabled){
+		this.getRbAnd().setEnabled(enabled);
+		this.getRbOr().setEnabled(enabled);
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TranspByPixelAndOrSelectorPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TransparencyPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TransparencyPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TransparencyPanel.java	(revision 8183)
@@ -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.tools.app.basic.tool.properties.panel;
+
+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.JCheckBox;
+import javax.swing.border.TitledBorder;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.gui.beans.checkslidertext.CheckSliderTextContainer;
+import org.gvsig.gui.beans.panelGroup.panels.AbstractPanel;
+import org.gvsig.gui.beans.slidertext.listeners.SliderEvent;
+import org.gvsig.gui.beans.slidertext.listeners.SliderListener;
+import org.gvsig.gui.util.StatusComponent;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.layers.IRasterLayerActions;
+import org.gvsig.raster.tools.app.basic.RasterExtension;
+import org.gvsig.raster.tools.app.basic.tool.properties.control.TransparencyListener;
+
+/**
+ * Dialogo para asignar la transparencia por pixel y global al raster.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TransparencyPanel extends AbstractPanel implements ActionListener, SliderListener {
+	private static final long serialVersionUID  = -4556920949255458471L;
+	private FLyrRaster        lyr               = null;
+
+	/**
+	 * N�mero de bandas del raster
+	 */
+	public int                       nBands               = 3;
+	private JCheckBox                cbTransparencia      = null;
+	private TranspByPixelPanel       pTranspByPixel       = null;
+	private CheckSliderTextContainer pOpacity             = null;
+	private TransparencyListener     transparencyListener = null;
+
+	/**
+	 * Constructor.
+	 */
+	public TransparencyPanel() {
+		setLabel(PluginServices.getText(this, "transparencia"));
+		initialize();
+	}
+
+	private TransparencyListener getTransparencyListener() {
+		if (transparencyListener == null) {
+			transparencyListener = new TransparencyListener(this);
+		}
+		return transparencyListener;
+	}
+
+	/**
+	 * This method initializes this
+	 * @return void
+	 */
+	protected void initialize() {
+		this.setLayout(new BorderLayout());
+		this.add(getOpacityPanel(), BorderLayout.NORTH);
+		this.add(getPTranspByPixel(), BorderLayout.CENTER);
+		initControls();
+		this.setPreferredSize(new Dimension(100, 80));
+		this.setPriority(70);
+	}
+
+	/**
+	 * Asigna el n�mero de bandas de la imagen
+	 * @param nBands
+	 */
+	public void setBands(int nBands) {
+		this.nBands = nBands;
+	}
+
+	/**
+	 * Inicializa controles a sus valores por defecto
+	 */
+	public void initControls() {
+		this.setActiveTransparencyControl(false);
+	}
+
+	/**
+	 * This method initializes jCheckBox
+	 * @return javax.swing.JCheckBox
+	 */
+	public JCheckBox getTransparencyCheck() {
+		if (cbTransparencia == null) {
+			cbTransparencia = new JCheckBox();
+			cbTransparencia.setText("Activar");
+			cbTransparencia.addActionListener(this);
+		}
+
+		return cbTransparencia;
+	}
+
+	/**
+	 * This method initializes TranspOpacitySliderPanel
+	 * @return javax.swing.JPanel
+	 */
+	public CheckSliderTextContainer getOpacityPanel() {
+		if (pOpacity == null) {
+			pOpacity = new CheckSliderTextContainer(0, 100, 100, false, PluginServices.getText(this, "activar"), false, false, true);
+			pOpacity.setDecimal(false);
+			pOpacity.setBorder(PluginServices.getText(this, "opacidad"));
+			pOpacity.addValueChangedListener(this);
+		}
+
+		return pOpacity;
+	}
+
+	/**
+	 * Activa/Desactiva los controles de transparencia
+	 * @param active
+	 */
+	public void setActiveTransparencyControl(boolean active) {
+		this.getTransparencyCheck().setSelected(active);
+		TranspByPixelRGBInputPanel rgbPanel = this.getPTranspByPixel().getPRGBInput();
+		rgbPanel.getTRed().setEnabled(active);
+
+		if (lyr != null) {
+			if (lyr.getDataStore().getBandCount() == 2) {
+				rgbPanel.getTGreen().setEnabled(active);
+				rgbPanel.getTBlue().setEnabled(false);
+			}
+
+			if (lyr.getDataStore().getBandCount() == 3) {
+				rgbPanel.getTGreen().setEnabled(active);
+				rgbPanel.getTBlue().setEnabled(active);
+			}
+		}
+	}
+
+	/**
+	 * This method initializes jPanel2
+	 * @return javax.swing.JPanel
+	 */
+	public TranspByPixelPanel getPTranspByPixel() {
+		if (pTranspByPixel == null) {
+			pTranspByPixel = new TranspByPixelPanel();
+			pTranspByPixel.setBorder(BorderFactory.createTitledBorder(null, PluginServices.getText(this, "transp_by_pixel"), TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));
+		}
+
+		return pTranspByPixel;
+	}
+
+	/**
+	 * Eventos sobre TextField y CheckBox. Controla eventos de checkbox de
+	 * opacidad, transparencia, recorte de colas y los textfield de opacidad,
+	 * valores de transparencia por banda y porcentaje de recorte.
+	 */
+	public void actionPerformed(ActionEvent e) {
+		// Evento sobre el checkbox de transparencia
+		if (e.getSource().equals(getTransparencyCheck())) {
+			// Check de opacidad activado -> Activar controles de opacidad
+			if (getTransparencyCheck().isSelected()) {
+				getPTranspByPixel().setControlEnabled(true);
+				getPTranspByPixel().getPRGBInput().setActiveBands(nBands);
+			} else
+				getPTranspByPixel().setControlEnabled(false);
+		}
+	}
+
+	/**
+	 * Obtiene la capa si existe esta.
+	 * @return FLayer si existe una capa o null si no existe.
+	 */
+	public FLayer getLayer() {
+		if (lyr instanceof FLayer)
+			return (FLayer) lyr;
+		return null;
+	}
+
+	public void setReference(Object ref) {
+		super.setReference(ref);
+
+		if (!(ref instanceof FLyrRaster))
+			return;
+
+		this.lyr = (FLyrRaster) ref;
+
+		getTransparencyListener().setLayer(this.lyr);
+		actionEnabled();
+	}
+
+	private void actionEnabled() {
+		if (lyr == null) {
+			setVisible(false);
+			return;
+		}
+
+		IRasterLayerActions fLyrRasterSE = ((IRasterLayerActions) lyr);
+
+		if (!fLyrRasterSE.isActionEnabled(IRasterLayerActions.OPACITY))
+			StatusComponent.setDisabled(getOpacityPanel());
+
+		if (!fLyrRasterSE.isActionEnabled(IRasterLayerActions.TRANSPARENCY))
+			StatusComponent.setDisabled(getPTranspByPixel());
+
+		if (!fLyrRasterSE.isActionEnabled(IRasterLayerActions.TRANSPARENCY) &&
+				!fLyrRasterSE.isActionEnabled(IRasterLayerActions.OPACITY))
+			setVisible(false);
+		else
+			setVisible(true);
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.rastertools.properties.dialog.IRegistrablePanel#accept()
+	 */
+	public void accept() {
+		getTransparencyListener().accept();
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.rastertools.properties.dialog.IRegistrablePanel#apply()
+	 */
+	public void apply() {
+		getTransparencyListener().apply();
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.rastertools.properties.dialog.IRegistrablePanel#cancel()
+	 */
+	public void cancel() {
+		getTransparencyListener().cancel();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.slidertext.listeners.SliderListener#actionValueChanged(org.gvsig.gui.beans.slidertext.listeners.SliderEvent)
+	 */
+	public void actionValueChanged(SliderEvent e) {
+		if (!RasterExtension.autoRefreshView)
+			return;
+		getTransparencyListener().onlyApply();
+	}
+
+	public void actionValueDragged(SliderEvent e) {}
+	public void selected() {}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TransparencyPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/InfoPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/InfoPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/InfoPanel.java	(revision 8183)
@@ -0,0 +1,585 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+package org.gvsig.raster.tools.app.basic.tool.properties.panel;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.io.File;
+import java.net.URI;
+
+import javax.swing.JEditorPane;
+import javax.swing.JScrollPane;
+
+import org.apache.commons.io.FilenameUtils;
+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.BandAccessException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.props.Metadata;
+import org.gvsig.gui.beans.panelGroup.panels.AbstractPanel;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.utils.swing.JComboBox;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Panel de informaci�n sobre raster. La informaci�n que aparece en este panel
+ * es la siguiente:
+ * <P>
+ * Informaci�n b�sica sobre el dataset:
+ * <UL>
+ * <LI>Fichero/s que forman el dataset</LI>
+ * <LI>Tama�o por fichero</LI>
+ * <LI>Ancho y alto</LI>
+ * <LI>Formato</LI>
+ * <LI>Si tiene georreferenciaci�n o no</LI>
+ * <LI>N�mero de bandas</LI>
+ * <LI>Tipo de dato.</LI>
+ * </UL>
+ * </P>
+ * <P>
+ * Datos de georreferenciaci�n:
+ * <UL>
+ * <LI>Proyecci�n</LI>
+ * <LI>Coordenadas UTM o geogr�ficas</LI>
+ * <LI>Tama�o de pixel</LI>
+ * </UL>
+ * </P>
+ * <P>
+ * Bandas:
+ * <UL>
+ * <LI>Bandas de todos los datasets asociados con el tipo de dato de cada uno y
+ * banda de visualizaci�n asignada (R, G o B)</LI>
+ * <LI>Coordenadas UTM o geogr�ficas</LI>
+ * <LI>Tama�o de pixel</LI>
+ * </UL>
+ * </P>
+ * <P>
+ * Metadatos
+ * </P>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class InfoPanel extends AbstractPanel {
+	private static final long   serialVersionUID  = -3764465947289974528L;
+	private static final Logger logger            = LoggerFactory.getLogger(InfoPanel.class);
+	private final String        bgColor0          = "\"#FEEDD6\""; // light salmon
+	private final String        bgColor1          = "\"#EAEAEA\""; // light grey
+	private final String        bgColor3          = "\"#FBFFE1\""; // light yellow
+	private final String        bgColor4          = "\"#D6D6D6\""; // Gris
+	private final String        bgColorBody       = "\"#FFFFFF\""; // white
+
+	private JScrollPane         jScrollPane       = null;
+	public JEditorPane          jEditorPane       = null;
+	private JComboBox           jComboBox         = null;
+	private int                 selectedDataSet   = 0;
+	private boolean             jComboBoxEvent    = false;
+	/**
+	 * Cabecera de las columnas del dialogo
+	 */
+	public Object[]             columnNames       = { "Propiedad", "Valor" };
+	private FLyrRaster          lyr               = null;
+	/**
+	 * Booleano que est� a true cuando la fila a dibujar es par y a false cuando
+	 * es impar.
+	 */
+	private boolean             rowColor          = true;
+	private RasterManager       rManager          = null;
+
+	/**
+	 * This is the default constructor
+	 */
+	public InfoPanel() {
+		super();
+		rManager = RasterLocator.getManager();
+		setLabel(Messages.getText("info"));
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 *
+	 * @return void
+	 */
+	protected void initialize() {
+		this.setLayout(new BorderLayout(5, 5));
+		this.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
+		this.add(getJScrollPane(), BorderLayout.CENTER);
+		this.add(getJComboBox(), BorderLayout.SOUTH);
+		this.getJEditorPane().repaint();
+
+		getJComboBox().addItemListener(new ItemListener() {
+			public void itemStateChanged(ItemEvent e) {
+				refresh();
+			}
+		});
+		this.setPreferredSize(new Dimension(100, 80));
+		this.setPriority(100);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.gui.properties.dialog.IRegistrablePanel#initializeUI()
+	 */
+	public void initializeUI() {
+	}
+
+	/**
+	 * This method initializes jScrollPane
+	 *
+	 * @return javax.swing.JScrollPane
+	 */
+	private JScrollPane getJScrollPane() {
+		if (jScrollPane == null) {
+			jScrollPane = new JScrollPane();
+			jScrollPane.setViewportView(getJEditorPane());
+		}
+		return jScrollPane;
+	}
+
+	/**
+	 * This method initializes jComboBox
+	 *
+	 * @return javax.swing.JComboBox
+	 */
+	private JComboBox getJComboBox() {
+		if (jComboBox == null) {
+			jComboBox = new JComboBox();
+		}
+		return jComboBox;
+	}
+
+	/**
+	 * This method initializes jEditorPane
+	 *
+	 * @return javax.swing.JEditorPane
+	 */
+	private JEditorPane getJEditorPane() {
+		if (jEditorPane == null) {
+			jEditorPane = new JEditorPane();
+			jEditorPane.setEditable(false);
+			jEditorPane.setContentType("text/html");
+		}
+		return jEditorPane;
+	}
+
+	public void resetTable() {
+		this.jEditorPane = null;
+	}
+
+	/**
+	 * Controla la alternatividad de colores en la tabla.
+	 *
+	 * @return Cadena con el color de la fila siguiente.
+	 */
+	private String getColor() {
+		String color = (rowColor ? bgColor0 : bgColor1);
+		rowColor = !rowColor;
+		return color;
+	}
+
+	/**
+	 * Obtiene una entrada de la tabla en formato HTML a partir de una propiedad,
+	 * un valor y un color.
+	 *
+	 * @param prop
+	 *          Nombre de la propiedad
+	 * @param value
+	 *          Valor
+	 * @param color
+	 *          Color
+	 *
+	 * @return Entrada HTML de la tabla
+	 */
+	private String setHTMLBasicProperty(String prop, String value) {
+		String content = "<tr valign=\"top\">";
+		if (prop != null)
+			content += "<td bgcolor=" + bgColor4 + "align=\"right\" width=\"140\"><font face=\"Arial\" size=\"3\">" + prop + ":&nbsp;</font></td>";
+		content += "<td bgcolor=" + getColor() + "align=\"left\"><font face=\"Arial\" size=\"3\">" + value + "</font></td>";
+		content += "</tr>";
+
+		return content;
+	}
+
+	/**
+	 * Obtiene una cabecera de tabla en formato HTML a partir de un titulo.
+	 *
+	 * @param title
+	 *          Nombre del titulo
+	 * @param colspan
+	 *          Numero de celdas que ocupara el titulo
+	 *
+	 * @return Entrada HTML del titulo
+	 */
+	private String setHTMLTitleTable(String title, int colspan) {
+		return
+			"<tr valign=\"middle\" >" +
+			"<td bgcolor=" + bgColor3 + " align=\"center\" colspan=\"" + colspan + "\"><font face=\"Arial\" size=\"3\"><b> " + title + "</b></font></td>" +
+			"</tr>";
+	}
+
+	/**
+	 * Obtiene una cabecera de tabla en formato HTML a partir de un titulo.
+	 *
+	 * @param content
+	 *          Codigo HTML de las filas que componen la tabla.
+	 *
+	 * @return Entrada HTML de la tabla completa
+	 */
+	private String setHTMLTable(String content) {
+		return "<table cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\">" + content + "</table>";
+	}
+
+	/**
+	 * Genera el HTML para todo el contenido.
+	 *
+	 * @param content
+	 *          Codigo HTML que ira en el <body>...</body>.
+	 *
+	 * @return HTML completo
+	 */
+	private String setHTMLBody(String content) {
+		String html = "<html>";
+		html += "<body bgcolor=" + bgColorBody + " topmargin=\"0\" marginheight=\"0\">";
+		html += content;
+		html += "</body>";
+		html += "</html>";
+		return html;
+	}
+
+	/**
+	 * M�todo que crea el c�digo HTML para la tabla de informaci�n general dentro
+	 * del panel de informaci�n de raster
+	 *
+	 * @return String con el c�figo HTML que corresponde con la tabla de
+	 * informaci�n general
+	 */
+	public String tablaInfo() {
+		rowColor = true;
+		String cabInfo = Messages.getText("general_info");
+		String propiedades = "";
+		long fileSize = 0;
+
+		String cabecera = setHTMLTitleTable(cabInfo, 2);
+
+		long[] filesSize = lyr.getDataStore().getFileSizeByProvider();
+		fileSize = filesSize[selectedDataSet];
+
+		URI[] names = lyr.getDataStore().getURIByProvider();
+		URI uri = names[selectedDataSet];
+		if("FILE".equalsIgnoreCase(uri.getScheme())){
+		    propiedades += setHTMLBasicProperty(Messages.getText("archivo"), names[selectedDataSet].getPath());
+		} else {
+            propiedades += setHTMLBasicProperty(Messages.getText("uri"), names[selectedDataSet].toString());
+		}
+
+		propiedades += setHTMLBasicProperty(Messages.getText("size"), rManager.getFileUtils().formatFileSize(fileSize) + " ");
+		propiedades += setHTMLBasicProperty(Messages.getText("ancho_alto"), lyr.getDataStore().getWidth() + " X " + lyr.getDataStore().getHeight());
+		propiedades += setHTMLBasicProperty(Messages.getText("formato"), lyr.getFileFormat());
+		propiedades += setHTMLBasicProperty(Messages.getText("georref"), lyr.isGeoreferenced() ? Messages.getText("si") : Messages.getText("no"));
+		propiedades += setHTMLBasicProperty(Messages.getText("nbandas"), new Integer(lyr.getDataStore().getBandCount()).toString());
+		propiedades += setHTMLBasicProperty(Messages.getText("nbandas_file"), new Integer(lyr.getBandCountFromDataset()[selectedDataSet]).toString());
+		propiedades += setHTMLBasicProperty(Messages.getText("tipo_dato"), rManager.getRasterUtils().typesToString(lyr.getDataStore().getDataType()[0]));
+		propiedades += setHTMLBasicProperty(Messages.getText("tipo_proveedor"), lyr.getDataStore().getProviderName());
+
+		return setHTMLTable(cabecera + propiedades);
+	}
+
+	/**
+	 * M�todo que crea el c�digo HTML para la tabla de Coordenadas Geogr�ficas
+	 * dentro del panel de informaci�n de raster
+	 *
+	 * @return String con el c�figo HTML que corresponde con la tabla de
+	 *         Coordenadas Geogr�ficas
+	 */
+	public String tablaCoord() {
+		rowColor = true;
+		String cabCoord = Messages.getText("coor_geograficas");
+		String propiedades = "";
+
+		String cabecera = setHTMLTitleTable(cabCoord, 2);
+
+		double pixelSizeX = lyr.getDataStore().getAffineTransform().getScaleX();
+		double pixelSizeY = lyr.getDataStore().getAffineTransform().getScaleY();
+
+		Extent ext = lyr.getFullRasterExtent();
+		propiedades += setHTMLBasicProperty(Messages.getText("ul"), ext.getULX() + ", " + ext.getULY());
+		propiedades += setHTMLBasicProperty(Messages.getText("lr"), ext.getLRX() + ", " + ext.getLRY());
+		propiedades += setHTMLBasicProperty(Messages.getText("ur"), ext.getURX() + ", " + ext.getURY());
+		propiedades += setHTMLBasicProperty(Messages.getText("ll"), ext.getLLX() + ", " + ext.getLLY());
+
+		double rotX = lyr.getDataStore().getAffineTransform().getShearX();
+		double rotY = lyr.getDataStore().getAffineTransform().getShearY();
+
+		propiedades += setHTMLBasicProperty(Messages.getText("tamPixX"), String.valueOf(pixelSizeX));
+		propiedades += setHTMLBasicProperty(Messages.getText("tamPixY"), String.valueOf(pixelSizeY));
+		propiedades += setHTMLBasicProperty(Messages.getText("rotX"), String.valueOf(rotX));
+		propiedades += setHTMLBasicProperty(Messages.getText( "rotY"), String.valueOf(rotY));
+
+		return "<br>" + setHTMLTable(cabecera + propiedades);
+	}
+
+	/**
+	 * M�todo que crea la tabla de origen de datos dentro del panel
+	 * de Informaci�n.
+	 *
+	 * @return String con el c�digo HTML de la tabla.
+	 */
+	public String tablaOrigen() {
+		rowColor = true;
+		String propiedades = "";
+		String bandType = "";
+
+		String cabOrig = Messages.getText("origin");
+
+		String cabecera = setHTMLTitleTable(cabOrig, 2);
+
+		for(int j = 0; j < lyr.getBandCountFromDataset()[selectedDataSet] ; j++) {
+			bandType = rManager.getRasterUtils().typesToString(lyr.getDataStore().getDataType()[j]);
+
+			String data = "";
+			data += "Type=" + bandType;
+			data += ", ";
+			data += "ColorInterp=" + lyr.getColorInterpretation(j, selectedDataSet);
+			if (lyr.getNoDataValue().isDefined()) {
+				data += ", ";
+				switch (lyr.getDataStore().getDataType()[0]) {
+				case org.gvsig.fmap.dal.coverage.dataset.Buffer.TYPE_BYTE:
+					data += "NoData=" + lyr.getNoDataValue().getValue().byteValue();
+					break;
+				case org.gvsig.fmap.dal.coverage.dataset.Buffer.TYPE_SHORT:
+					data += "NoData=" + lyr.getNoDataValue().getValue().shortValue();
+					break;
+				case org.gvsig.fmap.dal.coverage.dataset.Buffer.TYPE_INT:
+					data += "NoData=" + lyr.getNoDataValue().getValue().intValue();
+					break;
+				case org.gvsig.fmap.dal.coverage.dataset.Buffer.TYPE_FLOAT:
+					data += "NoData=" + lyr.getNoDataValue().getValue().floatValue();
+					break;
+				case org.gvsig.fmap.dal.coverage.dataset.Buffer.TYPE_DOUBLE:
+					data += "NoData=" + lyr.getNoDataValue().getValue().doubleValue();
+					break;
+				}
+			}
+
+			propiedades += setHTMLBasicProperty("Band " + (j + 1), data);
+
+			data = "";
+			try {
+				int count = lyr.getDataStore().getOverviewCount(j);
+				if (count > 0) {
+					for (int i = 0; i < count; i++) {
+						int w = lyr.getDataStore().getOverviewWidth(j, i);
+						int h = lyr.getDataStore().getOverviewHeight(j, i);
+						if(w != 0 && h != 0)
+							data += i + ": " + "(" + w + "X" + h + ")<BR>";
+					}
+					propiedades += setHTMLBasicProperty("Overviews", data);
+				}
+			} catch (BandAccessException e) {
+				logger.info("Error reading overviews", e);
+			} catch (RasterDriverException e) {
+				logger.info("Error reading overviews", e);
+			}
+		}
+
+		return "<br>" + setHTMLTable(cabecera + propiedades);
+	}
+
+	/**
+	 * M�todo para crear la tabla de proyecci�n del raster en el
+	 * panel de informaci�n de propiedades de raster.
+	 *
+	 * @return String con el c�digo HTML que genera la tabla de proyecci�n.
+	 */
+	public String tablaProjection() {
+		rowColor = true;
+		String propiedades = "";
+		String projection = null;
+
+		boolean datos = false;
+
+		String cabProjection = Messages.getText("projection");
+
+		String cabecera = setHTMLTitleTable(cabProjection, 1);
+
+		String wktProj = null;
+		try {
+			wktProj = lyr.getWktProjection();
+		} catch (RasterDriverException e) {
+			//No se obtiene la proyecci�n pero no hacemos nada al respecto
+		}
+
+		if(wktProj != null) {
+			projection = rManager.getRasterUtils().parserGdalProj(wktProj);
+			if (projection != null){
+				datos = true;
+				propiedades += setHTMLBasicProperty(null, projection);
+			}
+		}
+
+		if (datos == false) return "";
+
+		return "<br>" + setHTMLTable(cabecera + propiedades);
+	}
+
+	/**
+	 * M�todo para crear la tabla de informaci�n de metadatos del raster en el
+	 * panel de informaci�n de propiedades de raster.
+	 *
+	 * @param Vector
+	 *          con los georasterfiles cargados en la capa.
+	 * @return String con el c�digo HTML que genera la tabla.
+	 */
+	public String tablaMetadatos() {
+		rowColor = true;
+		String propiedades = "";
+		String[] metadatos = null;
+
+		Metadata meta = null;
+		boolean datos = false;
+
+		String cabMeta = Messages.getText("metadata");
+
+		String cabecera = setHTMLTitleTable(cabMeta, 2);
+
+		Metadata[] metaList = lyr.getDataStore().getMetadataByProvider();
+
+		meta = metaList[selectedDataSet];
+		if (meta != null) {
+			metadatos = meta.getMetadataString();
+			if(metadatos != null) {
+				for(int j = 0 ; j < metadatos.length ; j++) {
+					datos = true;
+					int index = metadatos[j].indexOf("=");
+
+					propiedades += setHTMLBasicProperty(metadatos[j].substring(0,index), metadatos[j].substring(index+1));
+				}
+			}
+		}
+
+		if(datos == false)
+			return "";
+
+		return "<br>" + setHTMLTable(cabecera + propiedades);
+	}
+
+	/**
+	 * M�todo que dibuja las tablas HTML del panel de informaci�n dentro de las
+	 * propiedades de r�ster. Se llama cada vez que se actualiza alg�n dato de las
+	 * tablas.
+	 *
+	 */
+	public void refresh() {
+		boolean refresh = false;
+		if (!jComboBoxEvent) {
+			// Set flag to ensure that an infinite loop is not created
+			jComboBoxEvent = true;
+
+			selectedDataSet = getJComboBox().getSelectedIndex();
+			if (selectedDataSet < 0) selectedDataSet = 0;
+
+			String nameFile = "";
+			URI[] uris = lyr.getDataStore().getURIByProvider();
+
+			getJComboBox().removeAllItems();
+			for (int i = 0; i < uris.length; i++) {
+			    URI uri = uris[i];
+			    if ("FILE".equalsIgnoreCase(uri.getScheme())){
+			        nameFile = uris[i].getPath();
+                    nameFile = FilenameUtils.getName(nameFile);
+			    }else{
+			        nameFile = uris[i].toString();
+			    }
+
+				getJComboBox().addItem(nameFile);
+			}
+			try {
+				// Select previous item
+				getJComboBox().setSelectedIndex(selectedDataSet);
+			} catch (IllegalArgumentException iae) {
+				selectedDataSet = 0;
+			}
+
+			jComboBoxEvent = false;
+			refresh = true;
+		}
+
+		String html = "";
+		if ((refresh) && (lyr.getDataStore().getProviderCount() >= 1)) {
+			html = setHTMLBody(tablaInfo() + tablaCoord() + tablaOrigen() + tablaProjection() + tablaMetadatos());
+		}
+
+		this.getJEditorPane().setContentType("text/html");
+		this.getJEditorPane().setText(html);
+		this.getJEditorPane().setCaretPosition(0);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.panelGroup.panels.AbstractPanel#setReference(java.lang.Object)
+	 */
+	public void setReference(Object ref) {
+		super.setReference(ref);
+
+		if (!(ref instanceof FLyrRaster))
+			return;
+
+		lyr = (FLyrRaster) ref;
+		refresh();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.panelGroup.panels.IPanel#selected()
+	 */
+	public void selected() {
+		refresh();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.panelGroup.panels.IPanel#accept()
+	 */
+	public void accept() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.panelGroup.panels.IPanel#apply()
+	 */
+	public void apply() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.panelGroup.panels.IPanel#cancel()
+	 */
+	public void cancel() {
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/InfoPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/EnhancedBrightnessContrastPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/EnhancedBrightnessContrastPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/EnhancedBrightnessContrastPanel.java	(revision 8183)
@@ -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.tools.app.basic.tool.properties.panel;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JCheckBox;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.gui.beans.slidertext.SliderTextContainer;
+import org.gvsig.gui.beans.slidertext.listeners.SliderListener;
+
+/**
+ * Panel para los controles de brillo y contrase .
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class EnhancedBrightnessContrastPanel extends JPanel implements ActionListener {
+	private static final long serialVersionUID = -475762560608930500L;
+	private InternalPanel     internalPanel    = null;
+	private JCheckBox         active           = null;
+
+	/**
+	 * Panel con los controles deslizantes de brillo y contraste
+	 * 
+	 * @author Nacho Brodin (nachobrodin@gmail.com)
+	 */
+	class InternalPanel extends JPanel {
+		final private static long	serialVersionUID = 0;
+		protected SliderTextContainer brightness = null;
+		protected SliderTextContainer contrast = null;
+
+		/**
+		 * Contructor
+		 */
+		public InternalPanel() {
+			brightness = new SliderTextContainer(-255, 255, 0, false);
+			contrast = new SliderTextContainer(-255, 255, 0, false);
+			brightness.setBorder(PluginServices.getText(this, "brillo"));
+			contrast.setBorder(PluginServices.getText(this, "contraste"));
+			init();
+		}
+
+		private void init() {
+			this.setLayout(new GridLayout(2, 1));
+			this.add(brightness);
+			this.add(contrast);
+		}
+
+		/**
+		 * Activa o desactiva el control
+		 * @param enable true activa y false desactiva los controles del panel
+		 */
+		public void setControlEnabled(boolean enabled) {
+			brightness.setControlEnabled(enabled);
+			contrast.setControlEnabled(enabled);
+		}
+	}
+
+	/**
+	 * Contructor
+	 */
+	public EnhancedBrightnessContrastPanel() {
+		super();
+		internalPanel = new InternalPanel();
+		initialize();
+	}
+
+	private void initialize() {
+		setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this, "brillo_y_contraste"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+		setLayout(new BorderLayout());
+		add(getActive(), BorderLayout.NORTH);
+		add(internalPanel, BorderLayout.CENTER);
+		getActive().addActionListener(this);
+		this.setPreferredSize(new Dimension(100, 80));
+	}
+
+	/**
+	 * Obtiene el check de activar
+	 * @return
+	 */
+	public JCheckBox getActive() {
+		if (active == null) {
+			active = new JCheckBox(PluginServices.getText(this, "activar"));
+			active.setSelected(false);
+			setControlEnabled(false);
+		}
+		return active;
+	}
+
+	/**
+	 * Activa o desactiva el control
+	 * @param enable true activa y false desactiva los controles del panel
+	 */
+	public void setControlEnabled(boolean enabled){
+		this.getActive().setSelected(enabled);
+		internalPanel.setControlEnabled(enabled);
+	}
+
+	/**
+	 * Obtiene el valor del brillo que hay seleccionado en el control
+	 * @return double que representa el contraste seleccionado. Puede hacerse un casting a entero ya que 
+	 * no se consideran decimales
+	 */
+	public double getBrightnessValue(){
+		return internalPanel.brightness.getValue();
+	}
+
+	/**
+	 * Obtiene el valor del contraste que hay seleccionado en el control
+	 * @return double que representa el contraste seleccionado. Puede hacerse un casting a entero ya que 
+	 * no se consideran decimales
+	 */
+	public double getContrastValue(){
+		return internalPanel.contrast.getValue();
+	}
+
+	/**
+	 * Asigna el valor del brillo al control
+	 * @param value
+	 */
+	public void setBrightnessValue(double value){
+		internalPanel.brightness.setValue(value);
+	}
+
+	/**
+	 * Asigna el valor del contraste al control
+	 * @param value
+	 */
+	public void setContrastValue(double value){
+		internalPanel.contrast.setValue(value);
+	}
+
+	/**
+	 * A�ade un listener para el slider de brillo
+	 * @param l ChangeListener
+	 */
+	public void addBrightnessValueChangedListener(SliderListener l){
+		internalPanel.brightness.addValueChangedListener(l);
+	}
+
+	/**
+	 * A�ade un listener para el slider de contraste
+	 * @param l ChangeListener
+	 */
+	public void addContrastValueChangedListener(SliderListener l){
+		internalPanel.contrast.addValueChangedListener(l);
+	}
+
+	/**
+	 * Maneja eventos de activar y desactivar el panel
+	 */
+	public void actionPerformed(ActionEvent e) {
+		if (e.getSource() == getActive()) {
+			if (getActive().isSelected())
+				setControlEnabled(true);
+			else
+				setControlEnabled(false);
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/EnhancedBrightnessContrastPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/EnhancedWithTrimPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/EnhancedWithTrimPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/EnhancedWithTrimPanel.java	(revision 8183)
@@ -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.tools.app.basic.tool.properties.panel;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JCheckBox;
+import javax.swing.JPanel;
+
+import org.gvsig.gui.beans.slidertext.SliderTextContainer;
+import org.gvsig.i18n.Messages;
+
+/**
+ * Panel para los controles de brillo y contraste.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class EnhancedWithTrimPanel extends JPanel implements ActionListener {
+	private static final long   serialVersionUID = 9023137365069951866L;
+	private JCheckBox           active           = null;
+	private SliderTextContainer trimSlider       = null;
+	private JCheckBox           removeCheck      = null;
+	private JCheckBox           trimCheck        = null;
+	
+	/**
+	 * Contructor
+	 */
+	public EnhancedWithTrimPanel() {
+		super();
+		init();
+	}
+
+	private void init() {
+		setBorder(javax.swing.BorderFactory.createTitledBorder(null, Messages.getText("realce"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+		setLayout(new GridBagLayout());
+		GridBagConstraints gbc = new GridBagConstraints();
+		gbc.anchor = GridBagConstraints.NORTH;
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.weightx = 1;
+		gbc.insets = new Insets(0, 0, 10, 0);
+		add(getActive(), gbc);
+		gbc.gridy = 1;
+		add(getRemoveCheck(), gbc);		
+		gbc.gridy = 2;
+		add(getTrimCheck(), gbc);		
+		gbc.gridy = 3;
+		add(getTrimSlider(), gbc);		
+		getActive().addActionListener(this);
+		getTrimCheck().addActionListener(this);
+	}
+	
+	/**
+	 * Obtiene el check de activar
+	 * @return
+	 */
+	public JCheckBox getActive() {
+		if (active == null) {
+			active = new JCheckBox(Messages.getText("activar"));
+			active.setSelected(false);
+			this.setControlEnabled(false);
+		}
+		return active;
+	}
+	
+	/**
+	 * Obtiene el check de eliminar extremos
+	 * @return
+	 */
+	public JCheckBox getRemoveCheck() {
+		if (removeCheck == null) {
+			removeCheck = new JCheckBox(Messages.getText("eliminar_extremos"));
+		}
+		return removeCheck;
+	}
+	
+	/**
+	 * Obtiene el check de recorte de colas
+	 * @return
+	 */
+	public JCheckBox getTrimCheck() {
+		if (trimCheck == null) {
+			trimCheck = new JCheckBox(Messages.getText("recorte_de_colas"));
+		}
+		return trimCheck;
+	}
+	
+	/**
+	 * Obtiene el control con el slider de recorte de colas
+	 * @return SliderTextContainer
+	 */
+	public SliderTextContainer getTrimSlider() {
+		if (trimSlider == null) {
+			trimSlider = new SliderTextContainer(0, 50, 0, false);
+			trimSlider.setDecimal(true);
+			trimSlider.setBorder("");
+		}
+		return trimSlider;
+	}
+	
+	/**
+	 * Activa o desactiva el control
+	 * @param enable true activa y false desactiva los controles del panel
+	 */
+	public void setControlEnabled(boolean enabled) {
+		if (enabled && getTrimCheck().isSelected())
+			getTrimSlider().setControlEnabled(true);
+		else
+			getTrimSlider().setControlEnabled(false);
+		getRemoveCheck().setEnabled(enabled);
+		getTrimCheck().setEnabled(enabled);
+		
+		getActive().setSelected(enabled);
+	}
+	
+	/**
+	 * Maneja eventos de activar y desactivar el panel
+	 */
+	public void actionPerformed(ActionEvent e) {
+		if (e.getSource() == getActive()) {
+			if (getActive().isSelected())
+				setControlEnabled(true);
+			else
+				setControlEnabled(false);
+		}
+		if (e.getSource() == getTrimCheck())
+			getTrimSlider().setControlEnabled(getTrimCheck().isSelected());
+	}
+
+	/**
+	 * Obtiene el valor de selecci�n del check de eliminar extremos
+	 * @return boolean, true si est� seleccionado y false si no lo est�. 
+	 */
+	public boolean isRemoveEndsSelected() {
+		return getRemoveCheck().isSelected();
+	}
+
+	/**
+	 * Obtiene el valor de selecci�n del check de recorte de colas.
+	 * @return boolean, true si est� seleccionado y false si no lo est�.
+	 */
+	public boolean isTailTrimCheckSelected() {
+		return getTrimCheck().isSelected();
+	}
+
+	/**
+	 * Obtiene el valor de recorte de colas seleccionado en el slider
+	 * @return double
+	 */
+	public double getTrimValue() {
+		return getTrimSlider().getValue();
+	}
+
+	/**
+	 * Activa o desactiva el checkbox de recorte de colas
+	 * @param active true si deseamos activarlo y false para desactivarlo
+	 */
+	public void setTailTrimCheckActive(boolean active) {
+		getTrimCheck().setSelected(active);
+		getTrimSlider().setControlEnabled(active);
+	}
+
+	/**
+	 * Activa o desactiva el checkbox de eliminar extremos
+	 * @param active true si deseamos activarlo y false para desactivarlo
+	 */
+	public void setRemoveEndsActive(boolean active) {
+		getRemoveCheck().setSelected(active);
+	}
+
+	/**
+	 * Asigna un valor al slider de porcentaje de recorte
+	 * @param active true si deseamos activarlo y false para desactivarlo
+	 */
+	public void setTailTrimValue(double value) {
+		getTrimSlider().setValue(value);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/EnhancedWithTrimPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/GeneralPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/GeneralPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/GeneralPanel.java	(revision 8183)
@@ -0,0 +1,634 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+package org.gvsig.raster.tools.app.basic.tool.properties.panel;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+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.text.NumberFormat;
+
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JEditorPane;
+import javax.swing.JFormattedTextField;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.border.TitledBorder;
+import javax.swing.text.DefaultFormatterFactory;
+import javax.swing.text.NumberFormatter;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.gui.beans.panelGroup.panels.AbstractPanel;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.layers.IRasterLayerActions;
+import org.gvsig.raster.mainplugin.properties.RasterPropertiesTocMenuEntry;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.raster.process.IProcessActions;
+import org.gvsig.raster.tools.app.basic.raster.process.RasterProcess;
+import org.gvsig.raster.tools.app.basic.raster.process.StatisticsProcess;
+
+/**
+ * Main panel of Properties window. This panel contains general options.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class GeneralPanel extends AbstractPanel implements ActionListener, IProcessActions {
+	private static final long   serialVersionUID = -4761218260868307869L;
+	private FLyrRaster          fLayer              = null;
+
+	private JLabel              labelNotShowLayer   = null;
+	private JLabel              labelMinim          = null;
+	private JLabel              labelMaxim          = null;
+	private JCheckBox           checkBoxMinim       = null;
+	private JCheckBox           checkBoxMaxim       = null;
+	private JFormattedTextField textFieldMinim      = null;
+	private JFormattedTextField textFieldMaxim      = null;
+
+	private NumberFormat        doubleDisplayFormat = null;
+	private NumberFormat        doubleEditFormat    = null;
+	private double              initMaxScale        = -1;
+	private double              initMinScale        = -1;
+
+	private JButton             calcButton          = null;
+	private JPanel              scalePanel          = null;
+	private JPanel              recalcStatsPanel    = null;
+	private NoDataPanel      pNoDataPanel        = null;
+	//private Transparency        transparency        = null;
+
+	private JScrollPane         jScrollPane         = null;
+	private JEditorPane         jEditorPane         = null;
+
+	private final String        bgColor0            = "\"#FEEDD6\""; // light salmon
+	private final String        bgColor1            = "\"#EAEAEA\""; // light grey
+	private final String        bgColor3            = "\"#FBFFE1\""; // light yellow
+	private final String        bgColor4            = "\"#D6D6D6\""; // Gris
+
+	/**
+	 * Booleano que est� a true cuando la fila a dibujar es par y a false cuando
+	 * es impar.
+	 */
+	private boolean             rowColor            = true;
+
+
+	/**
+	 * Constructor del GeneralPanel
+	 */
+	public GeneralPanel() {
+		super();
+		setUpFormats();
+		initialize();
+		translate();
+	}
+
+	/**
+	 * Create and set up number formats. These objects also parse numbers input by
+	 * user.
+	 */
+	private void setUpFormats() {
+		doubleDisplayFormat = NumberFormat.getNumberInstance();
+		doubleDisplayFormat.setMinimumFractionDigits(0);
+		doubleEditFormat = NumberFormat.getNumberInstance();
+	}
+
+	/**
+	 * Asigna todos los textos del panel en su idioma correspondiente
+	 */
+	private void translate() {
+		getJLabelNotShowLayer().setText(PluginServices.getText(this, "no_mostrar_la_capa_cuando_la_escala_sea") + ":");
+		getJLabelMinim().setText("(" + PluginServices.getText(this, "escala_maxima") + ")");
+		getJLabelMaxim().setText("(" + PluginServices.getText(this, "escala_minima") + ")");
+		getJCheckBoxMinim().setText(PluginServices.getText(this, "mayor_de") + " 1:");
+		getJCheckBoxMaxim().setText(PluginServices.getText(this, "menor_de") + " 1:");
+		getScalePanel().setBorder(BorderFactory.createTitledBorder(PluginServices.getText(this, "rango_de_escalas")));
+		getRecalcStatsPanel().setBorder(BorderFactory.createTitledBorder(PluginServices.getText(this, "stats")));
+		setLabel(PluginServices.getText(this, "general"));
+	}
+
+	/**
+	 * Construye el panel
+	 */
+	protected void initialize() {
+		GridBagConstraints gridBagConstraints;
+		setLayout(new GridBagLayout());
+		gridBagConstraints = new java.awt.GridBagConstraints();
+		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.weightx = 1.0;
+		add(getScalePanel(), gridBagConstraints);
+
+		gridBagConstraints = new java.awt.GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		add(getNoDataPanel(), gridBagConstraints);
+
+		gridBagConstraints = new java.awt.GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 2;
+		gridBagConstraints.weighty = 1.0;
+		gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+		add(getRecalcStatsPanel(), gridBagConstraints);
+
+		this.setPreferredSize(new Dimension(100, 80));
+
+		this.setPriority(90);
+	}
+
+
+	private void actionEnabled() {
+		IRasterLayerActions actions = null;
+		if(fLayer instanceof IRasterLayerActions)
+			actions = ((IRasterLayerActions) fLayer);
+
+		if (!actions.isActionEnabled(IRasterLayerActions.STATS))
+			getRecalcStatsPanel().setVisible(false);
+
+		if (!actions.isActionEnabled(IRasterLayerActions.NODATA))
+			getNoDataPanel().setVisible(false);
+	}
+
+	/**
+	 * This method initializes TranspOpacitySliderPanel
+	 * @return javax.swing.JPanel
+	 */
+	public NoDataPanel getNoDataPanel() {
+		if (pNoDataPanel == null) {
+			pNoDataPanel = new NoDataPanel();
+			pNoDataPanel.setBorder(BorderFactory.createTitledBorder(null, PluginServices.getText(this, "nodata"), TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));
+		}
+
+		return pNoDataPanel;
+	}
+
+	public JPanel getScalePanel() {
+		if (scalePanel == null) {
+			scalePanel = new JPanel();
+			scalePanel.setLayout(new GridBagLayout());
+
+			GridBagConstraints gridBagConstraints;
+
+			int y = 0;
+			gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.gridx = 0;
+			gridBagConstraints.gridy = y;
+			gridBagConstraints.gridwidth = 3;
+			gridBagConstraints.anchor = GridBagConstraints.WEST;
+			gridBagConstraints.insets = new Insets(2, 2, 2, 2);
+			scalePanel.add(getJLabelNotShowLayer(), gridBagConstraints);
+
+			y++;
+			gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.gridx = 0;
+			gridBagConstraints.gridy = y;
+			gridBagConstraints.insets = new Insets(2, 2, 2, 0);
+			gridBagConstraints.anchor = GridBagConstraints.WEST;
+			scalePanel.add(getJCheckBoxMinim(), gridBagConstraints);
+
+			gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.gridx = 1;
+			gridBagConstraints.gridy = y;
+			gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+			gridBagConstraints.weightx = 1.0;
+			gridBagConstraints.insets = new Insets(2, 0, 2, 2);
+			scalePanel.add(getJTextFieldMinim(), gridBagConstraints);
+
+			gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.gridx = 2;
+			gridBagConstraints.gridy = y;
+			gridBagConstraints.insets = new Insets(2, 2, 2, 2);
+			gridBagConstraints.anchor = GridBagConstraints.WEST;
+			scalePanel.add(getJLabelMinim(), gridBagConstraints);
+
+			y++;
+			gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.gridx = 0;
+			gridBagConstraints.gridy = y;
+			gridBagConstraints.insets = new Insets(2, 2, 2, 0);
+			gridBagConstraints.anchor = GridBagConstraints.WEST;
+			scalePanel.add(getJCheckBoxMaxim(), gridBagConstraints);
+
+			gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.gridx = 1;
+			gridBagConstraints.gridy = y;
+			gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+			gridBagConstraints.weightx = 1.0;
+			gridBagConstraints.insets = new Insets(2, 0, 2, 2);
+			scalePanel.add(getJTextFieldMaxim(), gridBagConstraints);
+
+			gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.gridx = 2;
+			gridBagConstraints.gridy = y;
+			gridBagConstraints.insets = new Insets(2, 2, 2, 2);
+			gridBagConstraints.anchor = GridBagConstraints.WEST;
+			scalePanel.add(getJLabelMaxim(), gridBagConstraints);
+
+			y++;
+			gridBagConstraints = new GridBagConstraints();
+			gridBagConstraints.gridx = 0;
+			gridBagConstraints.gridy = y;
+			gridBagConstraints.gridwidth = 3;
+			gridBagConstraints.fill = GridBagConstraints.BOTH;
+			gridBagConstraints.weightx = 1.0;
+			gridBagConstraints.weighty = 1.0;
+			JPanel emptyPanel = new JPanel();
+			emptyPanel.setMinimumSize(new Dimension(0, 0));
+			scalePanel.add(emptyPanel, gridBagConstraints);
+		}
+		return scalePanel;
+	}
+
+	public JPanel getRecalcStatsPanel() {
+		if (recalcStatsPanel == null) {
+			recalcStatsPanel = new JPanel();
+			recalcStatsPanel.setLayout(new BorderLayout(5, 5));
+
+			recalcStatsPanel.add(getJScrollPane(), BorderLayout.CENTER);
+			recalcStatsPanel.add(getCalcStatsButton(), BorderLayout.SOUTH);
+		}
+		return recalcStatsPanel;
+	}
+
+	/**
+	 * Bot�n para recalcular las estadisticas.
+	 * @return JButton
+	 */
+	public JButton getCalcStatsButton() {
+		if(calcButton == null) {
+			calcButton = new JButton(RasterToolsUtil.getText(this, "recalc_stats"));
+			calcButton.addActionListener(this);
+		}
+		return calcButton;
+	}
+
+	private JLabel getJLabelNotShowLayer() {
+		if (labelNotShowLayer == null) {
+			labelNotShowLayer = new JLabel();
+		}
+		return labelNotShowLayer;
+	}
+
+	private JFormattedTextField getJTextFieldMinim() {
+		if (textFieldMinim == null) {
+			textFieldMinim = new JFormattedTextField(new DefaultFormatterFactory(
+					new NumberFormatter(doubleDisplayFormat),
+					new NumberFormatter(doubleDisplayFormat),
+					new NumberFormatter(doubleEditFormat)));
+			textFieldMinim.setEnabled(false);
+			textFieldMinim.setBackground(getBackground());
+		}
+		return textFieldMinim;
+	}
+
+	private JFormattedTextField getJTextFieldMaxim() {
+		if (textFieldMaxim == null) {
+			textFieldMaxim = new JFormattedTextField(new DefaultFormatterFactory(
+					new NumberFormatter(doubleDisplayFormat),
+					new NumberFormatter(doubleDisplayFormat),
+					new NumberFormatter(doubleEditFormat)));
+			textFieldMaxim.setEnabled(false);
+			textFieldMaxim.setBackground(getBackground());
+		}
+		return textFieldMaxim;
+	}
+
+	private JCheckBox getJCheckBoxMinim() {
+		if (checkBoxMinim == null) {
+			checkBoxMinim = new JCheckBox();
+			checkBoxMinim.addActionListener(this);
+			checkBoxMinim.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
+			checkBoxMinim.setMargin(new java.awt.Insets(0, 0, 0, 0));
+		}
+		return checkBoxMinim;
+	}
+
+	private JLabel getJLabelMinim() {
+		if (labelMinim == null) {
+			labelMinim = new JLabel();
+			labelMinim.setEnabled(false);
+		}
+		return labelMinim;
+	}
+
+	private JCheckBox getJCheckBoxMaxim() {
+		if (checkBoxMaxim == null) {
+			checkBoxMaxim = new JCheckBox();
+			checkBoxMaxim.addActionListener(this);
+			checkBoxMaxim.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
+			checkBoxMaxim.setMargin(new java.awt.Insets(0, 0, 0, 0));
+		}
+		return checkBoxMaxim;
+	}
+
+	private JLabel getJLabelMaxim() {
+		if (labelMaxim == null) {
+			labelMaxim = new JLabel();
+			labelMaxim.setEnabled(false);
+		}
+		return labelMaxim;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+	 */
+	public void actionPerformed(ActionEvent e) {
+		if (e.getSource() == getJCheckBoxMinim()) {
+			boolean enabled = getJCheckBoxMinim().isSelected();
+			getJLabelMinim().setEnabled(enabled);
+			getJTextFieldMinim().setEnabled(enabled);
+			getJTextFieldMinim().setBackground(enabled?Color.white: getBackground());
+		}
+
+		if (e.getSource() == getCalcStatsButton()) {
+			RasterProcess process = new StatisticsProcess();
+			process.addParam("layer", fLayer);
+			process.addParam("force", new Boolean(true));
+			process.setActions(this);
+			process.start();
+		}
+
+		if (e.getSource() == getJCheckBoxMaxim()) {
+			boolean enabled = getJCheckBoxMaxim().isSelected();
+			getJLabelMaxim().setEnabled(enabled);
+			getJTextFieldMaxim().setEnabled(enabled);
+			getJTextFieldMaxim().setBackground(enabled?Color.white: getBackground());
+		}
+	}
+
+	/**
+	 * Controla la alternatividad de colores en la tabla.
+	 *
+	 * @return Cadena con el color de la fila siguiente.
+	 */
+	private String getColor() {
+		String color = (rowColor ? bgColor0 : bgColor1);
+		rowColor = !rowColor;
+		return color;
+	}
+
+	/**
+	 * Obtiene una entrada de la tabla en formato HTML a partir de una propiedad,
+	 * un valor y un color.
+	 *
+	 * @param prop
+	 *          Nombre de la propiedad
+	 * @param value
+	 *          Valor
+	 * @param color
+	 *          Color
+	 *
+	 * @return Entrada HTML de la tabla
+	 */
+	private String setHTMLBasicProperty(String prop, String value) {
+		String content = "<tr valign=\"top\">";
+		if (prop != null)
+			content += "<td bgcolor=" + bgColor4 + "align=\"right\" width=\"140\"><font face=\"Arial\" size=\"3\">" + prop + ":&nbsp;</font></td>";
+		content += "<td bgcolor=" + getColor() + "align=\"left\"><font face=\"Arial\" size=\"3\">" + value + "</font></td>";
+		content += "</tr>";
+
+		return content;
+	}
+
+	/**
+	 * Obtiene una cabecera de tabla en formato HTML a partir de un titulo.
+	 *
+	 * @param title
+	 *          Nombre del titulo
+	 * @param colspan
+	 *          Numero de celdas que ocupara el titulo
+	 *
+	 * @return Entrada HTML del titulo
+	 */
+	private String setHTMLTitleTable(String title, int colspan) {
+		return
+			"<tr valign=\"middle\" >" +
+			"<td bgcolor=" + bgColor3 + " align=\"center\" colspan=\"" + colspan + "\"><font face=\"Arial\" size=\"3\"><b> " + title + "</b></font></td>" +
+			"</tr>";
+	}
+
+	/**
+	 * Obtiene una cabecera de tabla en formato HTML a partir de un titulo.
+	 *
+	 * @param content
+	 *          Codigo HTML de las filas que componen la tabla.
+	 *
+	 * @return Entrada HTML de la tabla completa
+	 */
+	private String setHTMLTable(String content) {
+		return "<table cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\">" + content + "</table>";
+	}
+
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.panelGroup.panels.AbstractPanel#setReference(java.lang.Object)
+	 */
+	public void setReference(Object ref) {
+		super.setReference(ref);
+
+		if (!(ref instanceof FLyrRaster))
+			return;
+
+		fLayer = (FLyrRaster) ref;
+
+		actionEnabled();
+
+		getNoDataPanel().setLayer(fLayer);
+
+		if (fLayer.getMaxScale() != -1) {
+			initMaxScale = fLayer.getMaxScale();
+			getJTextFieldMaxim().setValue(
+					Double.valueOf(fLayer.getMaxScale()));
+			getJCheckBoxMaxim().setSelected(true);
+			getJLabelMaxim().setEnabled(true);
+			getJTextFieldMaxim().setEnabled(true);
+			getJTextFieldMaxim().setBackground(Color.WHITE);
+		}
+
+		if (fLayer.getMinScale() != -1) {
+			initMinScale = fLayer.getMinScale();
+			getJTextFieldMinim().setValue(
+					Double.valueOf(fLayer.getMinScale()));
+			getJCheckBoxMinim().setSelected(true);
+			getJLabelMinim().setEnabled(true);
+			getJTextFieldMinim().setEnabled(true);
+			getJTextFieldMinim().setBackground(Color.WHITE);
+		}
+
+		refreshHTMLStatistics();
+		setValuesFromPanelToTransparency();
+	}
+
+	/**
+	 * Refresca el HTML del cuadro de texto de las estadisticas de todas las capas
+	 */
+	private void refreshHTMLStatistics() {
+		String html = "";
+		Statistics statistics = null;
+		statistics = fLayer.getDataStore().getStatistics();
+		if(statistics == null)
+			return;
+
+		if (statistics.isCalculated()) {
+			double[] maxRGB = statistics.getMaxByteUnsigned();
+			double[] max = statistics.getMax();
+			double[] minRGB = statistics.getMinByteUnsigned();
+			double[] min = statistics.getMin();
+			double[] variance = statistics.getVariance();
+			double[] mean = statistics.getMean();
+
+			if(max != null) {
+				for (int i = 0; i < max.length; i++) {
+					html += setHTMLTitleTable(Messages.getText("band") + " " + (i + 1), 2);
+					html += setHTMLBasicProperty(Messages.getText("minimo"), Double.valueOf(min[i]).toString());
+					html += setHTMLBasicProperty(Messages.getText("maximo"), Double.valueOf(max[i]).toString());
+					html += setHTMLBasicProperty(Messages.getText("minimoRGB"), Double.valueOf(minRGB[i]).toString());
+					html += setHTMLBasicProperty(Messages.getText("maximoRGB"), Double.valueOf(maxRGB[i]).toString());
+					html += setHTMLBasicProperty(Messages.getText("media"), Double.valueOf(mean[i]).toString());
+					html += setHTMLBasicProperty(Messages.getText("varianza"), Double.valueOf(variance[i]).toString());
+				}
+			}
+			html = setHTMLTable(html);
+		} else {
+			html += setHTMLTitleTable(Messages.getText("no_statistics_computed"), 2);
+			html = setHTMLTable(html);
+		}
+		getJEditorStatsPanel().setText(html);
+		getJEditorStatsPanel().setCaretPosition(0);
+	}
+
+	/**
+	 * This method initializes jScrollPane
+	 *
+	 * @return javax.swing.JScrollPane
+	 */
+	private JScrollPane getJScrollPane() {
+		if (jScrollPane == null) {
+			jScrollPane = new JScrollPane();
+			jScrollPane.setViewportView(getJEditorStatsPanel());
+		}
+		return jScrollPane;
+	}
+
+	/**
+	 * This method initializes jEditorPane
+	 *
+	 * @return javax.swing.JEditorPane
+	 */
+	private JEditorPane getJEditorStatsPanel() {
+		if (jEditorPane == null) {
+			jEditorPane = new JEditorPane();
+			jEditorPane.setEditable(false);
+			jEditorPane.setContentType("text/html");
+		}
+		return jEditorPane;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.gui.properties.dialog.IRegistrablePanel#accept()
+	 */
+	public void accept() {
+		onlyApply();
+	}
+
+	/**
+	 * Asigna los valores del panel a la transparencia de la capa.
+	 */
+	private void setValuesFromPanelToTransparency() {
+		if (fLayer == null || fLayer.getDataStore() == null)
+			return;
+
+		fLayer.setNoDataTransparent(getNoDataPanel().getCheckBoxNoDataEnabled().isSelected());
+
+		// Redibujamos
+		fLayer.getMapContext().invalidate();
+	}
+
+	/**
+	 * Aplica el estado del panel a la capa.
+	 */
+	public void onlyApply() {
+		if (RasterPropertiesTocMenuEntry.enableEvents)
+			setValuesFromPanelToTransparency();
+
+		if (fLayer == null)
+			return;
+
+		double maxScale = -1;
+		double minScale = -1;
+
+		if (getJCheckBoxMaxim().isSelected() && getJTextFieldMaxim().getValue() != null)
+			maxScale = ((Number) getJTextFieldMaxim().getValue()).doubleValue();
+
+		if (getJCheckBoxMinim().isSelected() && getJTextFieldMinim().getValue() != null)
+			minScale = ((Number) getJTextFieldMinim().getValue()).doubleValue();
+
+		fLayer.setMaxScale(maxScale);
+		fLayer.setMinScale(minScale);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.gui.properties.dialog.IRegistrablePanel#apply()
+	 */
+	public void apply() {
+		onlyApply();
+	}
+
+	/**
+	 * Restaura los valores de la capa conforme estaba al abrir el panel
+	 */
+	public void restoreStatus() {
+		//fLayer.setNoDataValue(((Double) getPanelGroup().getProperties().get("nodatavalue")).doubleValue());
+
+		fLayer.setMaxScale(initMaxScale);
+		fLayer.setMinScale(initMinScale);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.gui.properties.dialog.IRegistrablePanel#cancel()
+	 */
+	public void cancel() {
+		restoreStatus();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.IProcessActions#end(java.lang.Object)
+	 */
+	public void end(Object param) {
+		refreshHTMLStatistics();
+	}
+
+	public void selected() {}
+	public void interrupted() {}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/GeneralPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TranspByPixelRGBInputPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TranspByPixelRGBInputPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TranspByPixelRGBInputPanel.java	(revision 8183)
@@ -0,0 +1,256 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.properties.panel;
+
+import java.awt.Color;
+
+import javax.swing.JPanel;
+
+import org.gvsig.gui.beans.checkslidertext.CheckColorSliderTextContainer;
+import org.gvsig.gui.beans.doubleslider.DoubleSliderEvent;
+import org.gvsig.gui.beans.doubleslider.DoubleSliderListener;
+/**
+ * Panel con los 3 campos para introducir listas de valores RGB. Este gestiona
+ * los eventos de FocusListener para validar que los valores que se introducen
+ * son correctos. Si el TextField pierde el foco y tiene un valor incorrecto
+ * resetea el contenido. Los m�todos publicos getRangeXXX devuelven el intervalo
+ * de valores en forma de array multidimensional de 2xN elementos. Cada pareja
+ * de valores es un rango de color en ese valor de pixel. Un rango de valores
+ * podria ser por ejemplo {{1,3},{15,30},{200, 255}}
+ *
+ * @author Nacho Brodin (brodin_ign@gva.es)
+ */
+public class TranspByPixelRGBInputPanel extends JPanel implements DoubleSliderListener {
+	private static final long     serialVersionUID = 5858119425941331458L;
+	private int[]                 rangeRed   = null;
+	private int[]                 rangeGreen = null;
+	private int[]                 rangeBlue  = null;
+	CheckColorSliderTextContainer tRed       = null;
+	CheckColorSliderTextContainer tGreen     = null;
+	CheckColorSliderTextContainer tBlue      = null;
+	CheckColorSliderTextContainer tAlpha     = null;
+
+	/**
+	 * This is the default constructor
+	 */
+	public TranspByPixelRGBInputPanel() {
+		super();
+		initialize();
+		updateColors();
+		validateValues();
+	}
+
+	/**
+	 * This method initializes this
+	 *
+	 * @return void
+	 */
+	private void initialize() {
+		this.setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.Y_AXIS));
+		this.add(getTRed());
+		this.add(getTGreen());
+		this.add(getTBlue());
+		this.add(getTAlpha());
+		this.getTBlue().addValueChangedListener(this);
+		this.getTGreen().addValueChangedListener(this);
+		this.getTRed().addValueChangedListener(this);
+		this.getTAlpha().addValueChangedListener(this);
+	}
+
+	/**
+	 * This method initializes jTextField
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	public CheckColorSliderTextContainer getTRed() {
+		if (tRed == null) {
+			tRed = new CheckColorSliderTextContainer(0, 255, 0, "R", true);
+		}
+		return tRed;
+	}
+
+	/**
+	 * This method initializes jTextField
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	public CheckColorSliderTextContainer getTAlpha() {
+		if (tAlpha == null) {
+			tAlpha = new CheckColorSliderTextContainer(0, 255, 255, "A", false);
+			tAlpha.setColor2(this.getBackground(), true);
+		}
+		return tAlpha;
+	}
+
+	/**
+	 * This method initializes jTextField1
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	public CheckColorSliderTextContainer getTGreen() {
+		if (tGreen == null) {
+			tGreen = new CheckColorSliderTextContainer(0, 255, 0, "G", true);
+		}
+		return tGreen;
+	}
+
+	/**
+	 * This method initializes jTextField2
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	public CheckColorSliderTextContainer getTBlue() {
+		if (tBlue == null) {
+			tBlue = new CheckColorSliderTextContainer(0, 255, 0, "B", true);
+		}
+		return tBlue;
+	}
+
+	/**
+	 * Obtiene la lista de valores del campo Blue.
+	 *
+	 * @return array multidimensional con los intervalos
+	 */
+	public int[] getRangeBlue() {
+		return rangeBlue;
+	}
+
+	/**
+	 * Obtiene la lista de valores del campo Green.
+	 * @return array multidimensional con los intervalos
+	 */
+	public int[] getRangeGreen() {
+		return rangeGreen;
+	}
+
+	/**
+	 * Obtiene la lista de valores del campo Red.
+	 * @return array multidimensional con los intervalos
+	 */
+	public int[] getRangeRed() {
+		return rangeRed;
+	}
+
+	/**
+	 * Activa o desactiva el control
+	 * @param enable True activa el control y false lo desactiva
+	 */
+	public void setControlEnabled(boolean enabled){
+		getTRed().setEnabled(enabled);
+		getTGreen().setEnabled(enabled);
+		getTBlue().setEnabled(enabled);
+		getTAlpha().setEnabled(enabled);
+	}
+
+	/**
+	 * Asigna el n�mero de bandas activas
+	 * @param n N�mero de bandas
+	 */
+	public void setActiveBands(int n){
+		this.getTRed().setEnabled(true);
+		switch (n) {
+			case 1:
+				this.getTGreen().setEnabled(false);
+				this.getTBlue().setEnabled(false);
+				break;
+			case 2:
+				this.getTGreen().setEnabled(true);
+				this.getTBlue().setEnabled(false);
+				break;
+			case 3:
+				this.getTGreen().setEnabled(true);
+				this.getTBlue().setEnabled(true);
+				break;
+		}
+	}
+
+	/**
+	 * Limpia el valor de las cajas de texto R, G y B
+	 */
+	public void clear(){
+		getTRed().setValue(0);
+		getTGreen().setValue(0);
+		getTBlue().setValue(0);
+		getTRed().setControlEnabled(true);
+		getTGreen().setControlEnabled(true);
+		getTBlue().setControlEnabled(true);
+	}
+
+	/**
+	 * Actualiza los colores de los componentes de seleccion de color, el ultimo
+	 * parametro true o false es para que haga o no un refresco del componente, lo
+	 * hacemos solo una vez por componente para que consuma menos CPU
+	 */
+	public void updateColors() {
+		int r = tRed.getValue();
+		int g = tGreen.getValue();
+		int b = tBlue.getValue();
+
+		if (!tRed.isChecked()) r = 0;
+		if (!tGreen.isChecked()) g = 0;
+		if (!tBlue.isChecked()) b = 0;
+
+		tRed.setColor1(new Color(0, g, b), false);
+		tRed.setColor2(new Color(255, g, b), true);
+		tGreen.setColor1(new Color(r, 0, b), false);
+		tGreen.setColor2(new Color(r, 255, b), true);
+		tBlue.setColor1(new Color(r, g, 0), false);
+		tBlue.setColor2(new Color(r, g, 255), true);
+	}
+
+	/**
+	 * En cada cambio hay que validar los datos y refrescarlos, este m�todo se
+	 * encarga de la validaci�n de datos y actualizar los rangos de selecci�n
+	 */
+	public void validateValues() {
+		rangeRed = new int[] {0, 255};
+		rangeGreen = new int[] {0, 255};
+		rangeBlue = new int[] {0, 255};
+
+		if (getTRed().isChecked())
+			rangeRed[0] = rangeRed[1] = getTRed().getValue();
+
+		if (getTGreen().isChecked())
+			rangeGreen[0] = rangeGreen[1] = getTGreen().getValue();
+
+		if (getTBlue().isChecked())
+			rangeBlue[0] = rangeBlue[1] = getTBlue().getValue();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.doubleslider.DoubleSliderListener#actionValueChanged(org.gvsig.gui.beans.doubleslider.DoubleSliderEvent)
+	 */
+	public void actionValueChanged(DoubleSliderEvent e) {
+		updateColors();
+		validateValues();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.doubleslider.DoubleSliderListener#actionValueDragged(org.gvsig.gui.beans.doubleslider.DoubleSliderEvent)
+	 */
+	public void actionValueDragged(DoubleSliderEvent e) {
+		updateColors();
+		validateValues();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TranspByPixelRGBInputPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TransparencySelectionPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TransparencySelectionPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TransparencySelectionPanel.java	(revision 8183)
@@ -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.tools.app.basic.tool.properties.panel;
+
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+
+/**
+ * Panel con los botones para la selecci�n de transparencia.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TransparencySelectionPanel extends JPanel {
+	private static final long serialVersionUID = -8601512178169707418L;
+	private JButton areaViewSelectionButton  = null;
+	private JButton pixelViewSelectionButton = null;
+
+	/**
+	 * Constructor.
+	 */
+	public TransparencySelectionPanel() {
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 * @return void
+	 */
+	private void initialize() {
+		setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this, "transp_selection"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+		FlowLayout fl = new FlowLayout();
+		fl.setAlignment(FlowLayout.LEFT);
+		setLayout(fl);
+		add(getAreaViewSelectionButton(), null);
+		add(getPixelViewSelectionButton(), null);
+	}
+
+	public JButton getAreaViewSelectionButton() {
+		if (areaViewSelectionButton == null) {
+			areaViewSelectionButton = new JButton();
+			areaViewSelectionButton.setPreferredSize(new Dimension(25, 25));
+		}
+		return areaViewSelectionButton;
+	}
+
+	public JButton getPixelViewSelectionButton() {
+		if (pixelViewSelectionButton == null) {
+			pixelViewSelectionButton = new JButton();
+			pixelViewSelectionButton.setPreferredSize(new Dimension(25, 25));
+		}
+		return pixelViewSelectionButton;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/TransparencySelectionPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/TransparencyListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/TransparencyListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/TransparencyListener.java	(revision 8183)
@@ -0,0 +1,188 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.properties.control;
+
+import java.util.ArrayList;
+import java.util.EventObject;
+
+import org.gvsig.fmap.dal.coverage.datastruct.TransparencyRange;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.mainplugin.properties.RasterPropertiesTocMenuEntry;
+import org.gvsig.raster.tools.app.basic.RasterExtension;
+import org.gvsig.raster.tools.app.basic.tool.properties.panel.TransparencyPanel;
+/**
+ * Clase que hace de interfaz entre los objetos que contienen la informaci�n de
+ * transparencia y el panel.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TransparencyListener implements TranspByPixelEventListener {
+	private Transparency      transparency      = null;
+	private TransparencyPanel tPanel            = null;
+
+	/**
+	 * Construye un TransparencyControl
+	 * @param tp
+	 */
+	public TransparencyListener(TransparencyPanel tp) {
+		this.tPanel = tp;
+		tPanel.getPTranspByPixel().addValueChangedListener(this);
+	}
+
+	/**
+	 * Carga los valores del panel desde el objeto con la transparencia
+	 */
+	private void setValuesFromTransparencyToPanel() {
+		//Asignamos la opacidad al panel
+		if (transparency.getOpacity() != 255) {
+			tPanel.getOpacityPanel().setControlEnabled(true);
+			tPanel.getOpacityPanel().setValue((int) (transparency.getOpacity() * 100) / 255);
+		} else {
+			tPanel.getOpacityPanel().setControlEnabled(false);
+			tPanel.getOpacityPanel().setValue(100);
+		}
+
+		// Asignamos los rangos de transparencia al panel
+		tPanel.getPTranspByPixel().getListener().setEventsDisabled(true);
+		if (transparency.getTransparencyRange().size() > 0) {
+			tPanel.getPTranspByPixel().clear();
+			tPanel.getPTranspByPixel().setControlEnabled(true);
+			for (int i = 0; i < transparency.getTransparencyRange().size(); i++) {
+				TransparencyRange range = (TransparencyRange) transparency.getTransparencyRange().get(i);
+				tPanel.getPTranspByPixel().addStringElement(range);
+			}
+		} else {
+			tPanel.getPTranspByPixel().clear();
+			tPanel.getPTranspByPixel().setControlEnabled(false);
+		}
+		tPanel.getPTranspByPixel().getListener().setEventsDisabled(false);
+	}
+
+	/**
+	 * Carga los valores del objeto transparencia desde el panel
+	 */
+	private void setValuesFromPanelToTransparency() {
+		if (transparency == null)
+			return;
+		// Asignamos la opacidad al objeto
+		if (tPanel.getOpacityPanel().getCheck().isSelected()) {
+			transparency.setOpacity((int) Math.round((tPanel.getOpacityPanel().getValue() * 255) / 100));
+		} else
+			transparency.setOpacity(255);
+
+		// Asignamos los rangos de transparencia al objeto
+		if (tPanel.getPTranspByPixel().getActiveCheck().isSelected()) {
+			transparency.clearListOfTransparencyRange();
+			ArrayList<TransparencyRange> entries = tPanel.getPTranspByPixel().getEntries();
+			for (int i = 0; i < entries.size(); i++)
+				transparency.setTransparencyRange((TransparencyRange) entries.get(i));
+		} else
+			transparency.clearListOfTransparencyRange();
+
+		transparency.activeTransparency();
+		
+		// Redibujamos
+		if (tPanel.getLayer() != null)
+			tPanel.getLayer().getMapContext().invalidate();
+	}
+
+	/**
+	 * Aplica y guarda los cambios del panel
+	 */
+	public void apply() {
+		onlyApply();
+		saveStatus();
+	}
+
+	/**
+	 * Aplicar los cambios sin guardar su estado
+	 */
+	public void onlyApply() {
+		if (RasterPropertiesTocMenuEntry.enableEvents)
+			setValuesFromPanelToTransparency();
+	}
+
+	/**
+	 * Guarda el estado actual del panel
+	 */
+	@SuppressWarnings("unchecked")
+	private void saveStatus() {
+		tPanel.getPanelGroup().getProperties().put("opacity", new Integer(transparency.getOpacity()));
+
+		tPanel.getPanelGroup().getProperties().put("transparencyActive", new Boolean(transparency.isTransparencyActive()));
+
+		ArrayList newArray = new ArrayList();
+		for (int i = 0; i < transparency.getTransparencyRange().size(); i++) {
+			newArray.add(transparency.getTransparencyRange().get(i));
+		}
+		tPanel.getPanelGroup().getProperties().put("transparencyRange", newArray);
+	}
+
+	/**
+	 * Deja la capa en el �ltimo estado guardado y la refresca
+	 */
+	public void restoreStatus() {
+		transparency.setOpacity(((Integer) tPanel.getPanelGroup().getProperties().get("opacity")).intValue());
+		transparency.setTransparencyActive(((Boolean) tPanel.getPanelGroup().getProperties().get("transparencyActive")).booleanValue());
+
+		ArrayList newArray = (ArrayList) tPanel.getPanelGroup().getProperties().get("transparencyRange");
+		transparency.clearListOfTransparencyRange();
+		for (int i = 0; i < newArray.size(); i++) {
+			transparency.setTransparencyRange((TransparencyRange) newArray.get(i));
+		}
+
+		if (tPanel.getLayer() != null)
+			tPanel.getLayer().getMapContext().invalidate();
+	}
+
+	/**
+	 * Acciones a ejecutar cuando se acepta
+	 */
+	public void accept() {
+		onlyApply();
+	}
+
+	/**
+	 * Acciones a ejecutar cuando se cancela
+	 */
+	public void cancel() {
+		restoreStatus();
+	}
+
+	public void actionPixelListChanged(EventObject e) {
+		if (!RasterExtension.autoRefreshView)
+			return;
+
+		onlyApply();
+	}
+
+	/**
+	 * Aqui se definen los parametros iniciales para la transparencia del panel
+	 * @param t
+	 */
+	public void setLayer(FLyrRaster layer) {
+		transparency = layer.getRender().getRenderingTransparency();
+		saveStatus();
+		setValuesFromTransparencyToPanel();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/TransparencyListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/TranspByPixelStatusBarListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/TranspByPixelStatusBarListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/TranspByPixelStatusBarListener.java	(revision 8183)
@@ -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.tools.app.basic.tool.properties.control;
+
+import java.awt.Cursor;
+import java.awt.Image;
+import java.awt.geom.Point2D;
+import java.awt.image.BufferedImage;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiFrame.NewStatusBar;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.BehaviorException;
+import org.gvsig.fmap.mapcontrol.tools.Events.PointEvent;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.PointListener;
+
+/**
+ * Clase para poner la informacion de pixel RGB en la barra de estado
+ * 
+ * 22/02/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class TranspByPixelStatusBarListener implements PointListener {
+	private MapControl mapControl = null;
+
+	/**
+	 * Crea un nuevo StatusBarListener.
+	 */
+	public TranspByPixelStatusBarListener(MapControl mc) {
+		mapControl = mc;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.PointListener#point(com.iver.cit.gvsig.fmap.tools.Events.PointEvent)
+	 */
+	public void point(PointEvent event) throws BehaviorException {
+		if (PluginServices.getMainFrame() == null)
+			return;
+
+		PluginServices.getMainFrame().enableControls();
+
+		Point2D point2D = event.getPoint();
+		BufferedImage image = mapControl.getImage();
+		int value = image.getRGB((int) point2D.getX(), (int) point2D.getY());
+		int r = (value >> 16) & 0xff;
+		int g = (value >> 8) & 0xff;
+		int b = value & 0xff;
+
+		NewStatusBar statusBar = PluginServices.getMainFrame().getStatusBar();
+		statusBar.setMessage("x", r + ", " + g + ", " + b);
+		statusBar.setMessage("y", "Hex: " +
+				(r < 16 ? "0" : "")	+ Integer.toHexString(r) +
+				(g < 16 ? "0" : "")	+ Integer.toHexString(g) +
+				(b < 16 ? "0" : "")	+ Integer.toHexString(b));
+	}
+
+	public Cursor getCursor() {return null;}
+	public boolean cancelDrawing() {return false;}
+	public void pointDoubleClick(PointEvent event) throws BehaviorException {}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener#getImageCursor()
+	 */
+	public Image getImageCursor() {
+		return null;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/TranspByPixelStatusBarListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/EnhancedControl.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/EnhancedControl.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/EnhancedControl.java	(revision 8183)
@@ -0,0 +1,498 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.properties.control;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JCheckBox;
+
+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.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.LinearStretchParams;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.gui.beans.panelGroup.AbstractPanelGroup;
+import org.gvsig.gui.beans.slidertext.listeners.SliderEvent;
+import org.gvsig.gui.beans.slidertext.listeners.SliderListener;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.mainplugin.properties.RasterPropertiesTocMenuEntry;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.RasterExtension;
+import org.gvsig.raster.tools.app.basic.raster.process.IProcessActions;
+import org.gvsig.raster.tools.app.basic.raster.process.StatisticsProcess;
+import org.gvsig.raster.tools.app.basic.tool.properties.panel.EnhancedBrightnessContrastPanel;
+import org.gvsig.raster.tools.app.basic.tool.properties.panel.EnhancedPanel;
+import org.gvsig.raster.tools.app.basic.tool.properties.panel.EnhancedWithTrimPanel;
+
+
+/**
+ * Clase que hace de interfaz entre los objetos que contienen la informaci�n de
+ * realce y el panel.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class EnhancedControl implements IProcessActions {
+	private EnhancedPanel                   tPanel      = null;
+	private RasterFilterList                filterList  = null;
+	private EnhancedWithTrimPanel           ePanel      = null;
+	private EnhancedBrightnessContrastPanel bcPanel     = null;
+	private FLyrRaster                      lyr         = null;
+	private AbstractPanelGroup              panelGroup  = null;
+	private Statistics                      stats       = null;
+	private int[]                           renderBands = new int[] { 0, 1, 2 };
+
+
+	/**
+	 * Manejador de eventos de los slider de brillo y contraste.
+	 * @author Nacho Brodin (nachobrodin@gmail.com)
+	 */
+	class BrightnessContrastListener implements ActionListener, SliderListener {
+		JCheckBox active = null;
+		/**
+		 * Constructor. Registra los listener
+		 * @param panel
+		 */
+		public BrightnessContrastListener(EnhancedBrightnessContrastPanel panel) {
+			panel.addBrightnessValueChangedListener(this);
+			panel.addContrastValueChangedListener(this);
+			active = panel.getActive();
+			active.addActionListener(this);
+		}
+
+		public void actionPerformed(ActionEvent e) {
+			if (!RasterExtension.autoRefreshView)
+				return;
+
+			if (e.getSource() == active)
+				onlyApply();
+		}
+
+		public void actionValueChanged(SliderEvent e) {
+			if (!RasterExtension.autoRefreshView)
+				return;
+
+			onlyApply();
+		}
+
+		public void actionValueDragged(SliderEvent e) {
+		}
+	}
+
+	/**
+	 * Manejador de eventos del panel EnhancedWithTrim.
+	 *
+	 * @author BorSanZa - Borja Sanchez Zamorano 
+	 */
+	class EnhancedWithTrimListener implements ActionListener, SliderListener {
+		JCheckBox active = null;
+		/**
+		 * Constructor. Registra los listener
+		 * @param panel
+		 */
+		public EnhancedWithTrimListener(EnhancedWithTrimPanel panel) {
+			active = panel.getActive();
+			active.addActionListener(this);
+			panel.getRemoveCheck().addActionListener(this);
+			panel.getTrimCheck().addActionListener(this);
+			panel.getTrimSlider().addValueChangedListener(this);
+		}
+
+		public void actionPerformed(ActionEvent e) {
+			if (!RasterExtension.autoRefreshView)
+				return;
+
+			onlyApply();
+		}
+
+		public void actionValueChanged(SliderEvent e) {
+			if (!RasterExtension.autoRefreshView)
+				return;
+
+			onlyApply();
+		}
+
+		public void actionValueDragged(SliderEvent e) {
+		}
+	}
+
+	/**
+	 * Constructor
+	 * @param tp
+	 */
+	public EnhancedControl(AbstractPanelGroup panelGroup, EnhancedPanel tp, FLyrRaster lyr, RasterFilterList rfl) {
+		this.panelGroup = panelGroup;
+		this.tPanel = tp;
+		this.filterList = rfl;
+		this.lyr = lyr;
+		this.bcPanel = tPanel.getBrightnessContrastPanel();
+		this.ePanel = tPanel.getEnhancedWithTrimPanel();
+		new BrightnessContrastListener(bcPanel);
+		new EnhancedWithTrimListener(ePanel);
+
+		try {
+			saveStatus();
+		} catch (FilterManagerException e) {
+			RasterSwingLibrary.messageBoxError(Messages.getText("error_saving_filters"), this, e);
+		} catch (FilterTypeException e) {
+			RasterSwingLibrary.messageBoxError(Messages.getText("error_saving_filters"), this, e);
+		}
+
+		setValuesFromFilterToPanel();
+	}
+
+	/**
+	 * Carga los valores del panel desde el filtro
+	 */
+	private void setValuesFromFilterToPanel() {
+		// BRILLO
+		RasterFilter bFilter = filterList.getByName("brightness");
+		if (bFilter != null){
+			int incr = ((Integer)bFilter.getParam("incrBrillo")).intValue();
+			bcPanel.setBrightnessValue((double) incr);
+		}else
+			bcPanel.setBrightnessValue(0);
+
+		// CONTRASTE
+		RasterFilter cFilter = filterList.getByName("contrast");
+		if (cFilter != null){
+			int incr = ((Integer)cFilter.getParam("incrContraste")).intValue();
+			bcPanel.setContrastValue((double) incr);
+		}
+		else
+			bcPanel.setContrastValue(0);
+
+		if (bFilter != null || cFilter != null)
+			bcPanel.setControlEnabled(true);
+		else
+			bcPanel.setControlEnabled(false);
+
+		// REALCE LINEAL
+		RasterFilter eFilter = filterList.getByName("enhanced_stretch");
+		if (eFilter != null) {
+			ePanel.setControlEnabled(true);
+
+			// Comprueba si esta activo eliminar extremos
+			boolean removeEnds = false;
+			if (eFilter.getParam("remove") != null)
+				removeEnds = ((Boolean) eFilter.getParam("remove")).booleanValue();
+			ePanel.setRemoveEndsActive(removeEnds);
+			
+			// Comprueba si hay recorte de colas
+			LinearStretchParams stretchs = (LinearStretchParams) eFilter.getParam("stretchs");
+			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];
+			double tailTrim = new Double(nValues > 0 ? median / nValues : median).doubleValue();
+			
+			if (tailTrim != 0) {
+				ePanel.setTailTrimCheckActive(true);
+				ePanel.setTailTrimValue(tailTrim * 100);
+			} else {
+				ePanel.setTailTrimCheckActive(false);
+				ePanel.setTailTrimValue(0);
+			}
+		} else {
+			ePanel.setControlEnabled(false);
+			ePanel.setRemoveEndsActive(false);
+			ePanel.setTailTrimCheckActive(false);
+			ePanel.setTailTrimValue(0);
+		}
+	}
+
+	/**
+	 * Carga los valores del filtro desde el panel
+	 * @throws FilterTypeException
+	 * @throws FilterAddException 
+	 */
+	private void setValuesFromPanelToFilter() throws FilterTypeException, FilterAddException {
+
+		// REALCE
+		if (ePanel.getActive().isSelected()) {
+			if(lyr != null) {
+				stats = lyr.getDataStore().getStatistics();
+				renderBands = lyr.getRender().getRenderColorInterpretation().buildRenderBands();
+				// En este caso siempre es necesario el m�ximo y m�nimo
+				try {
+					if(!stats.isCalculated() && lyr instanceof FLyrRaster) 
+						StatisticsProcess.launcher(lyr, this);
+					else {
+						RasterFilterListManager enhancementManager = filterList.getManagerByID("EnhancementStretch");
+						Params params = filterList.createEmptyFilterParams();
+						params.setParam("stats", stats);
+						params.setParam("remove", ePanel.isRemoveEndsSelected());
+						params.setParam("renderBands", renderBands);
+						params.setParam("rgb", lyr.isRGB());
+						
+						if (ePanel.isTailTrimCheckSelected()) {
+							params.setParam("tailtrim", (double) (ePanel.getTrimValue() / 100D));
+						} else {
+							params.setParam("tailtrim", 0.0);
+						}
+						
+						enhancementManager.addFilter(params);
+					}
+				} catch (FilterManagerException e) {
+					throw new FilterAddException("No se han podido calcular estadisticas. Error al a�adir realce;" + e.getMessage());
+				} 
+			}
+		} else {
+			if(lyr != null) {
+				renderBands = lyr.getRender().getRenderColorInterpretation().buildRenderBands();
+				if(lyr.getDataStore().getDataType()[0] != Buffer.TYPE_BYTE || renderBands.length < 3){
+					RasterFilter colortable = filterList.getByName("colortable");
+					filterList.removeAll();
+					if(colortable != null){
+						filterList.add(colortable);
+					}
+				} else {
+					filterList.remove("enhanced_stretch");
+					filterList.remove("tailTrim");
+				}
+			} else {
+				filterList.remove("enhanced_stretch");
+				filterList.remove("tailTrim");
+			}
+		}
+
+		// BRILLO Y CONTRASTE
+		try {
+			RasterFilterListManager bcManager = filterList.getManagerByID("BrightnessContrast");
+
+			if (bcPanel.getActive().isSelected() && ((int) bcPanel.getBrightnessValue() != 0)) {
+				Params params = filterList.createEmptyFilterParams();
+				params.setParam("Brightness", new Integer((int) bcPanel.getBrightnessValue()));
+				filterList.add(bcManager.createFilter(params));
+			} else
+				filterList.remove("brightness");
+
+			if (bcPanel.getActive().isSelected() && ((int) bcPanel.getContrastValue() != 0)) {
+				Params params = filterList.createEmptyFilterParams();
+				params.setParam("Contrast", new Integer((int) bcPanel.getContrastValue()));
+				filterList.add(bcManager.createFilter(params));
+			} else
+				filterList.remove("contrast");
+		} catch (FilterManagerException e) {
+			throw new FilterAddException("No se han podido calcular estadisticas. Error al a�adir realce;" + e.getMessage());
+		}
+
+		endActionsForFilterSettings();
+	}
+	
+	/**
+	 * Acciones realizadas al final la aplicaci�n de filtros
+	 * @throws FilterTypeException
+	 */
+	private void endActionsForFilterSettings() throws FilterTypeException {
+		ArrayList listOrder = (ArrayList) panelGroup.getProperties().get("filterOrder");
+		List<RasterFilter> listCopy = filterList.getStatusCloned();
+		int cont = 0;
+		for (int i = 0; i < listOrder.size(); i++) {
+			int pos = hasFilter(listCopy, ((RasterFilter) listOrder.get(i)).getName());
+			if (pos != -1) {
+				// Esta pero en posicion equivocada
+				if (pos != cont) {
+					RasterFilter copy = listCopy.remove(pos);
+					listCopy.add(cont, copy);
+				}
+				cont++;
+			}
+		}
+		filterList.setStatus(listCopy);
+		filterList.controlTypes();
+
+		// Redibujamos
+		if (lyr != null)
+			lyr.getMapContext().invalidate();
+	}
+
+	/**
+	 * Acciones a ejecutar cuando se acepta
+	 */
+	public void accept() {
+		try {
+			setValuesFromPanelToFilter();
+		} catch (FilterTypeException e) {
+			RasterSwingLibrary.messageBoxError(Messages.getText("error_adding_filters"), this, e);
+		} catch (FilterAddException e) {
+			RasterSwingLibrary.messageBoxError(Messages.getText("error_adding_filters"), this, e);
+		}
+	}
+
+	/**
+	 * Acciones a ejecutar cuando se aplica
+	 */
+	public void apply() {
+		onlyApply();
+		try {
+			saveStatus();
+		} catch (FilterManagerException e) {
+			RasterSwingLibrary.messageBoxError(Messages.getText("error_saving_filters"), this, e);
+		} catch (FilterTypeException e) {
+			RasterSwingLibrary.messageBoxError(Messages.getText("error_saving_filters"), this, e);
+		}
+	}
+
+	/**
+	 * Acciones a ejecutar cuando se aplica
+	 */
+	public void onlyApply() {
+		if (RasterPropertiesTocMenuEntry.enableEvents)
+			try {
+				setValuesFromPanelToFilter();
+			} catch (FilterTypeException e) {
+				RasterSwingLibrary.messageBoxError(Messages.getText("error_adding_filters"), this, e);
+			} catch (FilterAddException e) {
+				RasterSwingLibrary.messageBoxError(Messages.getText("error_adding_filters"), this, e);
+			}
+	}
+
+	/**
+	 * Acciones a ejecutar cuando se cancela
+	 */
+	public void cancel() {
+		restoreStatus();
+	}
+
+	/**
+	 * Consulta si el filtro especificado en el par�metro name est� dentro
+	 * de la lista filter.
+	 * @param filter Lista donde se consulta
+	 * @param name Nombre a comprobar si est� en la lista
+	 * @return true si est� en la lista y false si no est�.
+	 */
+	private int hasFilter(List<RasterFilter> filter, String name) {
+		for (int i = 0; i < filter.size(); i++) {
+			if (((RasterFilter) filter.get(i)).getName().equals(name))
+				return i;
+		}
+		return -1;
+	}
+
+	@SuppressWarnings("unchecked")
+	public void saveStatus() throws FilterManagerException, FilterTypeException {
+		panelGroup.getProperties().put("filterStatus", filterList.getStatusCloned());
+
+		List<RasterFilter> filterOrder = filterList.getStatusCloned();
+		int posEnhanced = hasFilter(filterOrder, "enhanced_stretch");
+		int posTailTrim = hasFilter(filterOrder, "tailTrim");
+		
+		RasterFilterListManager statFilterManager = filterList.getManagerByID("Statistics");
+		Params params = filterList.createEmptyFilterParams();
+		params.setParam("stats", null);
+		params.setParam("tail", new Double(0.0));
+		params.setParam("samples", new Double(0.0));
+		params.setParam("remove", new Boolean(false));
+		RasterFilter filter = statFilterManager.createFilter(params);
+		
+		// Si tiene realce comprobamos el tailtrim
+		if (posEnhanced != -1) {
+			// Si no tiene el tailTrim, insertamos uno antes del realce
+			if (posTailTrim == -1) {
+				filterOrder.add(posEnhanced, filter);
+			}
+		} else {
+			// Si existe un tailTrim lo borramos pq no tiene realce
+			if (posTailTrim != -1)
+				filterOrder.remove(posTailTrim);
+			// Insertamos primero el tailtrim y luego el realce para conservar un orden logico
+			filterOrder.add(0, filter);
+			RasterFilterListManager eManager = filterList.getManagerByID("EnhancementStretch");
+			params = filterList.createEmptyFilterParams();
+			params.setParam("remove", new Boolean(false));
+			eManager.createFilter(params);
+		}
+
+		RasterFilterListManager bcManager = filterList.getManagerByID("BrightnessContrast");
+		
+		// Si no tiene brillo, lo insertamos
+		if (hasFilter(filterOrder, "brightness") == -1) {
+			params = filterList.createEmptyFilterParams();
+			params.setParam("Brightness", new Integer(0));
+			filterOrder.add(bcManager.createFilter(params));
+		}
+
+		// Si no tiene el contraste, lo insertamos
+		if (hasFilter(filterOrder, "contrast") == -1) {
+			params = filterList.createEmptyFilterParams();
+			params.setParam("Contrast", new Integer(0));
+			filterOrder.add(bcManager.createFilter(params));
+		}
+
+		panelGroup.getProperties().put("filterOrder", filterOrder);
+	}
+
+	@SuppressWarnings("unchecked")
+	public void restoreStatus() {
+		filterList.setStatus((ArrayList) panelGroup.getProperties().get("filterStatus"));
+
+		if (lyr != null)
+			lyr.getMapContext().invalidate();
+	}
+	
+	public void end(Object param) {
+		Statistics st = null;
+		if(param instanceof FLyrRaster && ((FLyrRaster)param).getDataStore() != null) 
+			st = ((FLyrRaster)param).getDataStore().getStatistics();
+		Statistics statistics = (st == null) ? stats : st;
+		
+		try {		
+			RasterFilterListManager enhancementManager = filterList.getManagerByID("EnhancementStretch");
+			Params params = filterList.createEmptyFilterParams();
+			params.setParam("stats", statistics);
+			params.setParam("remove", ePanel.isRemoveEndsSelected());
+			params.setParam("renderBands", renderBands);
+			params.setParam("rgb", lyr.isRGB());
+			
+			if (ePanel.isTailTrimCheckSelected()) {
+				params.setParam("tailtrim", (double) (ePanel.getTrimValue() / 100D));
+			} else {
+				filterList.remove("tailTrim");
+				params.setParam("tailtrim", 0.0);
+			}
+			
+			enhancementManager.addFilter(params);
+			endActionsForFilterSettings();
+		} catch (FilterManagerException e) {
+			RasterSwingLibrary.messageBoxError(Messages.getText("error_adding_stats"), this, e);
+		} catch (FilterTypeException e) {
+			RasterSwingLibrary.messageBoxError(Messages.getText("error_adding_stats"), this, e);
+		}
+	}
+
+	public void interrupted() {
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/EnhancedControl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/TranspByPixelListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/TranspByPixelListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/TranspByPixelListener.java	(revision 8183)
@@ -0,0 +1,389 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.tool.properties.control;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.util.ArrayList;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JList;
+import javax.swing.JRadioButton;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.TransparencyRange;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseMovementBehavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.PointBehavior;
+import org.gvsig.gui.beans.doubleslider.DoubleSliderEvent;
+import org.gvsig.gui.beans.doubleslider.DoubleSliderListener;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.tool.properties.panel.TranspByPixelPanel;
+import org.gvsig.raster.tools.app.basic.tool.properties.panel.TranspByPixelRGBInputPanel;
+import org.gvsig.raster.tools.app.basic.tool.selectrgb.ISelectRGB;
+import org.gvsig.raster.tools.app.basic.tool.selectrgb.SelectRGBListener;
+
+/**
+ * Maneja los eventos para el panel de transparencia por pixel.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TranspByPixelListener implements ActionListener, ListSelectionListener, DoubleSliderListener, MouseListener, ISelectRGB {
+	private ArrayList<TransparencyRange>   entries           = new ArrayList<TransparencyRange>();
+	private JButton                        addButton         = null;
+	private JButton                        removeButton      = null;
+	private JButton                        selectColorButton = null;
+	private JCheckBox                      cbActivar         = null;
+	private JList                          list              = null;
+	private JRadioButton                   andRb             = null;
+	private JRadioButton                   orRb              = null;
+	private TranspByPixelPanel             panel             = null;
+	private TranspByPixelRGBInputPanel     rgbInputPanel     = null;
+	private boolean                        eventsDisabled    = false;
+	private int                            itemSelected      = -1;
+	private String                         viewName          = "";
+
+	/**
+	 * This is the default constructor
+	 */
+	public TranspByPixelListener(TranspByPixelPanel panel) {
+		AbstractViewPanel view = (AbstractViewPanel) PluginServices.getMDIManager().getActiveWindow();
+		viewName = PluginServices.getMDIManager().getWindowInfo(view).getTitle();
+		
+		this.panel = panel;
+		rgbInputPanel = panel.getPRGBInput();
+		list = panel.getJList();
+
+		addButton = panel.getBAdd();
+		removeButton = panel.getBRemove();
+		selectColorButton = panel.getBSelectColor();
+		andRb = panel.getPOperation().getRbAnd();
+		orRb = panel.getPOperation().getRbOr();
+		cbActivar = panel.getActiveCheck();
+
+		addButton.addActionListener(this);
+		removeButton.addActionListener(this);
+		andRb.addActionListener(this);
+		orRb.addActionListener(this);
+		cbActivar.addActionListener(this);
+		selectColorButton.addActionListener(this);
+
+		list.addListSelectionListener(this);
+
+		panel.getPRGBInput().getTBlue().addValueChangedListener(this);
+		panel.getPRGBInput().getTGreen().addValueChangedListener(this);
+		panel.getPRGBInput().getTRed().addValueChangedListener(this);
+		panel.getPRGBInput().getTAlpha().addValueChangedListener(this);
+		list.addMouseListener(this);
+	}
+
+	/**
+	 * Obtiene el objeto TransparencyRange equivalente a los valores RGBA
+	 * seleccionados.
+	 *
+	 * @return TransparencyRange o null si la selecci�n no es correcta.
+	 */
+	private TransparencyRange getEntrySelected() {
+		TransparencyRange entry = RasterLocator.getManager().getDataStructFactory().createTransparencyRange();
+		entry.setRed(rgbInputPanel.getRangeRed());
+		entry.setGreen(rgbInputPanel.getRangeGreen());
+		entry.setBlue(rgbInputPanel.getRangeBlue());
+		if (rgbInputPanel.getTAlpha().isChecked())
+			entry.setAlpha(255 - rgbInputPanel.getTAlpha().getValue());
+		else
+			entry.setAlpha(0);
+
+		String textR = rgbInputPanel.getTRed().getValue() + "";
+		if (!rgbInputPanel.getTRed().isChecked())
+			textR = "*";
+		String textG = rgbInputPanel.getTGreen().getValue() + "";
+		if (!rgbInputPanel.getTGreen().isChecked())
+			textG = "*";
+		String textB = rgbInputPanel.getTBlue().getValue() + "";
+		if (!rgbInputPanel.getTBlue().isChecked())
+			textB = "*";
+
+		String strEntry = "";
+		String separator = "";
+		if (andRb.isSelected()) {
+			separator = " & ";
+			entry.setAnd(true);
+		} else {
+			separator = " | ";
+			entry.setAnd(false);
+		}
+
+		strEntry = textR + separator + textG + separator + textB;
+		if (rgbInputPanel.getTAlpha().getValue() != 255)
+			strEntry += " (A: " + rgbInputPanel.getTAlpha().getValue() + ")"; 
+		entry.setStrEntry(strEntry);
+
+		return entry;
+	}
+
+	/**
+	 * Gesti�n del evento de bot�n de selecci�n de color desde la vista. 
+	 * A�ade una tool a la vista para la selecci�n de RGB.
+	 */
+	public void colorToolButton() {
+		AbstractViewPanel theView = null;
+		try {
+			IWindow[] allViews = PluginServices.getMDIManager().getAllWindows();
+			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];
+			}
+			if (theView == null)
+				return;
+		} catch (ClassCastException ex) {
+			RasterSwingLibrary.messageBoxError("error_view_not_found", this, ex);
+			return;
+		}
+		MapControl m_MapControl = theView.getMapControl();
+		
+		TranspByPixelStatusBarListener sbl = new TranspByPixelStatusBarListener(m_MapControl);
+		SelectRGBListener selectRGBListener = new SelectRGBListener(m_MapControl, this);
+		m_MapControl.addBehavior("selectColorRaster", new Behavior[] {
+				new PointBehavior(selectRGBListener), new MouseMovementBehavior(sbl)
+				}
+		);
+
+		m_MapControl.setTool("selectColorRaster");
+	}
+	
+	/**
+	 * Actualiza el item seleccionado cogiendo los valores del RGB
+	 */
+	private void updateData() {
+		if (itemSelected == -1)
+			return;
+
+		TransparencyRange entry = getEntrySelected();
+		if (entry != null) {
+			if (itemSelected < entries.size()) {
+				entries.set(itemSelected, entry);
+				panel.getListModel().set(itemSelected, entry.getStrEntry());
+				panel.callValueChanged();
+			}
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+	 */
+	public void actionPerformed(ActionEvent e) {
+
+		if ((e.getSource() == andRb) || (e.getSource() == orRb)) {
+			updateData();
+			return;
+		}
+
+		// A�ade elementos a la lista
+		if (e.getSource() == addButton) {
+			TransparencyRange entry = getEntrySelected();
+			if (entry != null) {
+				entries.add(entry);
+				itemSelected = entries.size() - 1;
+				panel.getListModel().addElement(entry.getStrEntry());
+				setValues(itemSelected);
+
+				removeButton.setEnabled(true);
+				panel.callValueChanged();
+			}
+			return;
+		}
+
+		// Elimina elementos de la lista
+		if (e.getSource() == removeButton) {
+			deleteSelected();
+			return;
+		}
+		
+		if (e.getSource() == selectColorButton) {
+			colorToolButton();
+			return;
+		}
+
+		if (e.getSource() == cbActivar) {
+			panel.setControlEnabled(cbActivar.isSelected());
+			panel.callValueChanged();
+			return;
+		}
+	}
+
+	private void deleteSelected() {
+		if (itemSelected == -1)
+			return;
+
+		entries.remove(itemSelected);
+		panel.getListModel().remove(itemSelected);
+
+		if (itemSelected >= entries.size()) {
+			itemSelected = entries.size() - 1;
+		}
+		setValues(itemSelected);
+
+		if (entries.size() == 0)
+			removeButton.setEnabled(false);
+		panel.callValueChanged();
+	}
+
+	/**
+	 * Establece los valores RGBA a sus componentes segun la seleccion
+	 * @param item
+	 */
+	private void setValues(int item) {
+
+		if (item >= entries.size()) {
+			item = entries.size() - 1;
+		}
+
+		if (entries.size() == 0) {
+			rgbInputPanel.getTRed().setValue(0);
+			rgbInputPanel.getTRed().setChecked(true);
+			rgbInputPanel.getTGreen().setValue(0);
+			rgbInputPanel.getTGreen().setChecked(true);
+			rgbInputPanel.getTBlue().setValue(0);
+			rgbInputPanel.getTBlue().setChecked(true);
+			rgbInputPanel.getTAlpha().setValue(255);
+			rgbInputPanel.getTAlpha().setChecked(false);
+			andRb.setSelected(true);
+			orRb.setSelected(false);
+			return;
+		}
+		TransparencyRange tr = (TransparencyRange) entries.get(item);
+
+		andRb.setSelected(tr.isAnd());
+		orRb.setSelected(!tr.isAnd());
+
+		if (tr.getRed() == null) {
+			rgbInputPanel.getTRed().setValue(0);
+			rgbInputPanel.getTRed().setChecked(false);
+		} else {
+			rgbInputPanel.getTRed().setValue(tr.getRed()[0]);
+			rgbInputPanel.getTRed().setChecked(true);
+		}
+
+		if (tr.getGreen() == null) {
+			rgbInputPanel.getTGreen().setValue(0);
+			rgbInputPanel.getTGreen().setChecked(false);
+		} else {
+			rgbInputPanel.getTGreen().setValue(tr.getGreen()[0]);
+			rgbInputPanel.getTGreen().setChecked(true);
+		}
+
+		if (tr.getBlue() == null) {
+			rgbInputPanel.getTBlue().setValue(0);
+			rgbInputPanel.getTBlue().setChecked(false);
+		} else {
+			rgbInputPanel.getTBlue().setValue(tr.getBlue()[0]);
+			rgbInputPanel.getTBlue().setChecked(true);
+		}
+
+		int alpha = 255 - tr.getAlpha();
+		rgbInputPanel.getTAlpha().setValue(alpha);
+		rgbInputPanel.getTAlpha().setChecked(alpha != 255);
+
+		if (list.getSelectedIndex() != item) {
+			list.setSelectedIndex(item);
+		}
+	}
+
+	/**
+	 * Obtiene el array de entradas de valores a�adidos a la lista
+	 * @return ArrayList
+	 */
+	public ArrayList<TransparencyRange> getEntries() {
+		return entries;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
+	 */
+	public void valueChanged(ListSelectionEvent e) {
+		eventsDisabled = true;
+		if (list.getSelectedIndex() != -1)
+			itemSelected = list.getSelectedIndex();
+
+		setValues(itemSelected);
+		eventsDisabled = false;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.doubleslider.DoubleSliderListener#actionValueChanged(org.gvsig.gui.beans.doubleslider.DoubleSliderEvent)
+	 */
+	public void actionValueChanged(DoubleSliderEvent e) {
+		if (eventsDisabled)
+			return;
+		eventsDisabled = true;
+		updateData();
+		eventsDisabled = false;
+	}
+
+	/**
+	 * Habilita o deshabilita la gestion de eventos
+	 * @param value
+	 */
+	public void setEventsDisabled(boolean value) {
+		eventsDisabled = value;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
+	 */
+	public void mouseClicked(MouseEvent e) {
+		if (e.getSource() == list)
+			// Si es doble click borramos el seleccionado
+			if (e.getClickCount() == 2)
+				deleteSelected();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.toolselectrgb.ISelectRGB#actionRGBSelected(int, int, int)
+	 */
+	public void actionRGBSelected(int r, int g, int b) {
+		rgbInputPanel.getTRed().setValue(r);
+		rgbInputPanel.getTGreen().setValue(g);
+		rgbInputPanel.getTBlue().setValue(b);
+	}
+
+	public void actionValueDragged(DoubleSliderEvent e) {}
+	public void mouseEntered(MouseEvent e) {}
+	public void mouseExited(MouseEvent e) {}
+	public void mousePressed(MouseEvent e) {}
+	public void mouseReleased(MouseEvent e) {}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/TranspByPixelListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/TranspByPixelEventListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/TranspByPixelEventListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/TranspByPixelEventListener.java	(revision 8183)
@@ -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.tools.app.basic.tool.properties.control;
+
+import java.util.EventListener;
+import java.util.EventObject;
+
+public interface TranspByPixelEventListener extends EventListener {
+	public void actionPixelListChanged(EventObject e);
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/TranspByPixelEventListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrasterlayer/SelectImageListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrasterlayer/SelectImageListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrasterlayer/SelectImageListener.java	(revision 8183)
@@ -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.tools.app.basic.tool.selectrasterlayer;
+
+import java.awt.geom.Point2D;
+
+import javax.swing.JScrollBar;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.messages.NotificationManager;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.fmap.dal.exception.ReadException;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.Events.PointEvent;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+
+/**
+* Extensi�n de la clase SelectImageListenerImple de FMap. Esta clase
+* permite capturar el evento de la selecci�n de un punto sobre la vista
+* . Controlara que capa de la pila que est� visible cae dentro del punto
+* seleccionado poniendo esta capa como activa. En caso de que haya varias
+* capas visibles sobre ese punto, pondr� como activa la capa superior.
+*
+* @author Nacho Brodin (nachobrodin@gmail.com)
+*/
+public class SelectImageListener extends SelectImageListImpl {
+
+	private Envelope		extentLayer = null;
+	
+	/**
+	 * Contructor
+	 * @param mapCtrl
+	 */
+	public SelectImageListener(MapControl mapCtrl) {
+		super(mapCtrl);
+	}
+
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.PointListener#point(com.iver.cit.gvsig.fmap.tools.Events.PointEvent)
+	 */
+	public void point(PointEvent event) {
+		super.point(event);
+
+		Point2D pointSelect = event.getPoint();
+
+		if (PluginServices.getMainFrame() != null)
+				PluginServices.getMainFrame().enableControls();
+
+		ViewPort vp = mapCtrl.getMapContext().getViewPort();
+
+		wcPoint = vp.toMapPoint((int)pointSelect.getX(), (int)pointSelect.getY());
+
+		FLayers layers = mapCtrl.getMapContext().getLayers();
+		for(int i = 0; i < layers.getLayersCount(); i++)
+			layers.getLayer(i).setActive(false);
+
+		for(int i = layers.getLayersCount() - 1; i >= 0; i--) {
+			if (select(layers.getLayer(i), i))
+				break;
+		}
+	}
+	
+	private boolean select(FLayer layer,int pos) {
+		if (layer instanceof FLayers) {
+			FLayers laux = (FLayers)layer;
+			for (int j = laux.getLayersCount() - 1; j >= 0; j--) {
+				if (select(laux.getLayer(j), j)) {
+					return true;
+				}
+			}
+		} else {
+			try {
+				extentLayer = layer.getFullEnvelope();
+			} catch(ReadException exc) {
+				NotificationManager.addError("Error al obtener el extent", exc);
+			} 
+
+			if(	extentLayer.getMaximum(0) >= wcPoint.getX() &&
+					extentLayer.getMinimum(0) <= wcPoint.getX() &&
+					extentLayer.getMaximum(1) >= wcPoint.getY() &&
+					extentLayer.getMinimum(1) <= wcPoint.getY() &&
+					layer.isVisible() &&
+					layer instanceof FLyrRaster) {
+				layer.setActive(true);
+				AbstractViewPanel view = (AbstractViewPanel) 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));
+				return true;
+			}
+		}
+		return false;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrasterlayer/SelectImageListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrasterlayer/SelectLayerTocMenuEntry.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrasterlayer/SelectLayerTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrasterlayer/SelectLayerTocMenuEntry.java	(revision 8183)
@@ -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.tools.app.basic.tool.selectrasterlayer;
+
+import javax.swing.Icon;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.app.project.documents.view.toolListeners.StatusBarListener;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseMovementBehavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.PointBehavior;
+import org.gvsig.raster.fmap.layers.IRasterLayerActions;
+import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SelectLayerTocMenuEntry extends AbstractTocContextMenuAction implements IGenericToolBarMenuItem {
+	static private SelectLayerTocMenuEntry singleton  = null;
+	FLayer lyr = null;
+
+	public String getGroup() {
+		return "RasterLayer";
+	}
+
+	public int getGroupOrder() {
+		return 10;
+	}
+
+	public int getOrder() {
+		return 20;
+	}
+
+	public String getText() {
+		return RasterToolsUtil.getText(this, "seleccionar_capas_raster");
+	}
+	
+	/**
+	 * Devuelve un objeto unico a dicha clase
+	 * @return
+	 */
+	static public SelectLayerTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new SelectLayerTocMenuEntry();
+		return singleton;
+	}
+
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		return true;
+	}
+
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+
+		if (!(selectedItems[0] instanceof IRasterLayerActions))
+			return false;
+
+		return ((IRasterLayerActions) selectedItems[0]).isActionEnabled(IRasterLayerActions.SELECT_LAYER);
+	}
+
+	/**
+	 * M�todo que se ejecuta cuando se pulsa la entrada en el men� contextual del TOC 
+	 * correspondiente a "Zoom a la resoluci�n del raster". Aqu� se crear� el mapTool si 
+	 * no se ha hecho antes y se cargar�.
+	 */
+	public void execute(ITocItem item, FLayer[] selectedItems) {
+		AbstractViewPanel theView = (AbstractViewPanel) PluginServices.getMDIManager().getActiveWindow();
+		MapControl mapCtrl = theView.getMapControl();
+
+		// Listener de eventos de movimiento que pone las coordenadas del rat�n en
+		// la barra de estado
+		StatusBarListener sbl = new StatusBarListener(mapCtrl);
+
+		loadSelectRasterListener(mapCtrl, sbl);
+		mapCtrl.setTool("selectRasterLayer");
+	}
+	
+	/**
+	 * Carga el listener de selecci�n de raster en el MapControl.
+	 */
+	private void loadSelectRasterListener(MapControl mapCtrl, StatusBarListener sbl) {
+		if (mapCtrl.getNamesMapTools().get("selectRasterLayer") == null) {
+			SelectImageListener sil = new SelectImageListener(mapCtrl);
+			mapCtrl.addBehavior("selectRasterLayer", new Behavior[] { new PointBehavior(sil), new MouseMovementBehavior(sbl) });
+			mapCtrl.setTool("selectRasterLayer");
+		}
+	}
+
+	public Icon getIcon() {
+		return IconThemeHelper.getImageIcon("view-select-raster-layer");
+	}
+	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrasterlayer/SelectLayerTocMenuEntry.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrasterlayer/SelectImageListImpl.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrasterlayer/SelectImageListImpl.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrasterlayer/SelectImageListImpl.java	(revision 8183)
@@ -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.tools.app.basic.tool.selectrasterlayer;
+
+import java.awt.Cursor;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.Toolkit;
+import java.awt.geom.Point2D;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.Events.PointEvent;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.PointListener;
+
+
+/**
+ * <p>Listener to select the upper layer with raster data, that has information in the associated <code>MapControl</code> object, down
+ *  the position selected by the mouse.</p>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SelectImageListImpl implements PointListener {
+
+	/**
+	 * The cursor used to work with this tool listener.
+	 * 
+	 * @see #getCursor()
+	 */
+	private Cursor cur = null;
+
+	/**
+	 * Reference to the <code>MapControl</code> object that uses.
+	 */
+	protected MapControl mapCtrl;
+
+	/**
+	 * World equivalent coordinates of the point 2D 
+	 */
+	protected Point2D wcPoint = null;
+
+	/**
+	 * <p>Creates a new <code>SelectImageListenerImpl</code> object.</p>
+	 * 
+	 * @param mapCtrl the <code>MapControl</code> where are stored the layers
+	 */
+	public SelectImageListImpl(MapControl mapCtrl) {
+		this.mapCtrl = mapCtrl;
+	}
+
+	public void point(PointEvent event) {
+
+	}
+
+	public Cursor getCursor() {
+		if(cur == null) {
+			cur = Toolkit.getDefaultToolkit().createCustomCursor(getImageCursor(),
+					new Point(16, 16), "");
+		}
+		return cur;
+	}
+
+	public boolean cancelDrawing() {
+		return true;
+	}
+
+	public void pointDoubleClick(PointEvent event) {
+	}
+
+	public Image getImageCursor() {
+		return IconThemeHelper.getImage("zoom-pixel-cursor");
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrasterlayer/SelectImageListImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/selectrasterlayer
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/histogram/HistogramPanelListener.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/histogram/HistogramPanelListener.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/histogram/HistogramPanelListener.java	(revision 8183)
@@ -0,0 +1,543 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+*
+* Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+*/
+package org.gvsig.raster.tools.app.basic.tool.histogram;
+
+import java.awt.Color;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.util.ArrayList;
+
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JFileChooser;
+import javax.swing.JOptionPane;
+import javax.swing.table.DefaultTableModel;
+
+import org.gvsig.app.ApplicationLocator;
+import org.gvsig.app.ApplicationManager;
+import org.gvsig.app.project.documents.table.TableDocument;
+import org.gvsig.app.project.documents.table.TableManager;
+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.datastruct.BufferHistogram;
+import org.gvsig.fmap.dal.coverage.datastruct.HistogramClass;
+import org.gvsig.fmap.dal.coverage.exception.HistogramException;
+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.props.HistogramComputer;
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+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.FilesystemStoreParameters;
+import org.gvsig.gui.beans.graphic.GraphicEvent;
+import org.gvsig.gui.beans.graphic.GraphicListener;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.raster.process.HistogramProcess;
+import org.gvsig.raster.tools.app.basic.raster.process.IProcessActions;
+import org.gvsig.raster.tools.app.basic.raster.process.StatisticsProcess;
+import org.gvsig.raster.tools.app.basic.tool.histogram.ui.HistogramPanel;
+import org.gvsig.tools.dataTypes.DataTypes;
+/**
+ * Listener para eventos del panel de histograma
+ *
+ * @version 20/03/2007
+ * @author Nacho Brodin (brodin_ign@gva.es)
+ * @author BorSanZa - Borja Sanchez Zamorano (borja.sanchez@iver.es)
+ */
+public class HistogramPanelListener implements GraphicListener, ActionListener, PropertyChangeListener, IProcessActions {
+	private HistogramPanel histogramPanel    = null;
+
+	/**
+	 * Variable que apunta a uno de los dos histogramas posibles: Real o RGB
+	 */
+	private BufferHistogram      lastHistogram     = null;
+
+	/**
+	 * Histograma original sin convertir a RGB
+	 */
+	private BufferHistogram      lastHistogramReal = null;
+
+	/**
+	 * Histograma convertido a rango RGB
+	 */
+	private BufferHistogram      lastHistogramRGB  = null;
+
+	public boolean         eventsEnabled     = false;
+
+	/**
+	 * Bandas que se est�n mostrando en el gr�fico. Se inicializa con las 3 bandas
+	 * RGB de la visualizaci�n. Este array puede tener m�s elementos ya que si las
+	 * bandas no son de visualizaci�n (bandas de la imagen en disco) tendr� un
+	 * elemento por cada una.
+	 */
+	private boolean[]      showBands         = null;
+	private FLyrRaster     lyr               = null;
+
+	private Color[]						bandsColor     = {
+			Color.red,
+			Color.green,
+			Color.blue,
+			Color.cyan,
+			Color.black,
+			Color.darkGray,
+			Color.gray,
+			Color.magenta,
+			Color.yellow,
+			Color.orange};
+
+	/**
+	 * Guardamos el histogramable para hacer el histogramProcess
+	 */
+	HistogramComputer histogramable = null;
+
+	/**
+	 * Constructor. Asigna el panel del histograma
+	 * @param p Panel
+	 */
+	public HistogramPanelListener(HistogramPanel histogramPanel) {
+		this.histogramPanel = histogramPanel;
+	}
+
+	/**
+	 * Obtiene el panel del histograma
+	 * @return HistogramPanel
+	 */
+	private HistogramPanel getHistogramPanel() {
+		return histogramPanel;
+	}
+
+	/**
+	 * Asigna la capa para obtener las fuentes de datos tanto del
+	 * datasource como de la visualizaci�n.
+	 * @param lyr Capa
+	 */
+	public void setLayer(FLyrRaster lyr) {
+		this.lyr = lyr;
+	}
+
+	public void setControlListeners() {
+		getHistogramPanel().getGraphicContainer().addValueChangedListener(this);
+	}
+
+	/**
+	 * Actualizar cuadro de estad�sticas
+	 */
+	private void updateStatistic() {
+		if (getLastHistogram() == null) {
+			getHistogramPanel().setStatistic(null);
+			return;
+		}
+
+		double first = getHistogramPanel().getGraphicContainer().getX1();
+		double end = getHistogramPanel().getGraphicContainer().getX2();
+
+		getHistogramPanel().setStatistic(getLastHistogram().getBasicStats(first, end, showBands));
+	}
+
+	/**
+	 * Tratamiento de todos los eventos visuales.
+	 */
+	@SuppressWarnings("unchecked")
+	public void actionPerformed(ActionEvent e) {
+		if (!eventsEnabled) return;
+
+		// Boton de desmarcar todas las bandas
+		if (e.getSource() == getHistogramPanel().getButtonClean()) {
+			getHistogramPanel().refreshBands(false);
+			for (int i = 0; i < showBands.length; i++)
+				showBands[i] = false;
+			updateStatistic();
+			updateGraphic();
+			return;
+		}
+
+		// Boton de marcar todas las bandas
+		if (e.getSource() == getHistogramPanel().getButtonShowAll()) {
+			getHistogramPanel().refreshBands(true);
+			for (int i = 0; i < showBands.length; i++)
+				showBands[i] = true;
+			updateStatistic();
+			updateGraphic();
+			return;
+		}
+
+		//--------------------------------------
+		//Selecci�n de fuente de datos del histograma
+		JComboBox cbo = getHistogramPanel().getComboBoxSource();
+		if (e.getSource() == cbo) {
+			ArrayList comboSource = getHistogramPanel().getComboSource();
+			for (int i = 0; i < comboSource.size(); i++) {
+				String name = (String) ((ArrayList) comboSource.get(i)).get(1);
+				if (cbo.getSelectedItem().equals(name) && 
+					name.compareTo(RasterToolsUtil.getText(this, "datos_visualizados")) == 0) {
+					((ArrayList) comboSource.get(i)).remove(0);
+					try {
+						((ArrayList) comboSource.get(i)).add(0, ((FLyrRaster) lyr).getRender().getLastRenderBuffer().getHistogramComputer());
+					} catch (QueryException e1) {
+						RasterSwingLibrary.messageBoxError("histogram_error", getHistogramPanel(), e1);
+					} catch (ProcessInterruptedException e1) {
+					}
+
+				}
+				if (cbo.getSelectedItem().equals(name) && 
+					name.compareTo(RasterToolsUtil.getText(this, "imagen_completa")) == 0) {
+					((ArrayList) comboSource.get(i)).remove(0);
+					((ArrayList) comboSource.get(i)).add(0, ((FLyrRaster) lyr).getDataStore().getHistogramComputer());
+				}
+			}
+			showHistogram();
+			return;
+		}
+
+		// Checkbox de eliminas extremos
+		if (e.getSource() == getHistogramPanel().getCheckBoxDeleteEdges()) {
+			updateGraphic();
+			return;
+		}
+
+		// Checkbox de RGB
+		if (e.getSource() == getHistogramPanel().getCheckBoxRGB()) {
+			selectHistogram();
+			updateStatistic();
+			updateGraphic();
+			return;
+		}
+
+		//--------------------------------------
+		//Selecci�n de histograma acumulado y no acumulado
+		JComboBox cbt = getHistogramPanel().getComboBoxType();
+		if (e.getSource() == cbt) {
+			getHistogramPanel().getGraphicContainer().getPGraphic().setViewType(getHistogramPanel().getComboBoxType().getSelectedIndex());
+			return;
+		}
+
+		//--------------------------------------
+		// Boton Crear Tabla
+		JButton table = getHistogramPanel().getBCreateTable();
+		if (e.getSource() == table) {
+			
+				//-------Mostrar un fileChooser------------------
+				String fName;
+				JFileChooser chooser = new JFileChooser();
+				chooser.setDialogTitle(RasterToolsUtil.getText(this, "guardar_tabla"));
+
+				int returnVal = chooser.showOpenDialog(getHistogramPanel());
+				if (returnVal == JFileChooser.APPROVE_OPTION) {
+					fName = chooser.getSelectedFile().toString();
+					if (!fName.endsWith(".dbf"))
+						fName += ".dbf";
+
+					//-------------Crear el dbf----------------------
+
+					HistogramClass[][] histogram = getLastHistogram().getHistogram();
+					int numBands = histogram.length;
+					int numRecors = histogram[0].length;
+
+					File file = new File(fName);
+
+					String names[] = new String[numBands + 2];
+					int types[] = new int [numBands + 2];
+					int lengths[] = new int [numBands + 2];
+
+					names[0] = "Min";
+					types[0] = DataTypes.DOUBLE;
+					lengths[0] = 15;
+					
+					names[1] = "Max";
+					types[1] = DataTypes.DOUBLE;
+					lengths[1] = 15;
+					
+					for (int band = 0; band < numBands; band++) {
+						names[band + 2] = "Band" + band;
+						types[band + 2] = DataTypes.DOUBLE;
+						lengths[band + 2] = 15;
+					}
+					FeatureStore store = null;
+					
+					try {
+						DataManager manager = DALLocator.getDataManager();
+						DataServerExplorerParameters eparams = manager.createServerExplorerParameters("FilesystemExplorer");
+						eparams.setDynValue("initialpath", "/data");
+						DataServerExplorer serverExplorer = manager.openServerExplorer("FilesystemExplorer", eparams);
+
+						NewFeatureStoreParameters sparams = (NewFeatureStoreParameters)serverExplorer.getAddParameters("DBF");
+						((FilesystemStoreParameters) sparams).setFile(file);
+						
+						EditableFeatureType featureType = sparams.getDefaultFeatureType();
+						
+						//Creating table structure
+						for (int i = 0; i < names.length; i++) {
+							featureType.add(names[i], types[i], lengths[i]);
+						}
+						
+						manager.newStore("FilesystemExplorer", "DBF", sparams, true);
+						store = (FeatureStore)manager.openStore(sparams.getDataStoreName(), sparams);
+
+						//Loading data
+						store.edit();
+						
+						for (int j = 0; j < numRecors; j++) {
+							EditableFeature feature = store.createNewFeature();
+							feature.set(names[0], histogram[0][j].getMin());
+							feature.set(names[1], histogram[0][j].getMax());
+
+							for (int r = 0; r < numBands; r++) {
+								feature.set(names[r + 2], histogram[r][j].getValue());
+							}
+							store.insert(feature);
+						}
+
+						store.finishEditing();
+					} catch (DataException e1) {
+						JOptionPane.showMessageDialog(null, getHistogramPanel().getName() + " " + RasterToolsUtil.getText(this,"table_not_create"));
+					} catch (ValidateDataParametersException e2) {
+						JOptionPane.showMessageDialog(null, getHistogramPanel().getName() + " " + RasterToolsUtil.getText(this,"table_not_create"));
+					}
+					
+					//------------A�adir el dbf al proyecto--------------
+					
+					ApplicationManager application = ApplicationLocator.getManager(); 
+					TableDocument tableDocument = (TableDocument)application.getProjectManager().createDocument(TableManager.TYPENAME, 
+							"Histogram_"+lyr.getName());
+					tableDocument.setStore(store);
+					application.getCurrentProject().add(tableDocument);
+					tableDocument.getFactory().getMainWindow(tableDocument);
+				}
+		}
+	}
+
+	/**
+	 * Actualizar la variable de las bandas visibles y su componente visual.
+	 */
+	private void refreshBands() {
+		getHistogramPanel().refreshBands(true);
+		if (getLastHistogram() == null)
+			showBands = new boolean[0];
+		else
+			showBands = new boolean[getLastHistogram().getNumBands()];
+		for (int i = 0; i < showBands.length; i++)
+			showBands[i] = true;
+	}
+
+	/**
+	 * Lanza los dos threads para procesar el histograma y visualizar la
+	 * ventana de incremento
+	 */
+	@SuppressWarnings("unchecked")
+	public void showHistogram() {
+		if (getHistogramPanel().getComboBoxSource().getSelectedIndex() < 0)
+			return;
+
+		int dataSrc = getHistogramPanel().getComboBoxSource().getSelectedIndex();
+		histogramable = (HistogramComputer) ((ArrayList) getHistogramPanel().getComboSource().get(dataSrc)).get(0);
+
+		if (getLastHistogram() == null) {
+			try {
+				if (histogramable != null)
+					setNewHistogram(histogramable.getBufferHistogram());
+				else
+					setNewHistogram(null);
+			} catch (HistogramException e) {
+				RasterSwingLibrary.messageBoxError("histogram_error", getHistogramPanel(), e);
+				return;
+			} catch (ProcessInterruptedException e) {
+				
+			} 
+			return;
+		}
+
+		// Calculo las estadisticas para luego hacer el proceso del histograma.
+		// El parametro object es el que se le pasara al siguiente proceso
+		// Mirar el metodo end()
+		StatisticsProcess statisticsProcess = new StatisticsProcess();
+		statisticsProcess.setActions(this);
+		statisticsProcess.addParam("layer", lyr);
+		statisticsProcess.addParam("force", Boolean.FALSE);
+		statisticsProcess.start();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.IProcessActions#end(java.lang.Object)
+	 */
+	public void end(Object object) {
+		// Si tenemos un histograma en el parametro, es que ya ha finalizado el proceso
+		if (object instanceof BufferHistogram) {
+			setNewHistogram((BufferHistogram) object);
+			return;
+		}
+
+		// Si no tenemos un histograma, osease, tenemos un layer, 
+		// es que aun necesitamos calcularlo
+		if (object instanceof FLyrRaster) {
+			if (histogramable != null) {
+				HistogramProcess histogramProcess = new HistogramProcess();
+				histogramProcess.setActions(this);
+				histogramProcess.addParam("histogramable", histogramable);
+				histogramProcess.start();
+			} else {
+				setNewHistogram(null);
+			}
+		}
+	}
+
+	/**
+	 * Actualiza la grafica con los datos que ya teniamos del histograma.
+	 */
+	private void updateGraphic() {
+		if (getLastHistogram() == null) {
+			getHistogramPanel().getGraphicContainer().getPGraphic().cleanChart();
+			return;
+		}
+
+		HistogramClass[][] histogramClass = getLastHistogram().getHistogram();
+		if (histogramClass == null)
+			return;
+
+		double[][][] datos = new double[histogramClass.length][histogramClass[0].length][2];
+		for (int iBand = 0; iBand < histogramClass.length; iBand++) {
+			for (int i = 0; i < histogramClass[iBand].length; i++) {
+				datos[iBand][i][0] = histogramClass[iBand][i].getMin();
+				datos[iBand][i][1] = histogramClass[iBand][i].getValue();
+			}
+		}
+
+		// Definimos el principio y final de la grafica, sirve para descartar valores.
+		int first = (int) getHistogramPanel().getBoxValueX1();
+		int end = (int) getHistogramPanel().getBoxValueX2();
+		//first = 0;
+		//end = 100;
+
+		int min = 0;
+		int max = histogramClass[0].length - 1;
+
+		first = min + ((first * (max - min))/ 100);
+		end = min + ((end * (max - min))/ 100);
+
+		// Si hay que eliminar los limites, quitamos el ultimo y primer valor de la grafica
+		if (getHistogramPanel().getCheckBoxDeleteEdges().isSelected()) {
+			if ((first + 1) <= end)
+				first++;
+			if ((end - 1) >= first)
+				end--;
+		}
+
+		int bandCount = 0;
+		for (int i = 0; i < showBands.length; i++)
+			if (showBands[i])
+				bandCount++;
+
+		double[][][] newHistogram = new double[bandCount][end - first + 1][2];
+		String[] bandNames = new String[bandCount];
+
+		int numBand = 0;
+		for (int iBand = 0; iBand < showBands.length; iBand++) {
+			if (!showBands[iBand])
+				continue;
+			for (int j = first; j <= end; j++) {
+				try {
+					newHistogram[numBand][j - first][0] = datos[iBand][j][0];
+					newHistogram[numBand][j - first][1] = datos[iBand][j][1];
+				} catch (ArrayIndexOutOfBoundsException e) {
+					RasterSwingLibrary.messageBoxError("Error al crear el array del histograma. DataType: " + getHistogramPanel().getDataType() + " Posici�n: " + j, this, e);
+				}
+			}
+			bandNames[numBand] = (String) ((DefaultTableModel) getHistogramPanel().getJTableBands().getModel()).getValueAt(iBand, 1);
+
+			getHistogramPanel().getGraphicContainer().setBandColor(numBand, bandsColor[iBand % bandsColor.length]);
+
+			numBand++;
+		}
+
+		getHistogramPanel().getGraphicContainer().getPGraphic().setNewChart(newHistogram, bandNames);
+	}
+
+
+	public void selectHistogram() {
+		if (getHistogramPanel().getCheckBoxRGB().isSelected())
+			lastHistogram = lastHistogramRGB;
+		else
+			lastHistogram = lastHistogramReal;
+	}
+	/**
+	 * Definir el nuevo histograma, metodo pu�blico para ser invocado desde
+	 * histogramProcess
+	 * @param histograma nuevo
+	 */
+	public void setNewHistogram(BufferHistogram histogram) {
+		getHistogramPanel().panelInizialited = false;
+		eventsEnabled = false;
+
+		this.lastHistogramReal = histogram;
+		this.lastHistogramRGB = RasterLocator.getManager().getRasterUtils().convertHistogramToRGB(lastHistogramReal);
+		selectHistogram();
+
+		refreshBands();
+		updateStatistic();
+		updateGraphic();
+
+		// Activo la ejecucion de los eventos porque seguro que ya tenemos un histograma
+		eventsEnabled = true;
+		getHistogramPanel().panelInizialited = true;
+	}
+
+	/**
+	 * Obtener �ltimo histograma
+	 * @return Histogram
+	 */
+	public BufferHistogram getLastHistogram() {
+		return lastHistogram;
+	}
+
+	/**
+	 * Eventos de los BoxValues
+	 */
+	public void actionValueChanged(GraphicEvent e) {
+		updateStatistic();
+		updateGraphic();
+	}
+
+	/**
+	 *  Cuando se selecciona/deselecciona una banda
+	 */
+	public void propertyChange(PropertyChangeEvent evt) {
+		if (!eventsEnabled)
+			return;
+		int countRow = ((DefaultTableModel) getHistogramPanel().getJTableBands().getModel()).getRowCount();
+		for (int i = 0; i < countRow; i++)
+			showBands[i] = ((Boolean) ((DefaultTableModel) getHistogramPanel().getJTableBands().getModel()).getValueAt(i, 0)).booleanValue();
+
+		updateStatistic();
+		updateGraphic();
+	}
+
+	public void interrupted() {}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/histogram/HistogramPanelListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:executable
   + *

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/histogram/HistogramTocMenuEntry.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/histogram/HistogramTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/histogram/HistogramTocMenuEntry.java	(revision 8183)
@@ -0,0 +1,125 @@
+/* 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.tools.app.basic.tool.histogram;
+
+import javax.swing.Icon;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.layers.ILayerState;
+import org.gvsig.raster.fmap.layers.IRasterLayerActions;
+import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.RasterToolsUtil;
+import org.gvsig.raster.tools.app.basic.tool.histogram.ui.HistogramDialog;
+
+/**
+ * Punto de entrada del menu del histograma.
+ *
+ * @version 17/04/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class HistogramTocMenuEntry extends AbstractTocContextMenuAction implements IGenericToolBarMenuItem {
+	static private HistogramTocMenuEntry singleton  = null;
+
+	/**
+	 * Nadie puede crear una instancia a esta clase �nica, hay que usar el
+	 * getSingleton()
+	 */
+	private HistogramTocMenuEntry() {}
+
+	/**
+	 * Devuelve un objeto unico a dicha clase
+	 * @return
+	 */
+	static public HistogramTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new HistogramTocMenuEntry();
+		return singleton;
+	}
+	
+	public String getGroup() {
+		return "RasterLayer";
+	}
+
+	public int getGroupOrder() {
+		return 10;
+	}
+
+	public int getOrder() {
+		return 30;
+	}
+
+	public String getText() {
+		return RasterToolsUtil.getText(this, "histograma");
+	}
+
+	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 false;
+		
+		return ((IRasterLayerActions) selectedItems[0]).isActionEnabled(IRasterLayerActions.HISTOGRAM);
+	}
+
+	public void execute(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return;
+
+		if (!(selectedItems[0] instanceof FLyrRaster))
+			return;
+
+		FLyrRaster fLayer = (FLyrRaster) selectedItems[0];
+
+		try {
+			HistogramDialog histogramDialog = null;
+			histogramDialog = new HistogramDialog(650, 500);
+			histogramDialog.setLayer(fLayer);
+			histogramDialog.getHistogramPanel().firstRun(); // Mostar por primera vez el histograma
+			histogramDialog.setVisible(true);
+			PluginServices.getMDIManager().addCentredWindow(histogramDialog);
+		} catch (Exception e) {
+			RasterSwingLibrary.messageBoxError(Messages.getText("histogram_error"), this, e);
+			return;
+		}
+	}
+	
+	public Icon getIcon() {
+		return RasterToolsUtil.getIcon("layer-histogram");
+	}
+	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/histogram/HistogramTocMenuEntry.java
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/histogram/ui/HistogramDialog.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/histogram/ui/HistogramDialog.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/histogram/ui/HistogramDialog.java	(revision 8183)
@@ -0,0 +1,126 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
+ */
+package org.gvsig.raster.tools.app.basic.tool.histogram.ui;
+
+import java.awt.BorderLayout;
+
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.andami.ui.mdiManager.WindowInfo;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+
+/**
+ * <code>HistogramDialog</code>. Creaci�n de la ventana de histograma para gvSIG.
+ *
+ * @version 20/03/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ * @author BorSanZa - Borja Sanchez Zamorano 
+ */
+public class HistogramDialog extends JPanel implements IWindow, ButtonsPanelListener {
+	private static final long serialVersionUID = 7362459094802955247L;
+	private HistogramPanel histogramPanel = null;
+	private String         layerName      = null;
+
+	/**
+	 * Crea la ventana del histograma con un ancho y alto.
+	 * @param width Ancho de la ventana
+	 * @param height Alto de la ventana
+	 */
+	public HistogramDialog(int width, int height){
+		this.setSize(width, height);
+		this.setLayout(new BorderLayout(5, 5));
+		this.add(getHistogramPanel(), java.awt.BorderLayout.CENTER);
+	}
+	
+	/**
+	 * Asigna la capa para obtener las fuentes de datos tanto del 
+	 * datasource como de la visualizaci�n.
+	 * @param lyr Capa
+	 */
+	public void setLayer(FLyrRaster lyr) throws Exception {
+		layerName = lyr.getName();
+		getHistogramPanel().setDataType(lyr.getDataStore().getDataType()[0]);
+		getHistogramPanel().setLayer(lyr);
+	}
+
+	/**
+	 * Obtiene el panel con el histograma
+	 * @return HistogramPanel
+	 */
+	public HistogramPanel getHistogramPanel() {
+		if (histogramPanel == null) {
+			histogramPanel = new HistogramPanel();
+			histogramPanel.addButtonPressedListener(this);
+		}
+		return histogramPanel;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.andami.ui.mdiManager.IWindow#getWindowInfo()
+	 */
+	public WindowInfo getWindowInfo() {
+		WindowInfo m_viewinfo=new WindowInfo(WindowInfo.MODELESSDIALOG | WindowInfo.RESIZABLE | WindowInfo.MAXIMIZABLE);
+		if (getLayerName() != null)
+			m_viewinfo.setAdditionalInfo(getLayerName());
+		m_viewinfo.setTitle(PluginServices.getText(this, "histograma"));
+		m_viewinfo.setHeight(this.getHeight());
+		m_viewinfo.setWidth(this.getWidth());
+		return m_viewinfo;
+	}
+
+	/**
+	 * Acciones a ejecutar cuando se cancela
+	 */
+	private void close() {
+		try {
+			PluginServices.getMDIManager().closeWindow(this);
+		} catch (ArrayIndexOutOfBoundsException e) {
+			//Si la ventana no se puede eliminar no hacemos nada
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener#actionButtonPressed(org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent)
+	 */
+	public void actionButtonPressed(ButtonsPanelEvent e) {
+		if (e.getButton() == ButtonsPanel.BUTTON_CLOSE) {
+			close();
+		}
+	}
+
+	/**
+	 * Obtiene el nombre de la capa. Esto no es necesario para la funcionalidad de histograma.
+	 * Solo se usa para destruir el dialogo si est� abierto cuando se destruye la capa.
+	 * @return Nombre de la capa
+	 */
+	public String getLayerName() {
+		return layerName;
+	}
+
+	public Object getWindowProfile() {
+		return WindowInfo.PROPERTIES_PROFILE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/histogram/ui/HistogramDialog.java
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/histogram/ui/HistogramPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/histogram/ui/HistogramPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/histogram/ui/HistogramPanel.java	(revision 8183)
@@ -0,0 +1,551 @@
+/* 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.tools.app.basic.tool.histogram.ui;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.table.DefaultTableModel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.messages.NotificationManager;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer;
+import org.gvsig.fmap.dal.coverage.util.MathUtils;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
+import org.gvsig.gui.beans.defaultbuttonspanel.DefaultButtonsPanel;
+import org.gvsig.gui.beans.graphic.GraphicContainer;
+import org.gvsig.gui.beans.table.TableContainer;
+import org.gvsig.gui.beans.table.exceptions.NotInitializeException;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.tools.app.basic.tool.histogram.HistogramPanelListener;
+
+/**
+ * <code>HistogramPanel</code>. Interfaz de usuario para la representaci�n de
+ * histogramas.
+ *
+ * @author Diego Guerrero (diego.guerrero@uclm.es)
+ * @author BorSanZa - Borja Sanchez Zamorano
+ */
+@SuppressWarnings("unchecked")
+public class HistogramPanel extends DefaultButtonsPanel implements ButtonsPanelListener {
+	private static final long           serialVersionUID         = 2772897994667886753L;
+	private MathUtils                   math                     = RasterLocator.getManager().getMathUtils();
+	/**
+	 * Objeto que controlara toda la carga pesada del panel
+	 */
+	private HistogramPanelListener histogramPanelListener = null;
+
+	/**
+	 * Array para la seleccion del origen
+	 */
+	private ArrayList              comboSource            = new ArrayList();
+
+	/**
+	 * Variable para controlar si se dispararan los eventos del panel, si es la
+	 * primera vez no tiene porque disparar eventos.
+	 */
+	public boolean                 panelInizialited       = false;
+
+	/**
+	 * Componentes graficos
+	 */
+	private JComboBox              comboBoxSource         = null;
+	private JComboBox              comboBoxType           = null;
+	private JButton                bTable                 = null;
+	private JPanel                 panelNorth             = null;
+	private JPanel                 panelSouth             = null;
+	private JButton                buttonShowAll          = null;
+	private JButton                buttonClean            = null;
+	private JTable                 jTableBands            = null;
+	private JCheckBox              checkBoxDeleteEdges    = null;
+	private JCheckBox              checkBoxRGB            = null;
+	private TableContainer         tableContainer         = null;
+	private GraphicContainer       graphicContainer       = null;
+
+	/**
+	 * Tipo de dato de la petici�n. Si la petici�n del histograma es de la vista
+	 * el tipo de dato ser� byte aunque la imagen sea de 16 bits. Si la petici�n
+	 * es de los datos reales de la imagen entonces el tipo de dato de la petici�n
+	 * coincide con el tipo de datos de la imagen.
+	 */
+	private int                    dataType               = Buffer.TYPE_BYTE;
+
+	/**
+	 * Crea un dialogo para los histogramas.
+	 *
+	 */
+	public HistogramPanel() {
+		super(ButtonsPanel.BUTTONS_NONE);
+		this.getButtonsPanel().addHideDetails();
+		this.getButtonsPanel().addSeeDetails();
+		this.getButtonsPanel().getButton(ButtonsPanel.BUTTON_SEEDETAILS).setVisible(false);
+		this.getButtonsPanel().getButton(ButtonsPanel.BUTTON_SEEDETAILS).setText(PluginServices.getText(this, "mostrar_estadisticas"));
+		this.getButtonsPanel().getButton(ButtonsPanel.BUTTON_HIDEDETAILS).setText(PluginServices.getText(this, "ocultar_estadisticas"));
+		this.getButtonsPanel().addClose();
+		this.addButtonPressedListener(this);
+		histogramPanelListener = getHistogramPanelListener();
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 *
+	 */
+	private void initialize() {
+		this.setLayout(new BorderLayout(5, 5));
+		this.add(getPanelNorth(), java.awt.BorderLayout.NORTH);
+		this.add(getGraphicContainer(), java.awt.BorderLayout.CENTER);
+		this.add(getPanelSouth(), java.awt.BorderLayout.SOUTH);
+		this.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
+
+		getHistogramPanelListener().setControlListeners();
+	}
+
+	public ArrayList getComboSource() {
+		return comboSource;
+	}
+
+	/**
+	 * Asigna una fuente de datos de un histograma. Hay dos tipos de fuentes de
+	 * datos, la de los datos visualizados y la del dataset. Ambas deben ser
+	 * objetos IHistogramable aunquela primera sea un buffer de datos y la segunda
+	 * un Dataset.
+	 * @param source Fuente de datos del histograma.
+	 * @param name Etiqueta que aparece en el combo para el cambio de fuente de datos
+	 */
+	private void setHistogramableSource(HistogramComputer source, String name) {
+		getHistogramPanelListener().eventsEnabled = false;
+		List<Object> aux = new ArrayList<Object>();
+		aux.add(source);
+		aux.add(name);
+		getComboSource().add(aux);
+		updateComboBoxSource();
+		getHistogramPanelListener().eventsEnabled = panelInizialited;
+	}
+
+	private void updateComboBoxSource() {
+		getHistogramPanelListener().eventsEnabled = false;
+		getComboBoxSource().removeAllItems();
+		for (int i = 0; i < getComboSource().size(); i++) {
+			getComboBoxSource().addItem(((ArrayList) getComboSource().get(i)).get(1));
+		}
+		getHistogramPanelListener().eventsEnabled = panelInizialited;
+	}
+
+	/**
+	 * Asigna la capa para obtener las fuentes de datos tanto del
+	 * datasource como de la visualizaci�n.
+	 * @param lyr Capa
+	 */
+	public void setLayer(FLyrRaster lyr) throws Exception {
+		if(!((FLyrRaster) lyr).getDataStore().isTiled())
+			setHistogramableSource(((FLyrRaster) lyr).getRender().getLastRenderBuffer().getHistogramComputer(), PluginServices.getText(this, "datos_visualizados"));
+		//Para los raster sin limites o tama�o de pixel no se puede calcular el extent completo
+		if(!((FLyrRaster) lyr).getDataStore().isRasterEnclosed())
+			setHistogramableSource(((FLyrRaster) lyr).getDataStore().getHistogramComputer(), PluginServices.getText(this, "imagen_completa"));
+		getHistogramPanelListener().setLayer(lyr);
+	}
+
+	/**
+	 * This method initializes jPanel
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	public GraphicContainer getGraphicContainer() {
+		if (graphicContainer == null) {
+			graphicContainer = new GraphicContainer(true);
+		}
+		return graphicContainer;
+	}
+
+	/**
+	 * This method initializes jPanel
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getPanelSouth() {
+		if (panelSouth == null) {
+			panelSouth = new JPanel();
+			panelSouth.setLayout(new BorderLayout(5, 5));
+			panelSouth.add(getTableContainer(), BorderLayout.CENTER);
+
+			JPanel jPanel2 = new JPanel();
+			jPanel2.setLayout(new javax.swing.BoxLayout(jPanel2, javax.swing.BoxLayout.Y_AXIS));
+			jPanel2.add(getBCreateTable());
+			jPanel2.add(getCheckBoxDeleteEdges());
+			jPanel2.add(getCheckBoxRGB());
+			jPanel2.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
+
+			panelSouth.add(jPanel2, BorderLayout.EAST);
+		}
+		return panelSouth;
+	}
+
+	public JCheckBox getCheckBoxDeleteEdges() {
+		if (checkBoxDeleteEdges == null) {
+			checkBoxDeleteEdges = new JCheckBox(PluginServices.getText(this, "eliminar_extremos"));
+			checkBoxDeleteEdges.addActionListener(histogramPanelListener);
+		}
+		return checkBoxDeleteEdges;
+	}
+
+	public JCheckBox getCheckBoxRGB() {
+		if (checkBoxRGB == null) {
+			checkBoxRGB = new JCheckBox(PluginServices.getText(this, "RGB"));
+			checkBoxRGB.addActionListener(histogramPanelListener);
+		}
+		return checkBoxRGB;
+	}
+
+	/**
+	 * Obtiene la tabla de estadisticas
+	 * @return
+	 */
+	private TableContainer getTableContainer(){
+		if (tableContainer == null) {
+			String[] columnNames = { PluginServices.getText(this, "band"), PluginServices.getText(this, "minimo"), PluginServices.getText(this, "maximo"), PluginServices.getText(this, "media"), PluginServices.getText(this, "median"), PluginServices.getText(this, "npixeles") };
+			int[] columnWidths = { 50, 65, 65, 65, 65, 115 };
+			tableContainer = new TableContainer(columnNames, columnWidths);
+			tableContainer.setPreferredSize(new Dimension(0, 90));
+			tableContainer.setControlVisible(true);
+			tableContainer.setModel("ListModel");
+			tableContainer.initialize();
+			tableContainer.setName("tableContainer");
+			tableContainer.setControlVisible(false);
+
+			try {
+				tableContainer.setEditable(false);
+			} catch (NotInitializeException ex) {
+			}
+		}
+		return tableContainer;
+	}
+
+	/**
+	 * Devuelve el boton de mostrar todas las bandas
+	 * @return JButton
+	 */
+	public JButton getButtonShowAll() {
+		if (buttonShowAll == null) {
+			buttonShowAll = new JButton(PluginServices.getText(this, "boton_mostrar"));
+			buttonShowAll.addActionListener(getHistogramPanelListener());
+		}
+		return buttonShowAll;
+	}
+
+	/**
+	 * Devuelve el boton de limpiar las bandas
+	 * @return JButton
+	 */
+	public JButton getButtonClean() {
+		if (buttonClean == null) {
+			buttonClean = new JButton(PluginServices.getText(this, "boton_limpiar"));
+			buttonClean.addActionListener(getHistogramPanelListener());
+		}
+		return buttonClean;
+	}
+
+	/**
+	 * This method initializes jPanel
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getPanelNorth() {
+		if (panelNorth == null) {
+			panelNorth = new JPanel();
+			JScrollPane jScrollPane1 = new JScrollPane();
+			JPanel jPanel4 = new JPanel();
+			java.awt.GridBagConstraints gridBagConstraints;
+
+			jScrollPane1.setPreferredSize(new java.awt.Dimension(120,65));
+			jScrollPane1.setViewportView(getJTableBands());
+
+			panelNorth.setLayout(new BorderLayout());
+			panelNorth.add(jPanel4, BorderLayout.CENTER);
+			panelNorth.add(jScrollPane1, BorderLayout.EAST);
+
+			jPanel4.setLayout(new java.awt.GridBagLayout());
+			JLabel jLabel1 = new JLabel(PluginServices.getText(this, "origen")+":");
+			gridBagConstraints = new java.awt.GridBagConstraints();
+			gridBagConstraints.gridx = 0;
+			gridBagConstraints.gridy = 0;
+			gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
+			gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
+			jPanel4.add(jLabel1, gridBagConstraints);
+
+			JLabel jLabel2 = new JLabel(PluginServices.getText(this, "tipo")+":");
+			gridBagConstraints = new java.awt.GridBagConstraints();
+			gridBagConstraints.gridx = 0;
+			gridBagConstraints.gridy = 1;
+			gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
+			gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5);
+			jPanel4.add(jLabel2, gridBagConstraints);
+
+			gridBagConstraints = new java.awt.GridBagConstraints();
+			gridBagConstraints.gridx = 1;
+			gridBagConstraints.gridy = 0;
+			gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
+			jPanel4.add(getComboBoxSource(), gridBagConstraints);
+
+			gridBagConstraints = new java.awt.GridBagConstraints();
+			gridBagConstraints.gridx = 1;
+			gridBagConstraints.gridy = 1;
+			gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
+			jPanel4.add(getComboBoxType(), gridBagConstraints);
+
+			gridBagConstraints = new java.awt.GridBagConstraints();
+			gridBagConstraints.gridx = 2;
+			gridBagConstraints.gridy = 0;
+			gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+			gridBagConstraints.insets = new java.awt.Insets(0, 15, 0, 0);
+			jPanel4.add(getButtonShowAll(), gridBagConstraints);
+
+			gridBagConstraints = new java.awt.GridBagConstraints();
+			gridBagConstraints.gridx = 2;
+			gridBagConstraints.gridy = 1;
+			gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+			gridBagConstraints.insets = new java.awt.Insets(0, 15, 0, 0);
+			jPanel4.add(getButtonClean(), gridBagConstraints);
+		}
+		return panelNorth;
+	}
+
+	/**
+	 * Obtiene el combo con la selecci�n de tipo de histograma, acumulado/no acumulado
+	 * @return javax.swing.JComboBox
+	 */
+	public JComboBox getComboBoxType() {
+		if (comboBoxType == null) {
+			String lista [] = { "normal", "accumulated", "logaritmic" };
+			for (int i = 0; i < lista.length; i++)
+				lista[i] = PluginServices.getText(this, lista[i]);
+			comboBoxType = new JComboBox(lista);
+			comboBoxType.addActionListener(getHistogramPanelListener());
+			comboBoxType.setPreferredSize(new java.awt.Dimension(150, 25));
+		}
+		return comboBoxType;
+	}
+
+	/**
+	 * Obtiene el combo con la selecci�n de la fuente de datos en el calculo del histograma,
+	 * datos de la vista, datos reales con el extent de la vista e imagen completa.
+	 * @return javax.swing.JComboBox
+	 */
+	public JComboBox getComboBoxSource() {
+		if (comboBoxSource == null) {
+			comboBoxSource = new JComboBox();
+			comboBoxSource.addActionListener(getHistogramPanelListener());
+			comboBoxSource.setPreferredSize(new java.awt.Dimension(150,25));
+		}
+		return comboBoxSource;
+	}
+
+	/**
+	 * This method initializes jButton
+	 *
+	 * @return javax.swing.JButton
+	 */
+	public JButton getBCreateTable() {
+		if (bTable == null) {
+			bTable = new JButton();
+			bTable.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
+			bTable.setText(PluginServices.getText(this, "crear_tabla"));
+			bTable.setName("bTable");
+			bTable.addActionListener(getHistogramPanelListener());
+			bTable.setPreferredSize(new java.awt.Dimension(150,25));
+		}
+		return bTable;
+	}
+
+	/**
+	 * This method initializes jComboBox
+	 *
+	 * @return javax.swing.JComboBox
+	 */
+	public JTable getJTableBands() {
+		getHistogramPanelListener().eventsEnabled = false;
+		if (jTableBands == null) {
+			jTableBands = new JTable();
+			jTableBands.setModel(new javax.swing.table.DefaultTableModel(new Object[][] {}, new String[] { " ", PluginServices.getText(this, "bandas") }) {
+				private static final long    serialVersionUID = 0L;
+				Class<?>[]                   types            = new Class[] { java.lang.Boolean.class, java.lang.String.class };
+				boolean[]                    canEdit          = new boolean[] { true, false };
+
+				public Class<?> getColumnClass(int columnIndex) {
+					return types[columnIndex];
+				}
+
+				public boolean isCellEditable(int rowIndex, int columnIndex) {
+					return canEdit[columnIndex];
+				}
+			});
+			jTableBands.addPropertyChangeListener(getHistogramPanelListener());
+			jTableBands.getColumnModel().getColumn(0).setPreferredWidth(20);
+			jTableBands.getColumnModel().getColumn(0).setResizable(false);
+		}
+		getHistogramPanelListener().eventsEnabled = panelInizialited;
+		return jTableBands;
+	}
+
+	/**
+	 * Asigna el n�mero de bandas al combobox
+	 *
+	 * @param bands N�mero de bandas de la imagen
+	 */
+	private void setBands(int bands, boolean initValue) {
+		getHistogramPanelListener().eventsEnabled = false;
+
+		((DefaultTableModel) getJTableBands().getModel()).setRowCount(0);
+		for (int i = 0; i < bands; i++) {
+			((DefaultTableModel) getJTableBands().getModel()).addRow(new Object[] { new Boolean(initValue), PluginServices.getText(this, "band") + " " + String.valueOf(i) });
+		}
+		getHistogramPanelListener().eventsEnabled = panelInizialited;
+	}
+
+	/**
+	 * Asigna la estadistica a la tabla
+	 * @param stat
+	 */
+	public void setStatistic(double[][] stat){
+		try {
+			getTableContainer().removeAllRows();
+			if (stat == null)
+				return;
+			for (int iBand = 0; iBand < stat[0].length; iBand++) {
+				Object[] list = new Object[stat.length + 1];
+				list[0] = new Integer(iBand);
+				for (int iStat = 1; iStat <= stat.length; iStat++) {
+					if(stat[iStat - 1] != null && iBand < stat[iStat - 1].length)
+						list[iStat] = new Double(math.format(new Double(stat[iStat - 1][iBand]).doubleValue(), 3));
+				}
+
+				getTableContainer().addRow(list);
+				list = null;
+			}
+		} catch (NotInitializeException e) {
+			NotificationManager.addError("Error al eliminar las filas de la tabla", e);
+		}
+	}
+
+	/**
+	 * Resetea el control de bandas del panel con los valores RGB para
+	 * cuando se est� haciendo el histograma de la visualizaci�n en
+	 * vez del histograma con los datos
+	 *
+	 */
+	public void setRGBInBandList(boolean initValue){
+		getHistogramPanelListener().eventsEnabled = false;
+
+		((DefaultTableModel) getJTableBands().getModel()).setRowCount(0);
+		((DefaultTableModel) getJTableBands().getModel()).addRow(new Object[] { new Boolean(initValue), "R"});
+		((DefaultTableModel) getJTableBands().getModel()).addRow(new Object[] { new Boolean(initValue), "G"});
+		((DefaultTableModel) getJTableBands().getModel()).addRow(new Object[] { new Boolean(initValue), "B"});
+
+		getHistogramPanelListener().eventsEnabled = panelInizialited;
+	}
+
+	/**
+	 * Obtiene el valor del control izquierdo en el rango 0-100. Los controles dan
+	 * un rango en tanto por cien 0-100.
+	 * @return Valor del control de la izquierda
+	 */
+	public double getBoxValueX1() {
+		return getGraphicContainer().getX1();
+	}
+
+	/**
+	 * Obtiene el valor del control derecha en el rango 0-100. Los controles dan
+	 * un rango en tanto por cien 0-100.
+	 * @return Valor del control de la derecha
+	 */
+	public double getBoxValueX2() {
+		return getGraphicContainer().getX2();
+	}
+
+	private HistogramPanelListener getHistogramPanelListener() {
+		if (histogramPanelListener == null) {
+			histogramPanelListener = new HistogramPanelListener(this);
+		}
+		return histogramPanelListener;
+	}
+
+	public void refreshBands(boolean initValue) {
+		if (getHistogramPanelListener().getLastHistogram() == null) {
+			setBands(0, initValue);
+			return;
+		}
+
+		//En caso de que el histograma se monte a partir de los datos de la vista ponemos RGB en el combo
+		int bandCount = getHistogramPanelListener().getLastHistogram().getNumBands();
+		if ((getComboBoxSource().getSelectedIndex() == 0) && (bandCount == 3)) {
+			setRGBInBandList(initValue);
+		} else {
+			setBands(bandCount, initValue);
+		}
+	}
+
+	public void firstRun() {
+		getHistogramPanelListener().showHistogram();
+	}
+
+	/**
+	 * Asigna el tipo de dato de la capa
+	 * @param dataType
+	 */
+	public void setDataType(int dataType) {
+		this.dataType = dataType;
+	}
+
+	/**
+	 * Obtiene el tipo de dato de la capa
+	 * @param dataType
+	 */
+	public int getDataType() {
+		return dataType;
+	}
+
+	public void actionButtonPressed(ButtonsPanelEvent e) {
+		switch (e.getButton()) {
+			case ButtonsPanel.BUTTON_HIDEDETAILS:
+				this.getButtonsPanel().getButton(ButtonsPanel.BUTTON_HIDEDETAILS).setVisible(false);
+				this.getButtonsPanel().getButton(ButtonsPanel.BUTTON_SEEDETAILS).setVisible(true);
+				panelSouth.setVisible(false);
+				break;
+			case ButtonsPanel.BUTTON_SEEDETAILS:
+				this.getButtonsPanel().getButton(ButtonsPanel.BUTTON_HIDEDETAILS).setVisible(true);
+				this.getButtonsPanel().getButton(ButtonsPanel.BUTTON_SEEDETAILS).setVisible(false);
+				panelSouth.setVisible(true);
+				break;
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/histogram/ui/HistogramPanel.java
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/histogram/ui
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/histogram
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/package.html
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/package.html	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/package.html	(revision 8183)
@@ -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.raster package documentation</title>
+</head>
+<body>
+
+	<p>Raster gvSIG extension</p>
+	
+	<p>
+	Shows Raster into gvSIG.
+	</p>
+
+</body>
+</html>
\ No newline at end of file

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/RasterToolsUtil.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/RasterToolsUtil.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/RasterToolsUtil.java	(revision 8183)
@@ -0,0 +1,506 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+package org.gvsig.raster.tools.app.basic;
+
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Point;
+import java.awt.Window;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.swing.ImageIcon;
+import javax.swing.JOptionPane;
+
+import org.cresques.cts.IProjection;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.Launcher;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.ApplicationLocator;
+import org.gvsig.app.ApplicationManager;
+import org.gvsig.app.prepareAction.PrepareContextView_v1;
+import org.gvsig.app.project.Project;
+import org.gvsig.app.project.ProjectManager;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.app.project.documents.view.toc.actions.LayerErrorsPanel;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataStore;
+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.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.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.serverexplorer.filesystem.FilesystemFileFilter;
+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.swing.FilesystemExplorerWizardPanel;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.swing.FilesystemExplorerWizardPanel.MyFileFilter;
+import org.gvsig.fmap.mapcontext.MapContext;
+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.fmap.mapcontrol.MapControl;
+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;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dispose.DisposeUtils;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.identitymanagement.UnauthorizedException;
+import org.gvsig.tools.swing.api.ToolsSwingLocator;
+import org.gvsig.tools.swing.api.windowmanager.WindowManager;
+
+/**
+ * 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.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RasterToolsUtil {
+
+    private static final Logger logger = LoggerFactory.getLogger(RasterToolsUtil.class);
+
+
+	/**
+	 * 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);
+	}
+
+	/**
+	 * Devuelve la traducci�n de un texto. En caso de no existir la traducci�n al idioma seleccionado
+	 * devolver� la cadena de entrada.
+	 * @param parent Ventana padre que contiene el objeto con la traducci�n
+	 * @param text Texto a traducir
+	 * @return Texto traducido o cadena de entrada en caso de no encontrar una traducci�n
+	 */
+	public static String getText(Object parent, String text) {
+		return PluginServices.getText(parent, text);
+	}
+
+	/**
+	 * Obtiene un icono definido por la etiqueta que se especifica en el
+	 * par�metro
+	 * @param ico Etiqueta del icono
+	 * @return Icono
+	 */
+	public static ImageIcon getIcon(String ico) {
+		return IconThemeHelper.getImageIcon(ico);
+	}
+
+	/**
+	 * 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 = getText(null, 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(getText(null, ((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) {
+		File f = new File(path);
+		if(f.exists() && f.canWrite())
+			return true;
+		else {
+			JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(),
+						Messages.getText("error_writing_raster_file"));
+			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 void loadLayer(String viewName, String fileName, final String layerName) throws RasterNotLoadException {
+	    //Este m�todo, antes devolv�a la layer a�adida, pero no hevisto ning�n sitio d�nde se utilizara.
+		if(fileName ==  null){
+			return;
+		}
+		File file = new File(fileName);
+
+		//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.");
+		}
+
+		DataManager dm = DALLocator.getDataManager();
+        FilesystemServerExplorerParameters param;
+        FilesystemServerExplorer explorer;
+        try {
+            param = (FilesystemServerExplorerParameters) dm
+                    .createServerExplorerParameters(FilesystemServerExplorer.NAME);
+            explorer = (FilesystemServerExplorer) dm.openServerExplorer(
+                            FilesystemServerExplorer.NAME, param);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+
+        int mode = FilesystemServerExplorer.MODE_RASTER;
+
+        try {
+
+            final DataStoreParameters parameters = explorer.createStoreParameters(file);
+
+            final MapControl mapControl = theView.getMapControl();
+            final boolean b_isMapControlAvail = (mapControl!=null);
+            final MapContext mapContext = mapControl.getMapContext();
+            final ApplicationManager application = ApplicationLocator.getManager();
+            final MapContextManager manager = MapContextLocator.getMapContextManager();
+
+            logger.info("addLayer('{}',...)", layerName);
+            Thread task = new Thread(new Runnable() {
+
+                @Override
+                public void run() {
+                    FLayer layer = null;
+                    FLayer preparedLayer = null;
+                    try {
+                        DataManager dataManager = DALLocator.getDataManager();
+                        final DataStore dataStore = dataManager.openStore(parameters.getDataStoreName(), parameters);
+                        DataStoreProviderFactory factory = dataStore.getProviderFactory();
+                        //Descomentarizar si se desea tilear estas capas
+
+//                        if (factory.isTiledSupported() != DataStoreProviderFactory.NO) {
+//                            if (isTiled(parameters)) {
+//                                DynObject tileParameters = dataManager.createStoreParameters("TileCache");
+//
+//                                File rootFolder = new File(Launcher.getAppHomeDir() + File.separator + "gvsig_rcache");
+//
+//                                if (tileParameters.getDynClass().getDynField("rootFolder") != null) {
+//                                    tileParameters.setDynValue("rootFolder", rootFolder);
+//                                }
+//
+//                                try {
+//                                    dataStore.useCache("TileCache", tileParameters);
+//                                } catch (DataException e) {
+//                                    logger.warn("Can't cache the layer.", e);
+//                                }
+//
+//                            }
+//                        }
+                        String name;
+                        if (layerName == null) {
+                            name = dataStore.getName();
+                        } else {
+                            name = layerName;
+                        }
+                        layer = manager.createLayer(name, dataStore);
+
+                        DisposeUtils.disposeQuietly(dataStore);
+                        preparedLayer = application.prepareOpenLayer(layer, new PrepareContextView_v1() {
+
+                            @Override
+                            public Window getOwnerWindow() {
+                                return null;
+                            }
+
+                            @Override
+                            public MapControl getMapControl() {
+                                return mapControl;
+                            }
+
+                            @Override
+                            public IProjection getViewProjection() {
+                                return mapContext.getProjection();
+                            }
+
+                            @Override
+                            public MapContext getMapContext() {
+                                return mapContext;
+                            }
+
+                            @Override
+                            public boolean isMapControlAvailable() {
+                                return b_isMapControlAvail;
+                            }
+                        });
+                        if (preparedLayer != null) {
+                            mapContext.getLayers().addLayer(preparedLayer);
+                        }
+                    } catch (UnauthorizedException e) {
+                        I18nManager i18nManager = ToolsLocator.getI18nManager();
+                        ApplicationManager application = ApplicationLocator.getManager();
+                        String resource = "";
+                        if (e.getResource() instanceof FilesystemStoreParameters) {
+                            resource = ((FilesystemStoreParameters) e.getResource()).getFile().getPath();
+                        }
+                        application.messageDialog(
+                            i18nManager.getTranslation("_User_0_is_not_authorized_to_1_on_resource_2_3", new String[] {
+                                e.getIdentity().getID(), e.getActionName(), e.getResourceName(), resource }),
+                            i18nManager.getTranslation("_Unauthorized_access"), JOptionPane.WARNING_MESSAGE);
+                        logger.warn("Unauthorized access to layer '" + layerName + "'.", e);
+
+                    } catch (Exception e) {
+                        LayerErrorsPanel panel = new LayerErrorsPanel(layerName, e);
+                        if (preparedLayer != null) {
+                            panel.setLayer(preparedLayer);
+                        } else if (layer != null) {
+                            panel.setLayer(layer);
+                        }
+                        I18nManager i18nManager = ToolsLocator.getI18nManager();
+                        ToolsSwingLocator.getWindowManager().showWindow(panel,
+                            i18nManager.getTranslation("_Problems_loading_the_layer"), WindowManager.MODE.WINDOW);
+                        logger.warn("Can't load layer '" + layerName + "'.", e);
+
+                    } finally {
+                        if (preparedLayer != layer) {
+                            DisposeUtils.disposeQuietly(preparedLayer);
+                        }
+                        DisposeUtils.disposeQuietly(layer);
+                    }
+                }
+            });
+            task.start();
+            return;
+
+        } catch (DataException e){
+            throw new RasterNotLoadException("Error al cargar la capa.");
+        }
+	}
+
+	/**
+	 * 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.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/RasterToolsUtil.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/IProcessActions.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/IProcessActions.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/IProcessActions.java	(revision 8183)
@@ -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.tools.app.basic.raster.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);
+}

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/OverviewsProcess.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/OverviewsProcess.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/OverviewsProcess.java	(revision 8183)
@@ -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.tools.app.basic.raster.process;
+
+import java.io.File;
+import java.net.URI;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.exception.OverviewException;
+import org.gvsig.fmap.dal.coverage.process.BaseIncrementableTask;
+import org.gvsig.fmap.dal.coverage.process.overview.OverviewBuilder;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.mainplugin.config.Configuration;
+
+
+/**
+ * Proceso para la generaci�n de overviews.
+ *
+ * 10/12/2007
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class OverviewsProcess extends RasterProcess implements BaseIncrementableTask {
+	private FLyrRaster   rasterSE      = null;
+	private int          value         = 0;
+	private int          resamplingAlg = OverviewBuilder.AVERAGE;
+	private int[]        overviews     = new int[] { 2, 4, 8, 16 };
+	private String       builder       = "GDAL";
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.RasterProcess#init()
+	 */
+	public void init() {
+		rasterSE = getLayerParam("layer");
+		builder = getStringParam("builder") != null ? getStringParam("builder") : builder;
+
+		int overviewsRate = 2;
+		int nOverviews = 4;
+		overviewsRate = Configuration.getValue("overviews_rate", new Integer(overviewsRate)).intValue();
+		nOverviews = Configuration.getValue("overviews_number", new Integer(nOverviews)).intValue();
+		resamplingAlg = Configuration.getValue("overviews_resampling_algorithm", new Integer(resamplingAlg)).intValue();
+
+		// Leemos de la configuraci�n los valores de algoritmo a usar,
+		// n�mero de overviews a generar y proporci�n de la primera overview
+
+		overviews = new int[nOverviews];
+		overviews[0] = overviewsRate;
+		for (int i = 1; i < nOverviews; i++)
+			overviews[i] = overviewsRate * overviews[i - 1];
+	}
+
+	/**
+	 * M�todo donde se ejecutar� el Thread, aqu� se generaran las
+	 * overviews
+	 * @throws ProcessException
+	 */
+	public void process() throws ProcessException {
+		insertLineLog(PluginServices.getText(this, "overviews_generating"));
+		OverviewBuilder overviewBuilder = RasterLocator.getManager().getOverviewBuilder(builder);
+
+		overviewBuilder.setIncrementListener(this);
+		try {
+			URI[] uri = rasterSE.getDataStore().getURIByProvider();
+
+			for (int i = 0; i < uri.length; i++) {
+				insertLineLog(" Dataset: " + i);
+				overviewBuilder.buildOverviews(resamplingAlg, new File(uri[i]).getAbsolutePath(), overviews);
+			}
+
+			if (externalActions != null)
+				externalActions.end(rasterSE);
+		} catch (OverviewException e) {
+			if (incrementableTask != null)
+				incrementableTask.hideWindow();
+			throw new ProcessException("error_write_overviews", e);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#getPercent()
+	 */
+	public int getPercent() {
+		return value;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.addo.IOverviewIncrement#setPercent(int)
+	 */
+	public void setPercent(int value) {
+		this.value = value;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#getTitle()
+	 */
+	public String getTitle() {
+		return PluginServices.getText(this, "incremento_overview");
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.lang.Object#finalize()
+	 */
+	protected void finalize() throws Throwable {
+		rasterSE           = null;
+		overviews           = null;
+		super.finalize();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/OverviewsProcess.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/StatisticsProcess.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/StatisticsProcess.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/StatisticsProcess.java	(revision 8183)
@@ -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.tools.app.basic.raster.process;
+
+import javax.swing.SwingUtilities;
+
+import org.gvsig.andami.PluginServices;
+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.store.props.Statistics;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+
+
+/**
+ * Proceso para la generaci�n de estad�sticas.
+ *
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class StatisticsProcess extends RasterProcess {
+	private FLyrRaster            lyr   = null;
+	private Statistics            stats = null;
+	private boolean               force = false;
+	private double                scale = 1;
+
+	/**
+	 * Lanzador del procesos de estad�sticas
+	 * @param lyr Capa a calcular las estad�sticas
+	 * @param actions Clase que recoge eventos del proceso
+	 */
+	public static void launcher(FLyrRaster lyr, IProcessActions actions) {
+		RasterProcess process = new StatisticsProcess();
+		process.addParam("layer", lyr);
+		process.addParam("force", new Boolean(false));
+		process.setActions(actions);
+		process.start();	
+	}
+	
+	public void init() {
+		lyr = getLayerParam("layer");
+		force = getBooleanParam("force");
+		double s = getDoubleParam("scale");
+		if(s > 0 && s < 1)
+			scale = s;
+	}
+
+	/**
+	 * M�todo donde se ejecutar� el Thread, aqu� se calcular�n las 
+	 * estad�sticas.
+	 * @throws ProcessException 
+	 */
+	public void process() throws ProcessInterruptedException, ProcessException {
+		insertLineLog(PluginServices.getText(this, "statistics_generation"));
+		if(lyr == null || lyr.getDataStore() == null)
+			return;
+		stats = lyr.getDataStore().getStatistics();
+		lyr.setReadingData(Thread.currentThread().getId() + "");
+		if (force)
+			stats.forceToRecalc();
+		try {
+			stats.calculate(scale);
+			SwingUtilities.invokeLater(new Runnable() {
+				public void run() {
+					if (externalActions != null)
+						externalActions.end(lyr);
+				}
+			});
+		} catch (FileNotOpenException e) {
+			throw new ProcessException("No se ha podido escribir en el fichero rmf", e);
+		} catch (RasterDriverException e) {
+			throw new ProcessException("Error leyendo bloques de datos para calcular estad�sticas", e);
+		} finally {
+			lyr.setReadingData(null);
+		}
+	}
+
+	public int getPercent() {
+		return (stats != null) ? stats.getPercent() : 0;
+	}
+
+	public String getTitle() {
+		return PluginServices.getText(this, "increase_statistics");
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/StatisticsProcess.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/UniqueProcessQueue.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/UniqueProcessQueue.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/UniqueProcessQueue.java	(revision 8183)
@@ -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.tools.app.basic.raster.process;
+
+import org.gvsig.raster.util.Queue;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Cola de procesos de ejecuci�n exclusiva. Los procesos de esta lista se ir�n ejecutando
+ * por orden de llegada impidiendo que se ejecuten dos al mismo tiempo.
+ * 
+ * 16/05/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class UniqueProcessQueue implements IProcessActions {
+	private static final int          LAPSE_TIME       = 1000;
+
+	private Queue                     queue            = new Queue();
+	private RasterProcess             executionProcess = null;
+	static private UniqueProcessQueue singleton        = new UniqueProcessQueue();
+
+	/**
+	 * Dejamos el constructor privado para que nadie pueda referenciarlo
+	 */
+	private UniqueProcessQueue() {}
+	
+	/**
+	 * Devuelve una instancia al unico objeto de UniqueProcessQueue que puede existir.
+	 * @return
+	 */
+	static public UniqueProcessQueue getSingleton() {
+		return singleton;
+	}
+	
+	/**
+	 * A�ade un proceso a la cola.
+	 * @param id Identificador del proceso
+	 * @param process Proceso
+	 */
+	public synchronized void add(RasterProcess process) {
+		queue.put(process);
+		process.setUniqueProcessActions(this);
+		
+		//Decisi�n de arranque
+		if(queue.size() >= 1 && executionProcess != null)
+			start();
+	}
+	
+	/**
+	 * Pone en marcha el primer proceso de la lista
+	 */
+	public void start() {
+		nextProcess();
+	}
+	
+	private void nextProcess() {
+		executionProcess = ((RasterProcess) queue.get());
+		if (executionProcess != null)
+			executionProcess.start();
+	}
+
+	/**
+	 * Evento de finalizaci�n de un proceso. Cuando un proceso acaba se 
+	 * pone en marcha el siguiente de la lista si existe. Se asigna un tiempo de latencia para
+	 * la ejecuci�n del siguiente marcado por LAPSE_TIME.  
+	 */
+	public void end(Object param) {
+		try {
+			Thread.sleep(LAPSE_TIME);
+		} catch (InterruptedException e) {
+			LoggerFactory.getLogger(UniqueProcessQueue.class).debug("sleep Exception", e);
+		}
+		nextProcess();
+	}
+	
+	/**
+	 * How many elements are there in this queue?
+	 */
+	public int size() {
+		return queue.size();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.IProcessActions#interrupted()
+	 */
+	public void interrupted() {}	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/UniqueProcessQueue.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/HistogramProcess.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/HistogramProcess.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/HistogramProcess.java	(revision 8183)
@@ -0,0 +1,114 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.app.basic.raster.process;
+
+import javax.swing.SwingUtilities;
+
+import org.gvsig.andami.PluginServices;
+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.store.props.HistogramComputer;
+
+/**
+* Process to calculate a Histogram using a Histogramable object. A Histogramable object
+* has its own method to build an histogram an this process will call to this function. 
+* 
+* @author Nacho Brodin (nachobrodin@gmail.com)
+*/
+public class HistogramProcess extends RasterProcess {
+	private BufferHistogram        lastHistogram  = null;
+	private HistogramComputer      histogramable  = null;
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.RasterProcess#init()
+	 */
+	public void init() {
+		histogramable = (HistogramComputer) getParam("histogramable");
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.RasterProcess#process()
+	 */
+	public void process() throws ProcessInterruptedException, ProcessException {
+		try {
+			// Proceso duro de obtener un histograma. Puede durar bastante tiempo.
+			lastHistogram = histogramable.getBufferHistogram();
+			// Ya tenemos el histograma y lo representamos en la ventana
+			SwingUtilities.invokeLater(new Runnable() {
+				public void run() {
+					if ((externalActions != null) && (lastHistogram != null))
+						externalActions.end(lastHistogram);
+				}
+			});
+			
+		} catch (HistogramException e) {
+			throw new ProcessException("Error calculando el histograma", e);
+		} 
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.RasterProcess#getResult()
+	 */
+	public Object getResult() {
+		return lastHistogram;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.RasterProcess#getLog()
+	 */
+	public String getLog() {
+		return PluginServices.getText(this, "calculando_histograma") + "...\n";
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#getPercent()
+	 */
+	public int getPercent() {
+		if (histogramable != null)
+			return histogramable.getPercent();
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#getTitle()
+	 */
+	public String getTitle() {
+		return PluginServices.getText(this, "calculando_histograma");
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see java.lang.Object#finalize()
+	 */
+	protected void finalize() throws Throwable {
+		lastHistogram           = null;
+		histogramable           = null;
+		super.finalize();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/HistogramProcess.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/ProcessException.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/ProcessException.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/ProcessException.java	(revision 8183)
@@ -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.tools.app.basic.raster.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.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/ProcessException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/RasterProcess.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/RasterProcess.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/RasterProcess.java	(revision 8183)
@@ -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.tools.app.basic.raster.process;
+
+import java.util.Hashtable;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+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.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.incrementabletask.IIncrementable;
+import org.gvsig.gui.beans.incrementabletask.IncrementableEvent;
+import org.gvsig.gui.beans.incrementabletask.IncrementableListener;
+import org.gvsig.gui.beans.incrementabletask.IncrementableTask;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+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
+ * @deprecated Use DataProcess in org.gvsig.raster.algorithm
+ */
+public abstract class RasterProcess 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;
+	private Logger              logger            = LoggerFactory.getLogger(RasterProcess.class.toString());
+
+	
+	/**
+	 * Crea la ventana de IncrementableTask
+	 */
+	public IncrementableTask getIncrementableTask() {
+		if (incrementableTask == null) {
+			incrementableTask = new IncrementableTask(this);
+			incrementableTask.addIncrementableListener(this);
+		}
+		return incrementableTask;
+	}
+	
+	/**
+	 * Define si se puede cancelar el proceso. Por defecto es true.
+	 * @param enabled
+	 */
+	public void setCancelable(boolean enabled) {
+		getIncrementableTask().getButtonsPanel().setEnabled(ButtonsPanel.BUTTON_CANCEL, enabled);
+	}
+	
+	/**
+	 * Muestra la ventana de IncrementableTask
+	 */
+	public void showIncrementableWindow() {
+		if (progressActive) {
+			getIncrementableTask().showWindow();
+			getIncrementableTask().start();
+		}
+	}
+
+	/**
+	 * Arranca el proceso de recorte de un layer
+	 */
+	public void start() {
+		showIncrementableWindow();
+		if(blinker == null)
+			blinker = new Thread(this);
+		blinker.start();
+	}
+		
+	/**
+	 * Proceso de carga de par�metros. Puede no hacerse una carga de par�metros 
+	 * explicita y obtenerlos directamente de la tabla Hash cuando vayan a usarse. 
+	 * Esto queda a elecci�n del programador. En caso de hacerse una carga de par�metros
+	 * explicita esta llamada deber�a hacerse justo despues del constructor de la clase
+	 * que contendr� el proceso.
+	 */
+	public abstract void init();
+	
+	/**
+	 * Proceso
+	 * @throws InterruptedException
+	 */
+	public abstract void process() throws ProcessInterruptedException, ProcessException;
+	
+	/**
+	 * Obtenci�n de un objeto de resultado. Este objeto deber� ser el mismo que el que se
+	 * pasa por par�metro en el "end" de IProcessActions. Este m�todo es util cuando la tarea no se
+	 * lanza en un Thread (ejecutamos process directamente) y queremos recoger el resultado
+	 * sin registrarnos al evento de finalizaci�n de tarea.
+	 * @return objeto resultado de la tarea
+	 */
+	public Object getResult() {
+		return null;
+	}
+	
+	/**
+	 * Proceso
+	 * @throws ProcessException 
+	 */
+	public void execute() throws ProcessInterruptedException, ProcessException {
+		init();
+		process();
+	}
+	
+	/**
+	 * M�todo donde se ejecutar� el Thread. Este har� las acciones globales para 
+	 * cualquier tarea y llamar� al m�todo execute especifico de una tarea.
+	 */
+	public void run() {
+		long t1 = new java.util.Date().getTime();
+
+		try {
+			taskEventManager = RasterLocator.getManager().createRasterTask(this);
+			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)
+				RasterSwingLibrary.messageBoxError(e.getMessage(), this);
+			else
+				RasterSwingLibrary.messageBoxError("error_processing", this);
+			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)
+				RasterSwingLibrary.messageBoxError(e.getMessage(), this);
+			else
+				RasterSwingLibrary.messageBoxError("error_processing", this);
+			queueActions = null;
+		} finally {
+			taskEventManager.removeTask();
+			if (progressActive) {
+				if (incrementableTask != null)
+					getIncrementableTask().processFinalize();
+			}
+			if (queueActions != null)
+				queueActions.end(this);
+			time = new java.util.Date().getTime() - t1;
+			blinker = null;
+		}
+	}
+	
+	/**
+	 * Activa o desactiva el interfaz de progreso en el lanzamiento de la tarea como un thread.
+	 * @param active true para activarlo o false para desactivarlo
+	 */
+	public void setProgressActive(boolean active){
+		this.progressActive = active;
+	}
+	
+	/**
+	 * Obtiene el tiempo que tard� en ejecutarse la tarea 
+	 * la �ltima vez que se proces�
+	 */
+	public long getTime() {
+		return time;
+	}
+	
+	/**
+	 * Obtiene el objeto para ejecutar acciones externar.
+	 * @param IProcessActions
+	 */
+	public IProcessActions getActions() {
+		return externalActions;
+	}
+
+	/**
+	 * Asigna el objeto para ejecutar acciones externar.
+	 * @param IProcessActions
+	 */
+	public void setActions(IProcessActions actions) {
+		this.externalActions = actions;
+	}
+	
+	/**
+	 * Obtiene el objeto para ejecutar acciones de la cola de procesos de ejecuci�n exclusiva.
+	 * @param IProcessActions
+	 */
+	public IProcessActions getUniqueProcessActions() {
+		return queueActions;
+	}
+
+	/**
+	 * Asigna el objeto para ejecutar acciones externar.
+	 * @param IProcessActions
+	 */
+	public void setUniqueProcessActions(IProcessActions actions) {
+		this.queueActions = actions;
+	}
+	
+	/**
+	 * Inserta una nueva l�nea en el log del cuadro de incremento de tarea
+	 * @param line
+	 */
+	protected void insertLineLog(String line) {
+		lastLine = line;
+		log = log + line + "\n";
+	}
+	
+	/**
+	 * Obtiene la �ltima l�nea introducida en el log del cuadro de incremento.
+	 */
+	public String getLabel() {
+		return lastLine;
+	}
+	
+	/**
+	 * Obtiene el texto de log del cuadro de incremento completo.
+	 */
+	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));
+	}
+	
+	/**
+	 * A�ade un par�metro a la tarea
+	 * @param name Clave del par�metro
+	 * @param param Objeto pasado como par�metro
+	 */
+	public void addParam(String name, Object param) {
+		if (param != null)
+			taskParams.put(name, param);
+		else
+			taskParams.remove(name);
+	}
+
+	/**
+	 * Elimina un par�metro de la tarea
+	 * @param name Clave del par�metro a eliminar
+	 */
+	public void removeParam(String name) {
+		taskParams.remove(name);
+	}
+
+	/**
+	 * Obtiene un par�metro a partir de la clave
+	 * @param name Par�metro
+	 * @return Par�metro
+	 */
+	public Object getParam(String name) {
+		return taskParams.get(name);
+	}
+	
+	/**
+	 * Obtiene un par�metro String a partir de la clave
+	 * @param name Par�metro
+	 * @return Par�metro
+	 */
+	public String getStringParam(String name) {
+		Object value = taskParams.get(name);
+		return (value != null && value instanceof String) ? (String)value : null;
+	}
+	
+	/**
+	 * Obtiene un par�metro byte a partir de la clave
+	 * @param name Par�metro
+	 * @return Par�metro
+	 */
+	public byte getByteParam(String name) {
+		Object value = taskParams.get(name);
+		return (value != null && value instanceof Byte) ? ((Byte)value).byteValue() : 0;
+	}
+	
+	/**
+	 * Obtiene un par�metro float a partir de la clave
+	 * @param name Par�metro
+	 * @return Par�metro
+	 */
+	public float getFloatParam(String name) {
+		Object value = taskParams.get(name);
+		return (value != null && value instanceof Float) ? ((Float)value).floatValue() : 0F;
+	}
+	
+	/**
+	 * Obtiene un par�metro double a partir de la clave
+	 * @param name Par�metro
+	 * @return Par�metro
+	 */
+	public double getDoubleParam(String name) {
+		Object value = taskParams.get(name);
+		return (value != null && value instanceof Double) ? ((Double)value).doubleValue() : 0D;
+	}
+	
+	/**
+	 * Obtiene un par�metro entero a partir de la clave
+	 * @param name Par�metro
+	 * @return Par�metro
+	 */
+	public int getIntParam(String name) {
+		Object value = taskParams.get(name);
+		return (value != null && value instanceof Integer) ? ((Integer)value).intValue() : 0;
+	}
+	
+	/**
+	 * Obtiene un par�metro boolean a partir de la clave
+	 * @param name Par�metro
+	 * @return Par�metro
+	 */
+	public boolean getBooleanParam(String name) {
+		Object value = taskParams.get(name);
+		return (value != null && value instanceof Boolean) ? ((Boolean)value).booleanValue() : false;
+	}
+	
+	/**
+	 * Obtiene un par�metro int[] a partir de la clave
+	 * @param name Par�metro
+	 * @return Par�metro
+	 */
+	public int[] getIntArrayParam(String name) {
+		Object value = taskParams.get(name);
+		return (value != null && value instanceof int[]) ? ((int[])value) : null;
+	}
+	
+	/**
+	 * Obtiene un par�metro double[] a partir de la clave
+	 * @param name Par�metro
+	 * @return Par�metro
+	 */
+	public double[] getDoubleArrayParam(String name) {
+		Object value = taskParams.get(name);
+		return (value != null && value instanceof double[]) ? ((double[])value) : null;
+	}
+	
+	/**
+	 * Obtiene un par�metro capa raster a partir de la clave
+	 * @param name Par�metro
+	 * @return Par�metro
+	 */
+	public FLyrRaster getLayerParam(String name) {
+		Object value = taskParams.get(name);
+		return (value != null && value instanceof FLyrRaster) ? ((FLyrRaster)value) : null;
+	}
+	
+	/**
+	 * Obtiene un par�metro extent a partir de la clave
+	 * @param name Par�metro
+	 * @return Par�metro
+	 */
+	public Extent getExtentParam(String name) {
+		Object value = taskParams.get(name);
+		return (value != null && value instanceof Extent) ? ((Extent)value) : null;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IncrementableListener#actionResumed(org.gvsig.gui.beans.incrementabletask.IncrementableEvent)
+	 */
+	public void actionResumed(IncrementableEvent e) {	
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IncrementableListener#actionSuspended(org.gvsig.gui.beans.incrementabletask.IncrementableEvent)
+	 */
+	public void actionSuspended(IncrementableEvent e) {
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#isCancelable()
+	 */
+	public boolean isCancelable() {
+		return true;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#isPausable()
+	 */
+	public boolean isPausable() {
+		return false;
+	}
+	
+	public void dispose() {
+		try {
+			finalize();
+		} catch (Throwable e) {
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see java.lang.Object#finalize()
+	 */
+	@Override
+	protected void finalize() throws Throwable {
+		incrementableTask           = null;
+		blinker                     = null;
+		externalActions             = null;
+		if(taskParams != null) {
+			taskParams.clear();
+			taskParams = null;
+		}
+		log                         = null;
+		lastLine                    = null;
+		queueActions                = null;
+		logger                      = null;
+		super.finalize();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/RasterProcess.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/ClippingProcess.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/ClippingProcess.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/ClippingProcess.java	(revision 8183)
@@ -0,0 +1,626 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.raster.process;
+
+import java.awt.Rectangle;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.app.project.ProjectManager;
+import org.gvsig.app.project.documents.Document;
+import org.gvsig.app.project.documents.view.BaseViewDocument;
+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.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.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+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.ROIException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.process.BaseIncrementableTask;
+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.parameter.NewRasterStoreParameters;
+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.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.ProviderNotRegisteredException;
+import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.algorithm.process.DataProcess;
+import org.gvsig.raster.fmap.layers.DefaultFLyrRaster;
+import org.gvsig.raster.mainplugin.RasterMainPluginUtils;
+import org.gvsig.raster.roi.ROI;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.util.RasterNotLoadException;
+import org.slf4j.LoggerFactory;
+/**
+ * <code>ClippingProcess</code> es un proceso que usa un <code>Thread</code>
+ * para aplicar un recorte a una capa y guardarlo en disco. Muestra una barra
+ * de incremento informativa.
+ *
+ * @author BorSanZa - Borja S�nchez Zamorano
+ */
+public class ClippingProcess extends DataProcess {
+	public static final String            PROCESS_LABEL       = "ClippingProcess";
+	public static String                  FILENAME            = "filename";
+	public static String                  SUFFIX              = "suffix";
+	public static String                  VIEWNAME            = "viewname";
+	public static String                  PX_COORDS           = "pixelcoordinates";
+	public static String                  WORLD_COORDS        = "realcoordinates";
+	public static String                  RASTER_STORE        = "layer";
+	public static String                  DRAWABLE_BANDS      = "drawablebands";
+	public static String                  ONE_LYE_PER_BAND    = "onelayerperband";
+	public static String                  INTERP_METHOD       = "interpolationmethod";
+	public static String                  AT                  = "affinetransform";
+	public static String                  COLOR_INTERPR       = "colorInterpretation";
+	public static String                  SELECTED_ROIS       = "selectedrois";
+	public static String                  RESOLUTION          = "resolution";
+	public static String                  DRIVER_PARAMS       = "driverparams";
+	public static String                  VIEW_PROJ           = "viewProjection";
+	
+	private String                        fileName            = "";
+	private String                        suffix              = ".tif";
+	private RasterDataStore               dataStore           = null;
+	private boolean                       oneLayerPerBand     = false;
+	private int[]                         drawableBands       = { 0, 1, 2 };
+	private double[]                      pValues             = null;
+	private int                           interpolationMethod = Buffer.INTERPOLATION_Undefined;
+	private String                        viewName            = "";
+	private Params                        params              = null;
+	private ColorInterpretation           colorInterp         = null;
+	private ArrayList<ROI>                selectedRois        = null;
+	private AffineTransform               affineTransform     = null;
+	private double[]                      wcValues            = null;
+	private RasterManager                 rManager            = RasterLocator.getManager();
+	private BaseIncrementableTask         processIncrement    = null; 
+	
+	/**
+	 * Variables de la resoluci�n de salida
+	 */
+	private int                           resolutionWidth     = 0;
+	private int                           resolutionHeight    = 0;
+	
+	private Buffer                        buffer              = null;
+	private IProjection                   viewProjection      = null;
+	
+	public static void registerParameters() {
+		registerInputParameter(FILENAME, String.class, PROCESS_LABEL);
+		registerInputParameter(SUFFIX, String.class, PROCESS_LABEL);
+		registerInputParameter(VIEWNAME, String.class, PROCESS_LABEL);
+		registerInputParameter(PX_COORDS, Double.class, PROCESS_LABEL);
+		registerInputParameter(WORLD_COORDS, Double.class, PROCESS_LABEL);
+		registerInputParameter(RASTER_STORE, RasterDataStore.class, PROCESS_LABEL);
+		registerInputParameter(DRAWABLE_BANDS, Integer[].class, PROCESS_LABEL);
+		registerInputParameter(ONE_LYE_PER_BAND, Boolean.class, PROCESS_LABEL);
+		registerInputParameter(INTERP_METHOD, Integer.class, PROCESS_LABEL);
+		registerInputParameter(AT, AffineTransform.class, PROCESS_LABEL);
+		registerInputParameter(COLOR_INTERPR, ColorInterpretation.class, PROCESS_LABEL);
+		registerInputParameter(SELECTED_ROIS, ArrayList.class, PROCESS_LABEL);
+		registerInputParameter(RESOLUTION, Integer[].class, PROCESS_LABEL);
+		registerInputParameter(DRIVER_PARAMS, Params.class, PROCESS_LABEL);
+		registerInputParameter(VIEW_PROJ, IProjection.class, PROCESS_LABEL);
+		
+		//TODO: Falta definir salidas y asignarlas en el Map
+		registerOutputParameter(FILENAME, String.class, PROCESS_LABEL);
+	}
+	
+	/**
+	 * Par�metros obligatorios al proceso:
+	 * <UL>
+	 * <LI>filename: Nombre del fichero de salida</LI>
+	 * <LI>datawriter: Escritor de datos</LI>
+	 * <LI>viewname: Nombre de la vista sobre la que se carga la capa al acabar el proceso</LI>
+	 * <LI>pixelcoordinates: Coordenadas pixel del recorte (ulx, uly, lrx, lry)</LI>
+	 * <LI>layer: Capa de entrada para el recorte</LI>
+	 * <LI>drawablebands: Bandas de entrada</LI>
+	 * <LI>onelayerperband: booleano que informa de si escribimos una banda por fichero de salida o todas en un fichero</LI>
+	 * <LI>interpolationmethod: M�todo de interpolaci�n.</LI>
+	 * <LI>affinetransform: Transformaci�n que informa al dataset de salida de su referencia geografica</LI>
+	 * <LI>resolution: Ancho y alto de la capa de salida</LI>
+	 * </UL> 
+	 */
+	@SuppressWarnings("unchecked")
+	public void init() {
+		fileName = getStringParam("filename");
+		suffix = getStringParam("suffix");
+		viewName = getStringParam("viewname");
+		pValues = getDoubleArrayParam("pixelcoordinates");
+		wcValues = getDoubleArrayParam("realcoordinates");
+		dataStore = getParam("layer") != null ? (RasterDataStore)getParam("layer") : null;
+		drawableBands = getIntArrayParam("drawablebands");
+		oneLayerPerBand = getBooleanParam("onelayerperband");
+		interpolationMethod = getIntParam("interpolationmethod");
+		affineTransform = (AffineTransform)getParam("affinetransform");
+		colorInterp = (ColorInterpretation)getParam("colorInterpretation");
+		selectedRois = (ArrayList<ROI>)getParam("selectedrois");
+		if(getIntArrayParam("resolution") != null) {
+			resolutionWidth = getIntArrayParam("resolution")[0];
+			resolutionHeight = getIntArrayParam("resolution")[1];
+		}
+		params = (Params) getParam("driverparams");
+		viewProjection = getParam("viewProjection") != null ? (IProjection)getParam("viewProjection") : null;
+	}
+
+	/**
+	 * Salva la tabla de color al fichero rmf.
+	 * @param fName
+	 * @throws IOException
+	 */
+	private void saveToRmf(String fileName) {
+		int limitNumberOfRequests = 20;
+		while (dataStore == null && limitNumberOfRequests > 0) {
+			try {
+			} catch (IndexOutOfBoundsException e) {
+				//En ocasiones, sobre todo con servicios remotos al pedir un datasource da una excepci�n de este tipo
+				//se supone que es porque hay un refresco en el mismo momento de la petici�n por lo que como es m�s lento de
+				//gestionar pilla a la capa sin datasources asociados ya que est� reasignandolo. Si volvemos a pedirlo debe
+				//haberlo cargado ya.
+				try {
+					Thread.sleep(200);
+				} catch (InterruptedException e1) {
+				}
+			}
+			limitNumberOfRequests--;
+		}
+		
+		if (dataStore == null) {
+			//RasterToolsUtil.messageBoxError("error_load_layer", this, new Exception("Error writing RMF. limitNumberOfRequests=" + limitNumberOfRequests));
+			return;
+		}
+
+		// Guardamos en el RMF el valor NoData
+		if(dataStore.getNoDataValue() != null) {
+			NoData nodata = (NoData)dataStore.getNoDataValue();
+			nodata.setFileName(fileName);
+			nodata.save();
+		}
+
+		// Guardamos en el RMF la tabla de color
+		ColorTable colorTable = dataStore.getColorTable();
+		try {
+			rManager.getProviderServices().saveObjectToRmfFile(fileName, ColorTable.class, colorTable);
+		} catch (RmfSerializerException e) {
+			RasterSwingLibrary.messageBoxError("error_salvando_rmf", this, e);
+		}
+	}
+
+	/**
+	 * Tarea de recorte
+	 */
+	@SuppressWarnings("deprecation")
+	public void process() throws ProcessInterruptedException {
+		RasterDataStore dstoreCopy = null;
+		RasterUtils util = RasterLocator.getManager().getRasterUtils();
+		
+		try {
+			long t2;
+			long t1 = new java.util.Date().getTime();
+
+			try {
+				Thread.sleep(1000);
+			} catch (InterruptedException e1) {
+				e1.printStackTrace();
+			}
+			
+			insertLineLog(Messages.getText("leyendo_raster"));
+			
+			dstoreCopy = dataStore.newNotTiledDataStore();
+			RasterQuery query = rManager.createQuery();
+			query.setDrawableBands(drawableBands);
+
+			if(dstoreCopy.getParameters() instanceof RemoteStoreParameters &&
+				!((RemoteStoreParameters)dstoreCopy.getParameters()).isSizeFixed()) {
+				insertLineLog(Messages.getText("downloading_image"));
+				((RemoteStoreParameters)dstoreCopy.getParameters()).setWidth(resolutionWidth);
+				((RemoteStoreParameters)dstoreCopy.getParameters()).setHeight(resolutionHeight);
+				Extent bbox = RasterLocator.getManager().getDataStructFactory().createExtent(wcValues[0], wcValues[1], wcValues[2], wcValues[3]);
+				query.setAreaOfInterest(bbox, resolutionWidth, resolutionHeight);
+				try {
+					buffer = dstoreCopy.query(query);
+				} catch (QueryException e) {
+					RasterSwingLibrary.messageBoxError("No se ha podido asignar la vista al inicial el proceso de recorte.", this, e);
+				}
+			} else {
+				if(interpolationMethod != Buffer.INTERPOLATION_Undefined) {
+					try {
+						if(pValues != null) {
+							if (util.isBufferTooBig(new double[] { pValues[0], pValues[3], pValues[2], pValues[1] }, drawableBands.length))
+								query.setReadOnly(true);
+							Rectangle r = new Rectangle((int)pValues[0], (int)pValues[1], (int)Math.abs(pValues[2] - pValues[0]) + 1, (int)Math.abs(pValues[3] - pValues[1]) + 1);
+							query.setAreaOfInterest(r);
+						} else if(wcValues != null) {
+							query.setReadOnly(true);
+							Extent e = RasterLocator.getManager().getDataStructFactory().createExtent(
+									wcValues[0], wcValues[1], wcValues[2], wcValues[3]);
+							query.setAreaOfInterest(e);
+							//query.setAreaOfInterest(wcValues[0], wcValues[1], Math.abs(wcValues[0] - wcValues[2]), Math.abs(wcValues[1] - wcValues[3]));
+						}
+						buffer = dstoreCopy.query(query);
+					} catch (QueryException e) {
+						RasterSwingLibrary.messageBoxError("No se ha podido asignar la vista al inicial el proceso de recorte.", this, e);
+					}
+
+					insertLineLog(Messages.getText("interpolando"));
+					
+					Buffer bufTmp = buffer;
+					processIncrement = bufTmp.getIncrementableTask(Buffer.INCREMENTABLE_INTERPOLATION);
+					buffer = bufTmp.getAdjustedWindow(resolutionWidth, resolutionHeight, interpolationMethod);
+					if(bufTmp != buffer)
+						bufTmp.dispose();
+				} else {
+					try {
+						if (util.isBufferTooBig(new double[] { 0, 0, resolutionWidth, resolutionHeight }, drawableBands.length))
+							query.setReadOnly(true);
+						if(pValues != null) {
+							Rectangle r = new Rectangle(
+									(int)pValues[0], 
+									(int)pValues[3], 
+									(int)Math.abs(pValues[2] - pValues[0]) + 1, 
+									(int)Math.abs(pValues[1] - pValues[3]) + 1);
+							query.setAreaOfInterest(r, resolutionWidth, resolutionHeight);
+						}
+						else if(wcValues != null) {
+							Extent bbox = RasterLocator.getManager().getDataStructFactory().createExtent(wcValues[0], wcValues[1], wcValues[2], wcValues[3]);
+							query.setAreaOfInterest(bbox, resolutionWidth, resolutionHeight);
+						}
+						buffer = dstoreCopy.query(query);
+					} catch (QueryException e) {
+						RasterSwingLibrary.messageBoxError("No se ha podido asignar la vista al inicial el proceso de recorte.", this, e);
+					}
+				}
+			}
+			
+			//TODO: FUNCIONALIDAD: Poner los getWriter con la proyecci�n del fichero fuente
+
+			if ((selectedRois != null) && (!query.isReadOnly())){
+				if (selectedRois.size() > 0){
+					int despX = 0;
+					int despY = 0;
+					if (pValues != null){
+						despX = (int)pValues[0];
+						despY = (int)pValues[1];
+					} else if (wcValues != null){
+						despX = (int)dstoreCopy.worldToRaster(new Point2D.Double(wcValues[0], wcValues[1])).getX();
+						despY = (int)dstoreCopy.worldToRaster(new Point2D.Double(wcValues[0], wcValues[1])).getY();
+					}
+					drawOnlyROIs(buffer, selectedRois, despX, despY);
+				}
+			}
+			
+			
+			insertLineLog(Messages.getText("salvando_imagen"));
+			
+			DataManager manager = DALLocator.getDataManager();
+			String provider = "Gdal Store";
+			DataServerExplorerParameters eparams = manager.createServerExplorerParameters("FilesystemExplorer");
+			
+			String finalFileName = "";
+			NewRasterStoreParameters sparams = null;
+			processIncrement = RasterLocator.getManager().createDataServerWriter();
+			if (oneLayerPerBand) {
+				long[] milis = new long[drawableBands.length];
+				String[] fileNames = new String[drawableBands.length];
+				for (int i = 0; i < drawableBands.length; i++) {
+					fileNames[i] = fileName + "_B" + drawableBands[i] + suffix;
+					
+					int index = fileNames[i].lastIndexOf(File.separator);
+					if(index < 0)
+						index = fileNames[i].length();
+					String path = fileNames[i].substring(0, index);
+					String file = fileNames[i].substring(index + 1, fileNames[i].length());
+					
+					eparams.setDynValue("initialpath", path);
+					DataServerExplorer serverExplorer = manager.openServerExplorer(eparams.getExplorerName(), eparams);
+
+					sparams = (NewRasterStoreParameters)serverExplorer.getAddParameters(provider);
+					sparams.setDataServer((DataServerWriter)processIncrement);
+					sparams.setDestination(path, file);
+					sparams.setBuffer(buffer);
+					sparams.setColorInterpretation(new String[]{ColorInterpretation.GRAY_BAND});
+					sparams.setWktProjection(dstoreCopy.getWktProjection());
+					sparams.setBand(i);
+					sparams.setAffineTransform(affineTransform);
+					sparams.setDriverParams(params);
+					
+					serverExplorer.add(provider, sparams, true);
+					
+					saveToRmf(fileNames[i]);
+					t2 = new java.util.Date().getTime();
+					milis[i] = (t2 - t1);
+					t1 = new java.util.Date().getTime();
+				}
+				if (incrementableTask != null) {
+					incrementableTask.processFinalize();
+					incrementableTask = null;
+				}
+				if(viewName != null) {
+					if (RasterSwingLibrary.messageBoxYesOrNot("cargar_toc", this)) {
+						try {
+							for (int i = 0; i < drawableBands.length; i++) {
+								FLayer lyr = RasterMainPluginUtils.loadLayer(viewName, fileNames[i], null);
+								if(lyr != null && lyr instanceof DefaultFLyrRaster) {
+									if(dataStore.getProjection() != null)
+										((DefaultFLyrRaster)lyr).setRois(dataStore.getRois(dataStore.getProjection()));
+									else
+										((DefaultFLyrRaster)lyr).setRois(dataStore.getRois(viewProjection));
+								}
+							}
+						} catch (RasterNotLoadException e) {
+							RasterSwingLibrary.messageBoxError("error_load_layer", this, e);
+						}
+					}
+				}
+				for (int i = 0; i < drawableBands.length; i++) {
+					if (externalActions != null)
+						externalActions.end(new Object[] { fileName + "_B" + drawableBands[i] + suffix, new Long(milis[i]) });
+				}
+			} else {
+				if (isUsingFile(fileName)) {
+					incrementableTask.hideWindow();
+					RasterSwingLibrary.messageBoxError("error_opened_file", this);
+					return;
+				}
+				File f = new File(fileName);
+				if (f.exists()) {
+					f.delete();
+				}
+				f = null;
+				
+				if(suffix != null)
+					finalFileName = fileName.endsWith(suffix) ? fileName : fileName + suffix;
+				else
+					finalFileName = fileName;
+				
+				int index = finalFileName.lastIndexOf(File.separator);
+				if(index < 0)
+					index = finalFileName.length();
+				String path = finalFileName.substring(0, index);
+				String file = finalFileName.substring(index + 1, finalFileName.length());
+				
+				eparams.setDynValue("initialpath", path);
+				DataServerExplorer serverExplorer = manager.openServerExplorer(eparams.getExplorerName(), eparams);
+
+				try {
+					provider = rManager.createWriter(finalFileName).getProviderName();
+				} catch (NotSupportedExtensionException e1) {
+					RasterSwingLibrary.messageBoxError("no_driver_escritura", this, e1);
+				} catch (RasterDriverException e1) {
+					RasterSwingLibrary.messageBoxError("no_driver_escritura", this, e1);
+				}
+				
+				sparams = (NewRasterStoreParameters)serverExplorer.getAddParameters(provider);
+				sparams.setDataServer((DataServerWriter)processIncrement);
+				sparams.setDestination(path, file);
+				sparams.setBuffer(buffer);
+				if(colorInterp != null)
+					sparams.setColorInterpretation(colorInterp.getValues());
+				sparams.setWktProjection(dstoreCopy.getWktProjection());
+				sparams.setAffineTransform(affineTransform);
+				sparams.setDriverParams(params);
+				sparams.setBand(-1);
+				
+				serverExplorer.add(provider, sparams, true);
+				
+				saveToRmf(finalFileName);
+				
+				
+				t2 = new java.util.Date().getTime();
+				if (incrementableTask != null) {
+					incrementableTask.processFinalize();
+					incrementableTask = null;
+				}
+				//Damos tiempo a parar el Thread del incrementable para que no se cuelgue la ventana
+				//El tiempo es como m�nimo el de un bucle del run de la tarea incrementable
+				try {
+					Thread.sleep(600);
+				} catch (InterruptedException e) {
+					throw new ProcessInterruptedException(e);
+				}
+				cutFinalize(finalFileName, (t2 - t1));
+			}
+
+		} catch (RasterDriverException e) {
+			RasterSwingLibrary.messageBoxError("error_writer", this, e);
+		} catch (ValidateDataParametersException e) {
+			RasterSwingLibrary.messageBoxError("error_georasterwriter", this);
+		} catch (ProviderNotRegisteredException e) {
+			RasterSwingLibrary.messageBoxError("error_georasterwriter", this, e);
+		} catch (InitializeException e) {
+			RasterSwingLibrary.messageBoxError("error_georasterwriter", this, e);
+		} catch (DataException e) {
+			RasterSwingLibrary.messageBoxError("error_georasterwriter", this, e);
+		} catch (Exception e) {
+			e.printStackTrace();
+		} finally {
+			if (dstoreCopy != null)
+				try {
+					dstoreCopy.close();
+				} catch (CloseException e) {
+					LoggerFactory.getLogger(ClippingProcess.class).debug(Messages.getText("error_writer"), e);
+				}
+			buffer = null;
+		}
+	}
+	
+	
+	/**
+	 * Acciones para poner a NoData los pixels que est�n fuera de las
+	 * regiones de inter�s seleccionadas.
+	 * @param buffer
+	 */
+	private void drawOnlyROIs(Buffer buffer, List<ROI> rois, int despX, int despY){
+		for (int i = 0 ; i < buffer.getWidth() ; i++){
+			for (int j = 0 ; j < buffer.getHeight() ; j++){
+				boolean  inside = false;
+				for (int k = 0 ; k < rois.size() ; k++){
+					ROI roi = rois.get(k);
+					//TODO: Hacer la comprobacion por coordenadas del mundo en lugar de coordenadas pixel.
+					if (roi.isInsideOfPolygon(i + despX, j + despY)){
+						inside = true;
+					}
+				}
+				if (!inside){
+					for (int l = 0 ; l < buffer.getBandCount() ; l++){
+						if (buffer.getDataType() == Buffer.TYPE_BYTE){
+							buffer.setElem(j, i, l, 
+									buffer.getNoDataValue().isDefined() ? buffer.getNoDataValue().getValue().byteValue() : RasterLibrary.defaultByteNoDataValue);
+						} else if (buffer.getDataType() == Buffer.TYPE_SHORT){
+							buffer.setElem(j, i, l, 
+									buffer.getNoDataValue().isDefined() ? buffer.getNoDataValue().getValue().shortValue() : RasterLibrary.defaultShortNoDataValue);
+						} else if (buffer.getDataType() == Buffer.TYPE_INT){
+							buffer.setElem(j, i, l, 
+									buffer.getNoDataValue().isDefined() ? buffer.getNoDataValue().getValue().intValue() : RasterLibrary.defaultIntegerNoDataValue);
+						} else if (buffer.getDataType() == Buffer.TYPE_FLOAT){
+							buffer.setElem(j, i, l, 
+									buffer.getNoDataValue().isDefined() ? buffer.getNoDataValue().getValue().floatValue() : RasterLibrary.defaultFloatNoDataValue);
+						} else if (buffer.getDataType() == Buffer.TYPE_DOUBLE){
+							buffer.setElem(j, i, l, 
+									buffer.getNoDataValue().isDefined() ? buffer.getNoDataValue().getValue().doubleValue() : RasterLibrary.defaultDoubleNoDataValue);
+						}
+					}
+				}
+			}
+		}
+	}
+	
+	
+	/**
+	 * Returns true if there is a layer in the current project using the file named with
+	 * fileName.
+	 * @param fileName
+	 * @return
+	 */
+	private boolean isUsingFile(String fileName) {
+		List<Document> docs = ProjectManager.getInstance().getCurrentProject().getDocuments();
+		
+		for (int i = 0 ;i < docs.size() ;i++) {
+			if (docs.get(i) instanceof BaseViewDocument) {
+				FLayers lyrs = ((BaseViewDocument)docs.get(i)).getMapContext().getLayers();
+				for (int j = 0 ;j < lyrs.getLayersCount() ;j++) {
+					if (lyrs.getLayer(j) instanceof DefaultFLyrRaster) {
+						DefaultFLyrRaster lyr = (DefaultFLyrRaster)lyrs.getLayer(j);						
+						if (lyr.getDataStore() != null ){							
+							if (fileName.equals(lyr.getDataStore().getName())) {
+								return true;
+							}
+						}		
+					}
+				}
+			}
+		}
+		return false;
+	}
+	
+	
+	/**
+	 * Acciones que se realizan al finalizar de crear los recortes de imagen.
+	 * Este m�todo es llamado por el thread TailRasterProcess al finalizar.
+	 */
+	private void cutFinalize(String fileName, long milis) {
+		if (!new File(fileName).exists())
+			return;
+
+		if(viewName != null) {
+			if (RasterSwingLibrary.messageBoxYesOrNot("cargar_toc", null)) {
+
+				try {
+					FLayer lyr = RasterMainPluginUtils.loadLayer(viewName, fileName, null);
+					if(lyr != null && lyr instanceof DefaultFLyrRaster) {
+						if(dataStore.getProjection() != null)
+							((DefaultFLyrRaster)lyr).setRois(dataStore.getRois(dataStore.getProjection()));
+						else
+							((DefaultFLyrRaster)lyr).setRois(dataStore.getRois(viewProjection));
+					}
+				} catch (RasterNotLoadException e) {
+					RasterSwingLibrary.messageBoxError("error_load_layer", this, e);
+				} catch (ROIException e) {
+					RasterSwingLibrary.messageBoxError("error_load_layer", this, e);
+				}
+			}
+		}
+
+		if (externalActions != null)
+			externalActions.end(new Object[]{fileName, new Long(milis)});
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#getPercent()
+	 */
+	public int getPercent() {
+		return (processIncrement != null) ? processIncrement.getPercent() : 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#getTitle()
+	 */
+	public String getTitle() {
+		return Messages.getText("incremento_recorte");
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see java.lang.Object#finalize()
+	 */
+	protected void finalize() throws Throwable {
+		fileName            = null;
+		suffix              = null;
+		dataStore            = null;
+		drawableBands       = null;
+		pValues             = null;
+		viewName            = null;
+		params              = null;
+		colorInterp         = null;
+		affineTransform     = null;
+		wcValues            = null;
+		buffer              = null;
+		processIncrement    = null;
+		if(selectedRois != null) {
+			selectedRois.clear();
+			selectedRois = null;
+		}
+		super.finalize();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/ClippingProcess.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/FilterProcess.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/FilterProcess.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/FilterProcess.java	(revision 8183)
@@ -0,0 +1,332 @@
+package org.gvsig.raster.tools.app.basic.raster.process;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.SwingUtilities;
+
+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.NoData;
+import org.gvsig.fmap.dal.coverage.exception.FilterManagerException;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+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.filter.FilterLoader;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterListManager;
+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.coverage.store.props.Transparency;
+import org.gvsig.fmap.dal.exception.CloseException;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.roi.ROI;
+import org.gvsig.raster.tools.app.basic.raster.bean.previewbase.ParamStruct;
+
+/**
+ * Clase donde se hara todo el proceso de aplicar una lista de filtros a una
+ * capa. Muestra una ventana de dialogo de incremento informativa.
+ *
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public class FilterProcess extends RasterProcess {
+	private String                   filename         = "";
+	private RasterDataStore          rasterDataSource = null;
+	private ArrayList<ParamStruct>   listFilterUsed   = null;
+
+	private RasterFilterList         rasterFilterList = null;
+	private RasterWriter             geoRasterWriter  = null;
+	private FLyrRaster               lyr              = null;
+	private RasterManager            rManager         = RasterLocator.getManager();
+
+	public void init() {
+		filename = getStringParam("filename");
+		listFilterUsed = (ArrayList) getParam("listfilterused");
+		lyr = (FLyrRaster)getParam("layer");
+		rasterDataSource = lyr.getDataStore();
+	}
+
+	/**
+	 * Devuelve una interpretacion de color. Es usado cuando no conseguimos un
+	 * rendering y no podemos saber que interpretacion l�gica ten�a antes.
+	 * @param geoRasterWriter
+	 */
+	private ColorInterpretation getColorIntepretation(Buffer buffer, RasterFilterList filterList) {
+		ColorInterpretation colorInterpretation = null;
+
+		do {
+			// Si tiene una tabla de color asignamos las tres bandas
+			if (filterList.isActive("colortable")) {
+				colorInterpretation = rManager.getDataStructFactory().createColorInterpretation(
+						new String[] { 
+								ColorInterpretation.RED_BAND, 
+								ColorInterpretation.GREEN_BAND, 
+								ColorInterpretation.BLUE_BAND,
+								ColorInterpretation.ALPHA_BAND 
+								});
+				break;
+			}
+
+			// Si el numero de bandas coincide asignamos la misma interpretacion que tenia antes
+			if (buffer.getBandCount() == rasterDataSource.getBandCount()) {
+				colorInterpretation = rasterDataSource.getColorInterpretation();
+				break;
+			}
+
+			String[] colorInterp = new String[rasterDataSource.getColorInterpretation().getValues().length];
+
+			for (int i = 0; i < rasterDataSource.getColorInterpretation().getValues().length; i++) {
+				if (rasterDataSource.getColorInterpretation().getValues()[i].equals(ColorInterpretation.UNDEF_BAND)) {
+					colorInterp[i] = ColorInterpretation.GRAY_BAND;
+					continue;
+				}
+				colorInterp[i] = rasterDataSource.getColorInterpretation().getValues()[i];
+			}
+			colorInterpretation = rManager.getDataStructFactory().createColorInterpretation(colorInterp);
+		} while (false);
+
+		return colorInterpretation;
+	}
+	
+	public void process() throws ProcessInterruptedException, ProcessException {
+		DataServerWriter writerBufferServer = null;
+		if(lyr != null)
+			lyr.setReadingData(Thread.currentThread().getId() + "");
+
+		RasterDataStore dstoreCopy = null;
+		RasterQuery query          = null;
+		Buffer buffer              = null;
+		Buffer buff                = null;
+		Buffer alpha               = null;
+		try {
+			insertLineLog(Messages.getText("leyendo_raster"));
+			
+			//Creaci�n del BufferFactory
+			dstoreCopy = rasterDataSource.newNotTiledDataStore();
+			query = rManager.createQuery();
+			//if (!RasterBuffer.loadInMemory(dsetCopy))
+			query.setReadOnly(true);
+
+			//Asignaci�n de bandas
+			int[] renderBands = lyr.getRender().getRenderColorInterpretation().buildRenderBands();
+			if (renderBands != null) {
+				// Si es gris, se reduce a una sola banda
+				if ((renderBands.length == 3) && (renderBands[0] == renderBands[1]) && (renderBands[1] == renderBands[2])) 
+					renderBands = new int[] { renderBands[0] };
+				query.setDrawableBands(renderBands);
+			} else
+				query.setAllDrawableBands();
+
+			query.setAreaOfInterest();
+			
+			buff = dstoreCopy.query(query);
+			if(buff.isReadOnlyBuffer()) 
+				buff.addDrawableBands(renderBands);
+			
+			insertLineLog(Messages.getText("aplicando_filtros"));
+
+			Transparency processTransparency = dstoreCopy.getTransparency().cloneTransparency();
+			processTransparency.setColorInterpretation(lyr.getRender().getRenderColorInterpretation().cloneColorInterpretation());
+			
+			List<ROI> roi = null;
+			try {
+				IProjection proj = dstoreCopy.getProjection();
+				if(proj == null)
+					proj = lyr.getMapContext().getProjection();
+				roi = (List<ROI>)dstoreCopy.getRois(proj);
+			} catch (ROIException e) {
+			}
+			
+			rasterFilterList = rManager.createEmptyFilterList(dstoreCopy.getDataType()[0]);
+			FilterLoader filterLoader = RasterLocator.getManager().createFilterLoader(rasterFilterList);
+			filterLoader.addSrcBandCount(dstoreCopy.getBandCount());
+			filterLoader.addSrcDataType(dstoreCopy.getDataType()[0]);
+			filterLoader.addSrcStatistics(dstoreCopy.getStatistics());
+			filterLoader.addSrcROI(roi);
+			filterLoader.addTransparency(processTransparency);
+			filterLoader.addSrcHistogram(dstoreCopy.getHistogramComputer());
+			addSelectedFilters(rasterFilterList, listFilterUsed);
+			buffer = filterLoader.applyFilters(buff);
+			
+			insertLineLog(Messages.getText("guardando_capa"));
+
+			writerBufferServer = rManager.createDataServerWriter();
+			writerBufferServer.setBuffer(buffer, -1);
+			// TODO: FUNCIONALIDAD: Poner los getWriter con la proyecci�n del fichero fuente
+
+			ColorInterpretation colorInterpretation = getColorInterpretation(buffer.getBandCount(), buffer.getDataType());
+			
+			geoRasterWriter = rManager.createWriter(writerBufferServer, 
+					filename,
+					buffer.getBandCount(), 
+					rasterDataSource.getAffineTransform(), 
+					buffer.getWidth(), 
+					buffer.getHeight(), 
+					buffer.getDataType(), 
+					rManager.createWriter(filename).getParams(), 
+					null);
+			
+			if (lyr.getRender() == null)
+				colorInterpretation = getColorIntepretation(buffer, rasterFilterList);
+
+			geoRasterWriter.setColorBandsInterpretation(colorInterpretation.getValues());
+
+			geoRasterWriter.dataWrite();
+			geoRasterWriter.writeClose();
+			geoRasterWriter = null;
+			
+			// Guardamos en el RMF el valor NoData
+			//Si el del buffer tiene valor es porque alg�n filtro le ha salvado valor nodata por lo que se pone ese
+			//sino se pone el de la imagen original
+			NoData nodataOrigin = (NoData)rasterDataSource.getNoDataValue();
+			NoData nodataBuffer =  (NoData)buffer.getNoDataValue();
+			if(nodataBuffer != null && nodataBuffer.isDefined()) {
+				nodataBuffer.setFileName(filename);
+				nodataBuffer.save();
+			} else if(nodataOrigin != null && nodataOrigin.isDefined()) {
+				nodataOrigin.setFileName(filename);
+				nodataOrigin.save();
+			}
+			
+			SwingUtilities.invokeLater(new Runnable() {
+				public void run() {
+					if (externalActions != null)
+						externalActions.end(filename);
+				}
+			});
+		} catch (NotSupportedExtensionException e) {
+			throw new ProcessException("error_writer_notsupportedextension", e);
+		} catch (RasterDriverException e) {
+			throw new ProcessException("error_writer", e);
+		} catch (IOException e) {
+			throw new ProcessException("error_writer", e);
+		} catch (FilterTypeException e) {
+			throw new ProcessException("error_adding_filters", e);
+		} catch (QueryException e) {
+			throw new ProcessException("error_loading_data", e);
+		} catch (FilterManagerException e) {
+			throw new ProcessException("error_adding_filters", e);
+		} finally {
+			if(writerBufferServer != null)
+				writerBufferServer.dispose();
+			if(buff != null)
+				buff.dispose();
+			if(rasterFilterList != null)
+				rasterFilterList.dispose();
+			if(alpha != null)
+				alpha.dispose();
+			if(dstoreCopy != null)
+				try {
+					dstoreCopy.close();
+				} catch (CloseException e) {
+				}
+			if(lyr != null)
+				lyr.setReadingData(null);
+			dispose();
+		}
+	}
+	
+	private ColorInterpretation getColorInterpretation(int nBands, int dataType) {
+		//Si la fuente es con paleta, al aplicarle un filtro se genera un ARGB
+		if(lyr.existColorTable()) 
+			return rManager.getDataStructFactory().createColorInterpretation(
+					new String[] { ColorInterpretation.RED_BAND, ColorInterpretation.GREEN_BAND, ColorInterpretation.BLUE_BAND, ColorInterpretation.ALPHA_BAND });
+
+		if(dataType == Buffer.TYPE_BYTE) {
+			if(nBands == 3)
+				return rManager.getDataStructFactory().createColorInterpretation(
+						new String[] { ColorInterpretation.RED_BAND, ColorInterpretation.GREEN_BAND, ColorInterpretation.BLUE_BAND });
+			if(nBands == 4)
+				return rManager.getDataStructFactory().createColorInterpretation(
+						new String[] { ColorInterpretation.RED_BAND, ColorInterpretation.GREEN_BAND, ColorInterpretation.BLUE_BAND, ColorInterpretation.ALPHA_BAND });
+			if(nBands == 2 || nBands > 4) {
+				return lyr.getRender().getRenderColorInterpretation();
+				/*int[] renderBands = lyr.getRender().getRenderBands();
+				String[] ci = new String[renderBands.length];
+				for (int i = 0; i < renderBands.length; i++) {
+					switch (renderBands[i]) {
+					case 0:ci[i] = ColorInterpretation.RED_BAND; break;
+					case 1:ci[i] = ColorInterpretation.GREEN_BAND; break;
+					case 2:ci[i] = ColorInterpretation.BLUE_BAND; break;
+					default: ci[i] = ColorInterpretation.UNDEF_BAND; 
+					}
+				}
+				return rManager.getDataStructFactory().createColorInterpretation(ci);*/
+			}
+		}
+		if(nBands == 1)
+			return rManager.getDataStructFactory().createColorInterpretation(
+				new String[] { ColorInterpretation.GRAY_BAND });
+		else {
+			String[] ci = new String[nBands];
+			for (int i = 0; i < ci.length; i++) {
+				ci[i] = ColorInterpretation.UNDEF_BAND;
+			}
+			return rManager.getDataStructFactory().createColorInterpretation(ci);
+		}
+	}
+
+	/**
+	 * Sustituye la lista de filtros de filterList por la que le pasamos en forma
+	 * de ArrayList
+	 * @param filterList
+	 * @param listFilterUsed
+	 * @throws FilterTypeException 
+	 * @throws FilterTypeException 
+	 */
+	public void addSelectedFilters(RasterFilterList filterList, ArrayList<ParamStruct> listFilterUsed) throws FilterManagerException, FilterTypeException {
+		filterList.clear();
+		
+		for (int i = 0; i < listFilterUsed.size(); i++) {
+			ParamStruct aux = (ParamStruct) listFilterUsed.get(i);
+			RasterFilterListManager filterManager = filterList.getManagerByFilterClass(aux.getFilterClass());
+			filterManager.addFilter(aux.getFilterClass(), aux.getFilterParam());
+		}
+
+		filterList.resetPercent();
+	}
+
+	public int getPercent() {
+		if (rasterFilterList == null)
+			return 0;
+
+		if (rasterFilterList.getPercent() < 100)
+			return rasterFilterList.getPercent();
+
+		if (geoRasterWriter == null)
+			return 0;
+
+		return geoRasterWriter.getPercent();
+	}
+
+	public String getTitle() {
+		return Messages.getText("aplicando_filtros");
+	}
+	
+	public void dispose() {
+		rasterDataSource = null;
+		if(listFilterUsed != null) {
+			listFilterUsed.clear();
+			listFilterUsed = null;
+		}
+		rasterFilterList = null;
+		geoRasterWriter  = null;
+		lyr              = null;
+	}
+	
+	@Override
+	protected void finalize() throws Throwable {
+		dispose();
+		super.finalize();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/FilterProcess.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceCache.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceCache.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceCache.java	(revision 8183)
@@ -0,0 +1,274 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.raster.gui.preference.panel;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.text.NumberFormat;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JComboBox;
+import javax.swing.JFormattedTextField;
+import javax.swing.JLabel;
+import javax.swing.SwingConstants;
+import javax.swing.text.DefaultFormatterFactory;
+import javax.swing.text.NumberFormatter;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.raster.mainplugin.config.Configuration;
+import org.gvsig.raster.util.BasePanel;
+/**
+ * PreferenceCache es la clase que se encarga de configurar en RasterPreferences
+ * las opciones de cacheamiento de capas en Raster.
+ *
+ * @version 14/12/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class PreferenceCache extends BasePanel {
+	protected static final long serialVersionUID      = 1L;
+	private JLabel              labelWarning          = null;
+	private JLabel              labelBlockHeight      = null;
+	private JComboBox           comboBoxBlockHeight   = null;
+	private JLabel              labelCacheSize        = null;
+	private JFormattedTextField textFieldCacheSize    = null;
+	private JLabel              labelPagsPerGroup     = null;
+	private JFormattedTextField textFieldPagsPerGroup = null;
+	private JLabel              labelPageSize         = null;
+	private JFormattedTextField textFieldPageSize     = null;
+
+	/**
+	 *Inicializa componentes gr�ficos y traduce
+	 */
+	public PreferenceCache() {
+		init();
+		translate();
+	}
+
+	/**
+	 * Define todas las traducciones de PreferenceCache
+	 */
+	protected void translate() {
+		setBorder(BorderFactory.createTitledBorder(getText(this, "cache")));
+		getLabelWarning().setText(getText(this, "preference_cache_warning"));
+		getLabelCacheSize().setText(getText(this, "tamanyo") + ":");
+		getLabelPagsPerGroup().setText(getText(this, "paginas_grupo") + ":");
+		getLabelPageSize().setText(getText(this, "tamanyo_pagina") + ":");
+		getLabelBlockHeight().setText(getText(this, "bloques_procesos") + ":");
+	}
+
+	protected void init() {
+		GridBagConstraints gridBagConstraints;
+
+		setLayout(new GridBagLayout());
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridwidth = 2;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(5, 5, 2, 5);
+		add(getLabelWarning(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.anchor = GridBagConstraints.EAST;
+		gridBagConstraints.insets = new Insets(2, 5, 2, 2);
+		add(getLabelCacheSize(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 2;
+		gridBagConstraints.anchor = GridBagConstraints.EAST;
+		gridBagConstraints.insets = new Insets(2, 5, 2, 2);
+		add(getLabelPagsPerGroup(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 3;
+		gridBagConstraints.anchor = GridBagConstraints.EAST;
+		gridBagConstraints.insets = new Insets(2, 5, 2, 2);
+		add(getLabelPageSize(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 4;
+		gridBagConstraints.anchor = GridBagConstraints.EAST;
+		gridBagConstraints.insets = new Insets(2, 5, 5, 2);
+		add(getLabelBlockHeight(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(2, 2, 2, 5);
+		add(getTextFieldCacheSize(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = 4;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(2, 2, 5, 5);
+		add(getComboBoxBlockHeight(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = 3;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(2, 2, 2, 5);
+		add(getTextFieldPageSize(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = 2;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(2, 2, 2, 5);
+		add(getTextFieldPagsPerGroup(), gridBagConstraints);
+	}
+
+	private JLabel getLabelWarning() {
+		if (labelWarning == null) {
+			labelWarning = new JLabel();
+			labelWarning.setForeground(new Color(255, 0, 0));
+			labelWarning.setHorizontalAlignment(SwingConstants.CENTER);
+			labelWarning.setPreferredSize(new Dimension(0, 32));
+		}
+		return labelWarning;
+	}
+
+	private JFormattedTextField getTextFieldCacheSize() {
+		if (textFieldCacheSize == null) {
+			NumberFormat integerFormat = NumberFormat.getNumberInstance();
+			integerFormat.setParseIntegerOnly(true);
+			textFieldCacheSize = new JFormattedTextField(new DefaultFormatterFactory(
+					new NumberFormatter(integerFormat),
+					new NumberFormatter(integerFormat),
+					new NumberFormatter(integerFormat)));
+		}
+		return textFieldCacheSize;
+	}
+
+	private JFormattedTextField getTextFieldPagsPerGroup() {
+		if (textFieldPagsPerGroup == null) {
+			NumberFormat integerFormat = NumberFormat.getNumberInstance();
+			integerFormat.setParseIntegerOnly(true);
+			textFieldPagsPerGroup = new JFormattedTextField(new DefaultFormatterFactory(
+					new NumberFormatter(integerFormat),
+					new NumberFormatter(integerFormat),
+					new NumberFormatter(integerFormat)));
+		}
+		return textFieldPagsPerGroup;
+	}
+
+	private JFormattedTextField getTextFieldPageSize() {
+		if (textFieldPageSize == null) {
+			NumberFormat integerFormat = NumberFormat.getNumberInstance();
+			integerFormat.setParseIntegerOnly(true);
+			textFieldPageSize = new JFormattedTextField(new DefaultFormatterFactory(
+					new NumberFormatter(integerFormat),
+					new NumberFormatter(integerFormat),
+					new NumberFormatter(integerFormat)));
+		}
+		return textFieldPageSize;
+	}
+
+	private JLabel getLabelCacheSize() {
+		if (labelCacheSize == null)
+			labelCacheSize = new JLabel();
+		return labelCacheSize;
+	}
+
+	private JLabel getLabelPagsPerGroup() {
+		if (labelPagsPerGroup == null)
+			labelPagsPerGroup = new JLabel();
+		return labelPagsPerGroup;
+	}
+
+	private JLabel getLabelPageSize() {
+		if (labelPageSize == null)
+			labelPageSize = new JLabel();
+		return labelPageSize;
+	}
+
+	private JLabel getLabelBlockHeight() {
+		if (labelBlockHeight == null)
+			labelBlockHeight = new JLabel();
+		return labelBlockHeight;
+	}
+
+	private JComboBox getComboBoxBlockHeight() {
+		if (comboBoxBlockHeight == null) {
+			comboBoxBlockHeight = new JComboBox();
+			comboBoxBlockHeight.setModel(new DefaultComboBoxModel(new String[] { "128", "256", "512", "1024", "2048", "4096" }));
+		}
+		return comboBoxBlockHeight;
+	}
+
+	/**
+	 * Establece los valores por defecto de la Cache
+	 */
+	public void initializeDefaults() {
+		getTextFieldCacheSize().setValue(Configuration.getDefaultValue("cache_size"));
+		getTextFieldPageSize().setValue(Configuration.getDefaultValue("cache_pagesize"));
+		getTextFieldPagsPerGroup().setValue(Configuration.getDefaultValue("cache_pagspergroup"));
+
+		Integer blockHeight = (Integer) Configuration.getDefaultValue("cache_blockheight");
+		for (int i = 0; i < getComboBoxBlockHeight().getItemCount(); i++)
+			if (getComboBoxBlockHeight().getItemAt(i).toString().equals(blockHeight.toString())) {
+				getComboBoxBlockHeight().setSelectedIndex(i);
+				break;
+			}
+	}
+
+	/**
+	 * Establece los valores que ha definido el usuario de la Cache
+	 */
+	public void initializeValues() {
+		getTextFieldCacheSize().setValue(Configuration.getValue("cache_size", Long.valueOf(RasterLibrary.cacheSize)));
+		getTextFieldPageSize().setValue(Configuration.getValue("cache_pagesize", Double.valueOf(RasterLibrary.pageSize)));
+		getTextFieldPagsPerGroup().setValue(Configuration.getValue("cache_pagspergroup", Integer.valueOf(RasterLibrary.pagsPerGroup)));
+
+		Integer blockHeight = Configuration.getValue("cache_blockheight", Integer.valueOf(RasterLibrary.blockHeight));
+		for (int i = 0; i < getComboBoxBlockHeight().getItemCount(); i++)
+			if (getComboBoxBlockHeight().getItemAt(i).toString().equals(blockHeight.toString())) {
+				getComboBoxBlockHeight().setSelectedIndex(i);
+				break;
+			}
+	}
+
+	/**
+	 * Guarda los valores de la cache establecidos por el usuario
+	 */
+	public void storeValues() {
+		Configuration.setValue("cache_size", getTextFieldCacheSize().getText());
+		Configuration.setValue("cache_pagesize", getTextFieldPageSize().getText());
+		Configuration.setValue("cache_pagspergroup", getTextFieldPagsPerGroup().getText());
+		Configuration.setValue("cache_blockheight", getComboBoxBlockHeight().getSelectedItem().toString());
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceCache.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceTemporal.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceTemporal.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceTemporal.java	(revision 8183)
@@ -0,0 +1,163 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.raster.gui.preference.panel;
+
+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.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JTextField;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.gui.beans.swing.JFileChooser;
+import org.gvsig.raster.mainplugin.config.Configuration;
+import org.gvsig.raster.util.BasePanel;
+
+/**
+ * PreferenceTemporal es una clase para la configuracion de los directorios
+ * temporales de raster en gvSIG.
+ * 
+ * @version 12/12/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class PreferenceTemporal extends BasePanel implements ActionListener {
+	private static final long serialVersionUID   = 1L;
+	private JLabel            labelTemporales    = null;
+	private JButton           buttonOpen         = null;
+	private JTextField        textFieldDirectory = null;
+
+	/**
+	 *Inicializa componentes gr�ficos y traduce
+	 */
+	public PreferenceTemporal() {
+		init();
+		translate();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.util.BasePanel#translate()
+	 */
+	protected void translate() {
+		setBorder(BorderFactory.createTitledBorder(getText(this, "rutas")));
+		getLabelTemporales().setText(getText(this, "temporales") + ":");
+		getButtonOpen().setText(getText(this, "seleccionar_directorio"));
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.util.BasePanel#init()
+	 */
+	protected void init() {
+		GridBagConstraints gridBagConstraints;
+
+		setLayout(new GridBagLayout());
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.insets = new Insets(5, 5, 5, 2);
+		add(getLabelTemporales(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(5, 2, 5, 2);
+		add(getTextFieldDirectory(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.insets = new Insets(5, 2, 5, 5);
+		add(getButtonOpen(), gridBagConstraints);
+	}
+
+	private JLabel getLabelTemporales() {
+		if (labelTemporales == null) {
+			labelTemporales = new JLabel();
+		}
+		return labelTemporales;
+	}
+
+	private JButton getButtonOpen() {
+		if (buttonOpen == null) {
+			buttonOpen = new JButton();
+			buttonOpen.addActionListener(this);
+		}
+		return buttonOpen;
+	}
+
+	private JTextField getTextFieldDirectory() {
+		if (textFieldDirectory == null) {
+			textFieldDirectory = new JTextField();
+			textFieldDirectory.setEditable(false);
+			textFieldDirectory.setPreferredSize(new Dimension(0, textFieldDirectory.getPreferredSize().height));
+		}
+		return textFieldDirectory;
+	}
+
+	/**
+	 * Carga los valores por defecto del componente
+	 */
+	public void initializeDefaults() {
+		File file = new File((String) Configuration.getDefaultValue("path_temp_cache_directory"));
+		if (!file.exists())
+			file.mkdir();
+		getTextFieldDirectory().setText(file.getAbsolutePath());
+	}
+
+	/**
+	 * Carga los valores establecidos por el usuario en el componente
+	 */
+	public void initializeValues() {
+		File file = new File(Configuration.getValue("path_temp_cache_directory", RasterLocator.getManager().getFileUtils().getTemporalPath()));
+		if (!file.exists())
+			file.mkdir();
+		getTextFieldDirectory().setText(file.getAbsolutePath());
+	}
+
+	/**
+	 * Guarda los valores establecidos por el usuario
+	 */
+	public void storeValues() {
+		Configuration.setValue("path_temp_cache_directory", getTextFieldDirectory().getText());
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+	 */
+	public void actionPerformed(ActionEvent e) {
+		JFileChooser chooser = new JFileChooser(this.getClass().getName(), new File(getTextFieldDirectory().getText()));
+		chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+		chooser.setDialogTitle(PluginServices.getText(this, "seleccionar_directorio"));
+
+		if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION)
+			getTextFieldDirectory().setText(chooser.getSelectedFile().getAbsolutePath());
+
+		JFileChooser.setLastPath(this.getClass().getName(), new File(getTextFieldDirectory().getText()));
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceTemporal.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceNoData.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceNoData.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceNoData.java	(revision 8183)
@@ -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.tools.app.basic.raster.gui.preference.panel;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.text.NumberFormat;
+
+import javax.swing.BorderFactory;
+import javax.swing.JFormattedTextField;
+import javax.swing.JLabel;
+import javax.swing.text.DefaultFormatterFactory;
+import javax.swing.text.NumberFormatter;
+
+import org.gvsig.raster.mainplugin.config.Configuration;
+import org.gvsig.raster.util.BasePanel;
+/**
+ * Panel para la gesti�n del valor NoData en el panel de preferencias de gvSIG.
+ *
+ * @version 10/12/2007
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public class PreferenceNoData extends BasePanel {
+	private static final long   serialVersionUID = -8964531984609056094L;
+	private JLabel              jLabelGeneralValue     = null;
+	private JFormattedTextField textFieldGeneralValue  = null;
+
+	/**
+	 *Inicializa componentes gr�ficos y traduce
+	 */
+	public PreferenceNoData() {
+		init();
+		translate();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.util.BasePanel#translate()
+	 */
+	protected void translate() {
+		setBorder(BorderFactory.createTitledBorder(getText(this, "nodata")));
+		getLabelGeneralValue().setText(getText(this, "valor_general") + ":");
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.util.BasePanel#init()
+	 */
+	protected void init() {
+		setLayout(new GridBagLayout());
+
+		GridBagConstraints gridBagConstraints;
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.anchor = GridBagConstraints.EAST;
+		gridBagConstraints.insets = new Insets(2, 5, 2, 2);
+		add(getLabelGeneralValue(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.fill = GridBagConstraints.BOTH;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(2, 2, 2, 5);
+		add(getTextFieldGeneralValue(), gridBagConstraints);
+	}
+
+	private JFormattedTextField getTextFieldGeneralValue() {
+		if (textFieldGeneralValue == null) {
+			NumberFormat integerFormat = NumberFormat.getNumberInstance();
+			integerFormat.setParseIntegerOnly(false);
+			integerFormat.setMinimumFractionDigits(0);
+			integerFormat.setMaximumFractionDigits(3);
+			textFieldGeneralValue = new JFormattedTextField(new DefaultFormatterFactory(
+					new NumberFormatter(integerFormat),
+					new NumberFormatter(integerFormat),
+					new NumberFormatter(integerFormat)));
+		}
+		return textFieldGeneralValue;
+	}
+
+	private JLabel getLabelGeneralValue() {
+		if (jLabelGeneralValue == null) {
+			jLabelGeneralValue = new JLabel();
+		}
+		return jLabelGeneralValue;
+	}
+
+	/**
+	 * Establece los valores por defecto
+	 */
+	public void initializeDefaults() {
+		getTextFieldGeneralValue().setValue((Double) Configuration.getDefaultValue("nodata_value"));
+	}
+
+	/**
+	 * Carga los valores definidos por el usuario
+	 */
+	public void initializeValues() {
+		//getTextFieldGeneralValue().setValue(Configuration.getValue("nodata_value", Double.valueOf(RasterLibrary.defaultNoDataValue)));
+	}
+
+	/**
+	 * Guarda los valores definidos por el usuario
+	 */
+	public void storeValues() {
+		try {
+			if(getTextFieldGeneralValue().getValue() instanceof Double)
+				Configuration.setValue("nodata_value", (Double) getTextFieldGeneralValue().getValue());
+			if(getTextFieldGeneralValue().getValue() instanceof String)
+				Configuration.setValue("nodata_value", new Double((String)getTextFieldGeneralValue().getValue()));
+			if(getTextFieldGeneralValue().getValue() instanceof Long)
+				Configuration.setValue("nodata_value", new Double(((Long)getTextFieldGeneralValue().getValue()).longValue()));
+		} catch (NumberFormatException e) {
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceNoData.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceOverviews.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceOverviews.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceOverviews.java	(revision 8183)
@@ -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.tools.app.basic.raster.gui.preference.panel;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+
+import org.gvsig.fmap.dal.coverage.process.overview.OverviewBuilder;
+import org.gvsig.raster.mainplugin.config.Configuration;
+import org.gvsig.raster.util.BasePanel;
+/**
+ * PreferenceOverviews es una clase para la configuracion de las overviews de
+ * Raster en gvSIG
+ * 
+ * @version 14/12/2007
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public class PreferenceOverviews extends BasePanel {
+	private static final long  serialVersionUID  = 1L;
+	//	private JCheckBox jCheckBoxAsk           = null;
+	private JComboBox          comboBoxRate      = null;
+	private JComboBox          comboBoxNumber    = null;
+	private JComboBox          comboBoxAlgorithm = null;
+	private JLabel             labelNumber       = null;
+	private JLabel             labelRate         = null;
+	private JLabel             labelAlgorithm    = null;
+
+	/**
+	 *Inicializa componentes gr�ficos y traduce
+	 */
+	public PreferenceOverviews() {
+		init();
+		translate();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.util.BasePanel#translate()
+	 */
+	protected void translate() {
+		setBorder(BorderFactory.createTitledBorder(getText(this, "overviews")));
+		getLabelNumber().setText(getText(this, "num_overviews") + ":");
+		getLabelRate().setText(getText(this, "proporcion_overviews") + ":");
+		getLabelAlgorithm().setText(getText(this, "algorithm") + ":");
+//		getCheckBoxAsk().setText(getText(this, "generacion_overviews"));
+//		getCheckBoxAsk().setToolTipText(getCheckBoxAsk().getText());
+		
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.util.BasePanel#init()
+	 */
+	protected void init() {
+		GridBagConstraints gridBagConstraints;
+
+		setLayout(new GridBagLayout());
+
+		int posy = 0;
+		
+//		gridBagConstraints = new GridBagConstraints();
+//		gridBagConstraints.gridx = 0;
+//		gridBagConstraints.gridy = posy;
+//		gridBagConstraints.gridwidth = 2;
+//		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+//		gridBagConstraints.weightx = 1.0;
+//		gridBagConstraints.insets = new Insets(5, 5, 2, 5);
+//		add(getCheckBoxAsk(), gridBagConstraints);
+
+//		posy++;
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = posy;
+		gridBagConstraints.anchor = GridBagConstraints.EAST;
+		gridBagConstraints.insets = new Insets(2, 5, 2, 2);
+		add(getLabelNumber(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = posy;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(2, 2, 2, 5);
+		add(getComboNumber(), gridBagConstraints);
+
+		posy++;
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = posy;
+		gridBagConstraints.anchor = GridBagConstraints.EAST;
+		gridBagConstraints.insets = new Insets(2, 5, 2, 2);
+		add(getLabelRate(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = posy;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(2, 2, 2, 5);
+		add(getComboRate(), gridBagConstraints);
+
+		posy++;
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = posy;
+		gridBagConstraints.anchor = GridBagConstraints.EAST;
+		gridBagConstraints.insets = new Insets(2, 5, 5, 2);
+		add(getLabelAlgorithm(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = posy;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(2, 2, 5, 5);
+		add(getComboAlgorithm(), gridBagConstraints);
+	}
+
+	private JLabel getLabelAlgorithm() {
+		if (labelAlgorithm == null)
+			labelAlgorithm = new JLabel();
+		return labelAlgorithm;
+	}
+
+	private JLabel getLabelRate() {
+		if (labelRate == null)
+			labelRate = new JLabel();
+		return labelRate;
+	}
+
+	private JLabel getLabelNumber() {
+		if (labelNumber == null)
+			labelNumber = new JLabel();
+		return labelNumber;
+	}
+
+//	private JCheckBox getCheckBoxAsk() {
+//		if (jCheckBoxAsk == null) {
+//			jCheckBoxAsk = new JCheckBox();
+//			jCheckBoxAsk.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+//			jCheckBoxAsk.setMargin(new Insets(0, 0, 0, 0));
+//		}
+//		return jCheckBoxAsk;
+//	}
+
+	private JComboBox getComboRate() {
+		if (comboBoxRate == null) {
+			comboBoxRate = new JComboBox();
+			comboBoxRate.setModel(new DefaultComboBoxModel(new String[] { "/2", "/3" }));
+		}
+		return comboBoxRate;
+	}
+
+	private JComboBox getComboNumber() {
+		if (comboBoxNumber == null) {
+			comboBoxNumber = new JComboBox();
+			comboBoxNumber.setModel(new DefaultComboBoxModel(new String[] { "2", "3", "4", "5", "6" }));
+		}
+		return comboBoxNumber;
+	}
+
+	private JComboBox getComboAlgorithm() {
+		if (comboBoxAlgorithm == null) {
+			comboBoxAlgorithm = new JComboBox();
+			comboBoxAlgorithm.setModel(new DefaultComboBoxModel(new String[] { getText(this, "vecino_cercano"), getText(this, "media"), getText(this, "media_phase") }));
+		}
+		return comboBoxAlgorithm;
+	}
+
+	/**
+	 * Carga los valores por defecto del componente
+	 */
+	public void initializeDefaults() {
+		int pos = 0;
+//		getCheckBoxAsk().setSelected(((Boolean) Configuration.getDefaultValue("overviews_ask_before_loading")).booleanValue());
+
+		pos = ((Integer) Configuration.getDefaultValue("overviews_number")).intValue() - 2;
+		if ((pos < 0) || (pos >= getComboNumber().getItemCount()))
+			pos = 2;
+		getComboNumber().setSelectedIndex(pos);
+
+		pos = ((Integer) Configuration.getDefaultValue("overviews_rate")).intValue() - 2;
+		if ((pos < 0) || (pos >= getComboRate().getItemCount()))
+			pos = 0;
+		getComboRate().setSelectedIndex(pos);
+
+		pos = ((Integer) Configuration.getDefaultValue("overviews_resampling_algorithm")).intValue();
+		int type = 1;
+		switch (pos) {
+			case OverviewBuilder.NEAREST:
+				type = 0;
+				break;
+			case OverviewBuilder.AVERAGE_MAGPHASE:
+				type = 2;
+				break;
+		}
+		getComboAlgorithm().setSelectedIndex(type);
+	}
+
+	/**
+	 * Carga los valores definidos previamente por el usuario 
+	 */
+	public void initializeValues() {
+		int pos = 0;
+//		getCheckBoxAsk().setSelected(Configuration.getValue("overviews_ask_before_loading", Boolean.FALSE).booleanValue());
+
+		pos = Configuration.getValue("overviews_number", Integer.valueOf(4)).intValue() - 2;
+		if ((pos < 0) || (pos >= getComboNumber().getItemCount()))
+			pos = 2;
+		getComboNumber().setSelectedIndex(pos);
+
+		pos = Configuration.getValue("overviews_rate", Integer.valueOf(2)).intValue() - 2;
+		if ((pos < 0) || (pos >= getComboRate().getItemCount()))
+			pos = 0;
+		getComboRate().setSelectedIndex(pos);
+
+		pos = Configuration.getValue("overviews_resampling_algorithm", Integer.valueOf(OverviewBuilder.AVERAGE)).intValue();
+		int type = 1;
+		switch (pos) {
+			case OverviewBuilder.NEAREST:
+				type = 0;
+				break;
+			case OverviewBuilder.AVERAGE_MAGPHASE:
+				type = 2;
+				break;
+		}
+		getComboAlgorithm().setSelectedIndex(type);
+	}
+
+	/**
+	 * Guarda los valores definidos por el usuario
+	 */
+	public void storeValues() {
+//		Configuration.setValue("overviews_ask_before_loading", Boolean.valueOf(getCheckBoxAsk().isSelected()));
+		if (getComboRate().getSelectedIndex() > -1)
+			Configuration.setValue("overviews_rate", Integer.valueOf(getComboRate().getSelectedIndex() + 2));
+		if (getComboNumber().getSelectedIndex() > -1)
+			Configuration.setValue("overviews_number", Integer.valueOf(getComboNumber().getSelectedIndex() + 2));
+
+		int type = OverviewBuilder.AVERAGE;
+		switch (getComboAlgorithm().getSelectedIndex()) {
+			case 0:
+				type = OverviewBuilder.NEAREST;
+				break;
+			case 2:
+				type = OverviewBuilder.AVERAGE_MAGPHASE;
+				break;
+		}
+		Configuration.setValue("overviews_resampling_algorithm", Integer.valueOf(type));
+	}
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceOverviews.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceLoadLayer.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceLoadLayer.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceLoadLayer.java	(revision 8183)
@@ -0,0 +1,281 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.raster.gui.preference.panel;
+
+import java.awt.Component;
+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 java.util.ArrayList;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JRadioButton;
+import javax.swing.ListCellRenderer;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+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.mainplugin.config.Configuration;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.tools.app.basic.raster.gui.preference.combocolortable.PaintItem;
+import org.gvsig.raster.tools.app.basic.raster.gui.preference.combocolortable.PreferenceColorTableIconPainter;
+import org.gvsig.raster.util.BasePanel;
+/**
+ * PreferenceLoadLayer es una clase para la configuracion de las preferencias
+ * de una capa raster.
+ * 
+ * @version 14/12/2007
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public class PreferenceLoadLayer extends BasePanel implements ActionListener {
+	private static final long    serialVersionUID      = 1L;
+	private JComboBox            comboBoxColorTable    = null;
+	private JRadioButton         radioButtonRealce     = null;
+	private JRadioButton         radioButtonColorTable = null;
+	private JLabel               labelLoadLayer        = null;
+	private ButtonGroup          buttonGroup           = null;
+
+	/**
+	 *Inicializa componentes gr�ficos y traduce
+	 */
+	public PreferenceLoadLayer() {
+		init();
+		translate();
+	}
+	
+	/**
+	 * Traduce los textos de esta clase
+	 */
+	protected void translate() {
+		setBorder(BorderFactory.createTitledBorder(getText(this, "carga_capas")));
+		getLabelLoadLayer().setText(getText(this, "loadlayer_aplicar") + ":");
+		getRadioButtonRealce().setText(getText(this, "realce"));
+		getRadioButtonColorTable().setText(getText(this, "tabla_color"));
+	}
+
+	protected void init() {
+		GridBagConstraints gridBagConstraints;
+
+		setLayout(new GridBagLayout());
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.gridwidth = 2;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(5, 5, 2, 5);
+		add(getLabelLoadLayer(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.gridwidth = 2;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(2, 5, 2, 5);
+		add(getRadioButtonRealce(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 2;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(2, 5, 5, 2);
+		add(getRadioButtonColorTable(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = 2;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(2, 2, 5, 5);
+		add(getComboBoxColorTable(), gridBagConstraints);
+	}
+	
+	/**
+	 * Obtiene el path del fichero de paletas
+	 * @return
+	 */
+	public String getPalettesPath() {
+		return System.getProperty("user.home") +
+				File.separator +
+				"gvSIG" + // PluginServices.getArguments()[0] +
+				File.separator + "colortable";
+	}
+	
+	/**
+	 * Obtiene el grupo de botones 
+	 * @return ButtonGroup
+	 */
+	public ButtonGroup getButtonGroup() {
+		if(buttonGroup == null)
+			buttonGroup = new ButtonGroup();
+		return buttonGroup;
+	}
+
+	public JRadioButton getRadioButtonRealce() {
+		if (radioButtonRealce == null) {
+			radioButtonRealce = new JRadioButton();
+			getButtonGroup().add(radioButtonRealce);
+			radioButtonRealce.addActionListener(this);
+			radioButtonRealce.setSelected(true);
+			radioButtonRealce.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+			radioButtonRealce.setMargin(new Insets(0, 0, 0, 0));
+		}
+		return radioButtonRealce;
+	}
+
+	public JRadioButton getRadioButtonColorTable() {
+		if (radioButtonColorTable == null) {
+			radioButtonColorTable = new JRadioButton();
+			getButtonGroup().add(radioButtonColorTable);
+			radioButtonColorTable.addActionListener(this);
+			radioButtonColorTable.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+			radioButtonColorTable.setMargin(new Insets(0, 0, 0, 0));
+		}
+		return radioButtonColorTable;
+	}
+
+	public JLabel getLabelLoadLayer() {
+		if (labelLoadLayer == null) {
+			labelLoadLayer = new JLabel();
+		}
+		return labelLoadLayer;
+	}
+
+	@SuppressWarnings("unchecked")
+	public JComboBox getComboBoxColorTable() {
+		if (comboBoxColorTable == null) {
+			comboBoxColorTable = new JComboBox();
+			ColorTableLibrary lib = RasterLocator.getManager().getDataStructFactory().getColorTableLibrary();
+
+			ArrayList<String> fileList = null;
+			
+			try {
+				fileList = lib.getPaletteFileList(getPalettesPath());
+
+				for (int i = 0; i < fileList.size(); i++) {
+					ArrayList<ColorItem> paletteItems = new ArrayList<ColorItem>();
+					String paletteName = lib.loadPalette(getPalettesPath(), (String) fileList.get(i), paletteItems);
+
+					if (paletteItems.size() <= 0)
+						continue;
+
+					ColorTable colorTable = lib.createColorTable();
+					colorTable.setName(paletteName);
+					colorTable.createPaletteFromColorItems(paletteItems, true);
+					colorTable.setInterpolated(true);
+
+					ArrayList array = new ArrayList();
+					array.add(paletteName);
+					array.add(new PreferenceColorTableIconPainter(colorTable));
+
+					comboBoxColorTable.addItem(array);
+				}
+			} catch (FilePaletteException e) {
+				RasterSwingLibrary.messageBoxError(e.getMessage(), this, e);
+			}
+			
+			comboBoxColorTable.setRenderer(new ListCellRenderer() {
+				public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+					ArrayList array = (ArrayList) value;
+
+					PaintItem paintItem = new PaintItem((String) array.get(0), (PreferenceColorTableIconPainter) array.get(1), isSelected);
+					return paintItem;
+				}
+			});
+		}
+		return comboBoxColorTable;
+	}
+
+	private void setColorTableEnabled(boolean enabled) {
+		getComboBoxColorTable().setEnabled(enabled);
+	}
+
+	/**
+	 * Establece los valores por defecto de la clase
+	 */
+	public void initializeDefaults() {
+		getRadioButtonRealce().setSelected(true);
+		setColorTableEnabled(false);
+		selectComboName("Default");
+	}
+
+	@SuppressWarnings("unchecked")
+	private boolean selectComboName(String name) {
+		if (name != null) {
+			for (int i=0; i<getComboBoxColorTable().getItemCount(); i++) {
+				if (((String) ((ArrayList) getComboBoxColorTable().getItemAt(i)).get(0)).equals(name)) {
+					getComboBoxColorTable().setSelectedIndex(i);
+					return true;
+				}
+			}
+		}
+		return false;
+	}
+
+	/**
+	 * Establece los valores que ha definido el usuario en los componentes
+	 */
+	public void initializeValues() {
+		String colorTable = Configuration.getValue("loadlayer_usecolortable", (String) null);
+
+		boolean finded = selectComboName(colorTable);
+
+		if (finded == false) {
+			getRadioButtonRealce().setSelected(true);
+			setColorTableEnabled(false);
+			Configuration.setValue("loadlayer_usecolortable", (String) null);
+			selectComboName("Default");
+		} else {
+			getRadioButtonColorTable().setSelected(true);
+			setColorTableEnabled(true);
+		}
+	}
+
+	/**
+	 * Guarda los valores que hay en los componentes como valores de configuracion
+	 */
+	@SuppressWarnings("unchecked")
+	public void storeValues() {
+		if (getRadioButtonColorTable().isSelected())
+			Configuration.setValue("loadlayer_usecolortable", (String) ((ArrayList) getComboBoxColorTable().getSelectedItem()).get(0));
+		else
+			Configuration.setValue("loadlayer_usecolortable", null);
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if (getRadioButtonColorTable().isSelected()) {
+			setColorTableEnabled(true);
+		} else {
+			setColorTableEnabled(false);
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceLoadLayer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceGeneral.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceGeneral.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceGeneral.java	(revision 8183)
@@ -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.tools.app.basic.raster.gui.preference.panel;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.raster.mainplugin.config.Configuration;
+import org.gvsig.raster.util.BasePanel;
+/**
+ * Clase para la configuracion general de Raster. Aqui tenemos todas las variables
+ * que no tienen una secci�n en concreto.
+ * 
+ * @version 12/12/2007
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public class PreferenceGeneral extends BasePanel {
+	private static final long   serialVersionUID    = 1L;
+	private JCheckBox           checkBoxPreview     = null;
+	private JLabel              labelNumClases      = null;
+	private JComboBox           comboBoxNumClases   = null;
+	
+	/**
+	 *Inicializa componentes gr�ficos y traduce
+	 */
+	public PreferenceGeneral() {
+		init();
+		translate();
+	}
+	
+	/**
+	 * Todas las traducciones de esta clase.
+	 */
+	protected void translate() {
+		setBorder(BorderFactory.createTitledBorder(getText(this, "general")));
+		getCheckBoxPreview().setText(getText(this, "previsualizar_automaticamente_raster"));
+		getCheckBoxPreview().setToolTipText(getCheckBoxPreview().getText());
+		getLabelNumClases().setText(getText(this, "num_clases") + ":");
+	}
+
+	protected void init() {
+		GridBagConstraints gridBagConstraints;
+
+		setLayout(new GridBagLayout());
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.gridwidth = 2;
+		gridBagConstraints.fill = GridBagConstraints.BOTH;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.weighty = 1.0;
+		gridBagConstraints.insets = new Insets(5, 5, 2, 5);
+		add(getCheckBoxPreview(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.anchor = GridBagConstraints.EAST;
+		gridBagConstraints.insets = new Insets(2, 5, 2, 2);
+		add(getLabelNumClases(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(2, 2, 2, 5);
+		add(getComboBoxNumClases(), gridBagConstraints);
+	}
+
+	private JCheckBox getCheckBoxPreview() {
+		if (checkBoxPreview == null) {
+			checkBoxPreview = new JCheckBox();
+			checkBoxPreview.setMargin(new Insets(0, 0, 0, 0));
+		}
+		return checkBoxPreview;
+	}
+
+	private JLabel getLabelNumClases() {
+		if (labelNumClases == null) {
+			labelNumClases = new JLabel();
+		}
+		return labelNumClases;
+	}
+
+	private JComboBox getComboBoxNumClases() {
+		if (comboBoxNumClases == null) {
+			comboBoxNumClases = new JComboBox();
+			comboBoxNumClases.setModel(new DefaultComboBoxModel(new String[] { "32", "64", "128", "256" }));
+		}
+		return comboBoxNumClases;
+	}
+
+	/**
+	 * Establece los valodres por defecto
+	 */
+	public void initializeDefaults() {
+		getCheckBoxPreview().setSelected(((Boolean)Configuration.getDefaultValue("general_auto_preview")).booleanValue());
+		Integer defaultNumberOfClasses = (Integer) Configuration.getDefaultValue("general_defaultNumberOfClasses");
+		for (int i = 0; i < getComboBoxNumClases().getItemCount(); i++) {
+			if (getComboBoxNumClases().getItemAt(i).toString().equals(defaultNumberOfClasses.toString())) {
+				getComboBoxNumClases().setSelectedIndex(i);
+				break;
+			}
+		}
+	}
+
+	/**
+	 * Establece los valores que han sido definidas por el usuario
+	 */
+	public void initializeValues() {
+		getCheckBoxPreview().setSelected(Configuration.getValue("general_auto_preview", Boolean.valueOf(true)).booleanValue());
+		Integer defaultNumberOfClasses = Configuration.getValue("general_defaultNumberOfClasses", Integer.valueOf(RasterLibrary.defaultNumberOfClasses));
+		for (int i = 0; i < getComboBoxNumClases().getItemCount(); i++) {
+			if (getComboBoxNumClases().getItemAt(i).toString().equals(defaultNumberOfClasses.toString())) {
+				getComboBoxNumClases().setSelectedIndex(i);
+				break;
+			}
+		}
+	}
+
+	/**
+	 * Guarda los valores que han sido definidas por el usuario
+	 */
+	public void storeValues() {
+		Configuration.setValue("general_auto_preview", Boolean.valueOf(getCheckBoxPreview().isSelected()));
+		int nClasses = Integer.valueOf(getComboBoxNumClases().getSelectedItem().toString());
+		Configuration.setValue("general_defaultNumberOfClasses", nClasses);
+		RasterLibrary.defaultNumberOfClasses = nClasses;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel/PreferenceGeneral.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/panel
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/RasterPreferences.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/RasterPreferences.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/RasterPreferences.java	(revision 8183)
@@ -0,0 +1,290 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.raster.gui.preference;
+
+import java.awt.BorderLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.ImageIcon;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.border.EmptyBorder;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.preferences.AbstractPreferencePage;
+import org.gvsig.andami.preferences.StoreException;
+import org.gvsig.raster.tools.app.basic.raster.gui.preference.panel.PreferenceCache;
+import org.gvsig.raster.tools.app.basic.raster.gui.preference.panel.PreferenceGeneral;
+import org.gvsig.raster.tools.app.basic.raster.gui.preference.panel.PreferenceLoadLayer;
+import org.gvsig.raster.tools.app.basic.raster.gui.preference.panel.PreferenceNoData;
+import org.gvsig.raster.tools.app.basic.raster.gui.preference.panel.PreferenceOverviews;
+import org.gvsig.raster.tools.app.basic.raster.gui.preference.panel.PreferenceTemporal;
+
+/**
+ * RasterPreferences es un panel de preferencias situado a nivel de las
+ * preferencias de gvSIG que engloba todas las opciones configurables de Raster
+ *
+ * @version 11/12/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class RasterPreferences extends AbstractPreferencePage {
+	private static final long serialVersionUID = -1689657253810393874L;
+
+	protected static String     id        = RasterPreferences.class.getName();
+	private ImageIcon           icon;
+
+	private PreferenceNoData    noData    = null;
+	private PreferenceOverviews overviews = null;
+	private PreferenceCache     cache     = null;
+	private PreferenceTemporal  temporal  = null;
+	private PreferenceGeneral   general   = null;
+	private PreferenceLoadLayer loadLayer = null;
+
+	/**
+	 * Constructor de la clase RasterPreferences
+	 */
+	public RasterPreferences() {
+		super();
+		icon = IconThemeHelper.getImageIcon("pref-raster-icon");
+		initialize();
+	}
+
+	/**
+	 * Inicializacion del panel de preferencias.
+	 */
+	private void initialize() {
+		setTitle("Frame");
+
+		GridBagConstraints gridBagConstraints;
+
+		JScrollPane scrollPane = new JScrollPane();
+
+		scrollPane.getVerticalScrollBar().setUnitIncrement(20);
+
+		JPanel panel = new JPanel();
+
+		panel.setLayout(new GridBagLayout());
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		panel.add(getPreferenceGeneral(), gridBagConstraints);
+
+		//gridBagConstraints = new GridBagConstraints();
+		//gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		//gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		panel.add(getPreferenceLoadLayer(), gridBagConstraints);
+
+		//gridBagConstraints = new GridBagConstraints();
+		//gridBagConstraints.gridx = 0;
+		//gridBagConstraints.gridy = 2;
+		//gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		//panel.add(getPreferenceNoData(), gridBagConstraints);
+
+		//gridBagConstraints = new GridBagConstraints();
+		//gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 2;
+		//gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		panel.add(getPreferenceTemporal(), gridBagConstraints);
+
+		//gridBagConstraints = new GridBagConstraints();
+		//gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 3;
+		//gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		panel.add(getPreferenceOverviews(), gridBagConstraints);
+
+		//gridBagConstraints = new GridBagConstraints();
+		//gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 4;
+		//gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		panel.add(getPreferenceCache(), gridBagConstraints);
+
+		//gridBagConstraints = new GridBagConstraints();
+		//gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 5;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.weighty = 1.0;
+		panel.add(new JPanel(), gridBagConstraints);
+
+		panel.setBorder(new EmptyBorder(5, 5, 5, 5));
+
+		scrollPane.setViewportView(panel);
+
+		setLayout(new BorderLayout());
+		add(scrollPane, BorderLayout.CENTER);
+	}
+
+	/**
+	 * Devuelve el panel de configuracion para los valores NoData
+	 * @return
+	 */
+	private PreferenceNoData getPreferenceNoData() {
+		if (noData == null) {
+			noData = new PreferenceNoData();
+		}
+		return noData;
+	}
+	
+	/**
+	 * Devuelve el panel de configuracion general de Raster. Aqui es donde se
+	 * define si se visualiza automaticamente Raster, el numero de clases, si se
+	 * pregunta la reproyeccion, etc...
+	 * @return
+	 */
+	private PreferenceGeneral getPreferenceGeneral() {
+		if (general == null) {
+			general = new PreferenceGeneral();
+		}
+		return general;
+	}
+
+	/**
+	 * Devuelve un panel de configuracion para las overviews de Raster.
+	 * @return
+	 */
+	private PreferenceOverviews getPreferenceOverviews() {
+		if (overviews == null) {
+			overviews = new PreferenceOverviews();
+		}
+		return overviews;
+	}
+
+	/**
+	 * Devuelve el panel de preferencias para las opciones de cache de Raster.
+	 * Aqu� se podr�n definir todos los parametros configurables respecto a la
+	 * cache.
+	 * @return
+	 */
+	private PreferenceCache getPreferenceCache() {
+		if (cache == null) {
+			cache = new PreferenceCache();
+		}
+		return cache;
+	}
+
+	
+	private PreferenceTemporal getPreferenceTemporal() {
+		if (temporal == null) {
+			temporal = new PreferenceTemporal();
+		}
+		return temporal;
+	}
+
+	private PreferenceLoadLayer getPreferenceLoadLayer() {
+		if (loadLayer == null) {
+			loadLayer = new PreferenceLoadLayer();
+		}
+		return loadLayer;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.andami.preferences.IPreference#initializeValues()
+	 */
+	public void initializeValues() {
+		getPreferenceNoData().initializeValues();
+		getPreferenceOverviews().initializeValues();
+		getPreferenceCache().initializeValues();
+		getPreferenceTemporal().initializeValues();
+		getPreferenceGeneral().initializeValues();
+		getPreferenceLoadLayer().initializeValues();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.andami.preferences.AbstractPreferencePage#storeValues()
+	 */
+	public void storeValues() throws StoreException {
+		getPreferenceNoData().storeValues();
+		getPreferenceOverviews().storeValues();
+		getPreferenceCache().storeValues();
+		getPreferenceTemporal().storeValues();
+		getPreferenceGeneral().storeValues();
+		getPreferenceLoadLayer().storeValues();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.andami.preferences.IPreference#initializeDefaults()
+	 */
+	public void initializeDefaults() {
+		getPreferenceNoData().initializeDefaults();
+		getPreferenceOverviews().initializeDefaults();
+		getPreferenceCache().initializeDefaults();
+		getPreferenceTemporal().initializeDefaults();
+		getPreferenceGeneral().initializeDefaults();
+		getPreferenceLoadLayer().initializeDefaults();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.andami.preferences.AbstractPreferencePage#isResizeable()
+	 */
+	public boolean isResizeable() {
+		return true;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.andami.preferences.IPreference#getID()
+	 */
+	public String getID() {
+		return id;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.andami.preferences.IPreference#getIcon()
+	 */
+	public ImageIcon getIcon() {
+		return icon;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.andami.preferences.IPreference#getPanel()
+	 */
+	public JPanel getPanel() {
+		return this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.andami.preferences.IPreference#getTitle()
+	 */
+	public String getTitle() {
+		return "Raster";
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.andami.preferences.IPreference#isValueChanged()
+	 */
+	public boolean isValueChanged() {
+		return true;
+	}
+
+	public void setChangesApplied() {}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/RasterPreferences.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/combocolortable/PaintItem.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/combocolortable/PaintItem.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/combocolortable/PaintItem.java	(revision 8183)
@@ -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.tools.app.basic.raster.gui.preference.combocolortable;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.FontMetrics;
+import java.awt.GradientPaint;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+/**
+ * Clase que se encarga de dibujar los elementos de una tabla de color dentro
+ * de un JComboBox.
+ *
+ * @version 17/04/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class PaintItem extends Component {
+	private static final long serialVersionUID = -6448740563809113949L;
+	private boolean isSelected = false;
+	private String name = "";
+	private PreferenceColorTableIconPainter colorTablePaint = null;
+
+	public PaintItem(String name, PreferenceColorTableIconPainter colorTablePaint, boolean isSelected) {
+		this.name = name;
+		this.colorTablePaint = colorTablePaint;
+		this.isSelected = isSelected;
+
+		setSize(getWidth(), 19);
+		setPreferredSize(new Dimension(getWidth(), 19));
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.Component#paint(java.awt.Graphics)
+	 */
+	public void paint(Graphics g) {
+		Graphics2D g2 = (Graphics2D) g;
+		if (isSelected) {
+			Color color1 = new Color(89, 153, 229);
+			Color color2 = new Color(31, 92, 207);
+			g2.setPaint(new GradientPaint(0, 1, color1, 0, getHeight() - 1, color2, false));
+			g2.fillRect(0, 1, getWidth(), getHeight() - 1);
+			g2.setColor(new Color(61, 123, 218));
+			g2.drawLine(0, 0, getWidth(), 0);
+			g2.setColor(Color.white);
+		} else {
+			g2.setColor(Color.white);
+			g2.fillRect(0, 0, getWidth(), getHeight());
+			g2.setColor(Color.black);
+		}
+
+		Rectangle bounds = getBounds();
+
+		FontMetrics fm = g2.getFontMetrics();
+		int upper = (bounds.height + fm.getHeight()) / 2 - fm.getDescent();
+
+		g2.setClip(bounds.x, 0, bounds.width, bounds.height);
+		g2.drawString(name, bounds.width - 146, upper);
+
+		g2.setClip(bounds.x, 0, bounds.width - 150, bounds.height);
+
+		colorTablePaint.paint((Graphics2D) g2, isSelected);		
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/combocolortable/PaintItem.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/combocolortable/PreferenceColorTableIconPainter.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/combocolortable/PreferenceColorTableIconPainter.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/combocolortable/PreferenceColorTableIconPainter.java	(revision 8183)
@@ -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.tools.app.basic.raster.gui.preference.combocolortable;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+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.gui.beans.listview.IIconPaint;
+/**
+ * Clase para dibujar los iconos del ListViewComponent del panel de color. Se
+ * puede indicar si la paleta esta seleccionada y si se dibuja con
+ * interpolaciones.
+ *
+ * @version 29/06/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class PreferenceColorTableIconPainter implements IIconPaint {
+	private ColorTable colorTable;
+
+	/**
+	 * Construye un ColorTablePaint con una tabla de color pasada por parametro
+	 * @param colorTable
+	 */
+	public PreferenceColorTableIconPainter(ColorTable colorTable) {
+		this.colorTable = colorTable;
+	}
+
+	/**
+	 * Define si los valores estan interpolados o no entre si
+	 * @param value
+	 */
+	public void setInterpolated(boolean value) {
+		colorTable.setInterpolated(value);
+	}
+
+	/**
+	 * Obtiene el array de los colores de la paleta de color
+	 * @return
+	 */
+	public List<ColorItem> getColorItems() {
+		return colorTable.getColorItems();
+	}
+
+	/**
+	 * Obtiene el ColorTable
+	 * @return
+	 */
+	public ColorTable getColorTable() {
+		return colorTable;
+	}
+
+	/**
+	 * Especificar los colores de la tabla de color, definiendo si estan los
+	 * valores interpolados y si la paleta se comprimira o no.
+	 * @param value
+	 * @param interpolated
+	 * @param compress
+	 */
+	public void setColorItems(ArrayList<ColorItem> value, boolean interpolated, boolean compress) {
+		colorTable.createPaletteFromColorItems(value, compress);
+		setInterpolated(interpolated);
+	}
+
+	/**
+	 * Metodo de pintado de la tabla de color
+	 * @param g
+	 * @param isSelected
+	 */
+	public void paint(Graphics2D g, boolean isSelected) {
+		Rectangle area = g.getClipBounds();
+
+		int x1 = area.x;
+		int x2 = area.x + area.width - 1;
+
+		Color bgColor = new Color(224, 224, 224);
+		for (int i = 0; (i * 4) <= area.width; i++) {
+			for (int j = 0; (j * 4) <= area.height; j++) {
+				if ((i + j) % 2 == 0)
+					g.setColor(Color.white);
+				else
+					g.setColor(bgColor);
+				g.fillRect(area.x + 1 + i * 4, area.y + 1 + j * 4, 4, 4);
+			}
+		}
+
+		if (colorTable.getColorItems().size() >= 1) {
+			double min = ((ColorItem) colorTable.getColorItems().get(0)).getValue();
+			double max = ((ColorItem) colorTable.getColorItems().get(colorTable.getColorItems().size() - 1)).getValue();
+			for (int i = area.x; i < (area.x + area.width); i++) {
+				double pos = min + (((max - min) * (i - area.x)) / (area.width - 2));
+
+				byte[] col3 = colorTable.getRGBAByBand(pos);
+				g.setColor(new Color(col3[0] & 0xff, col3[1] & 0xff, col3[2] & 0xff, col3[3] & 0xff));
+				g.drawLine(i, area.y, i, area.y + area.height - 2);
+			}
+		} else {
+			g.setColor(new Color(224, 224, 224));
+			g.fillRect(x1, area.y, x2 - x1, area.height - 1);
+		}
+		if (isSelected)
+			g.setColor(Color.black);
+		else
+			g.setColor(new Color(96, 96, 96));
+		g.drawRect(x1, area.y, x2 - x1, area.height - 1);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/combocolortable/PreferenceColorTableIconPainter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference/combocolortable
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/preference
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/ReprojectionQueue.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/ReprojectionQueue.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/ReprojectionQueue.java	(revision 8183)
@@ -0,0 +1,114 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.raster.gui.wizard;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.raster.algorithm.process.IProcessActions;
+import org.gvsig.raster.algorithm.process.ProcessException;
+import org.gvsig.raster.algorithm.process.DataProcess;
+import org.gvsig.raster.util.Queue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Cola de procesos de ejecuci�n exclusiva. Los procesos de esta lista se ir�n ejecutando
+ * por orden de llegada impidiendo que se ejecuten dos al mismo tiempo.
+ * 
+ * 16/05/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class ReprojectionQueue extends Thread {
+	private Queue                     queue                       = new Queue();
+	private DataProcess             executionProcess            = null;
+	static private ReprojectionQueue  singleton                   = null;
+	private Logger                    logger                      = LoggerFactory.getLogger(ReprojectionQueue.class.toString());
+	
+	/**
+	 * Devuelve una instancia al unico objeto de UniqueProcessQueue que puede existir.
+	 * @return
+	 */
+	static public ReprojectionQueue getSingleton() {
+		if(singleton == null) {
+			singleton = new ReprojectionQueue();
+			synchronized (singleton) {
+				singleton.start();
+			}
+		}
+		return singleton;
+	}
+	
+	public void run() {
+		//Cuando arranca el thread se duerme porque la cola est� vacia
+		synchronized (this) {
+			try {
+				wait();
+			} catch (InterruptedException e) {
+			}
+		}
+		
+		while(true) {
+			if(queue.size() >= 1) {
+				Object[] obj = (Object[])queue.get();
+				executionProcess = ((DataProcess) obj[0]);
+				if (executionProcess != null) {
+					executionProcess.showIncrementableWindow();
+					try {
+						executionProcess.execute();
+					} catch (ProcessInterruptedException e) {
+					} catch (ProcessException e) {
+						logger.debug(RasterLocator.getManager().getRasterUtils().getTrace(e));
+					}
+					executionProcess.getIncrementableTask().processFinalize();
+					
+					//Despierta el objeto que llam� cuando termina el calculo
+					//para que pueda recoger los resultados
+					synchronized (obj[1]) {
+						obj[1].notify();	
+					}
+					
+					//Cuando la cola est� vacia se suspende el hilo.
+					if(queue.size() <= 0) {
+						synchronized (this) {
+							try {
+								this.wait();
+							} catch (InterruptedException e) {
+							}
+						}
+					}
+						
+				}
+			}
+		}
+	}	
+	
+	/**
+	 * A�ade un proceso a la cola.
+	 * @param id Identificador del proceso
+	 * @param process Proceso
+	 * @throws InterruptedException 
+	 */
+	public synchronized void add(DataProcess process, IProcessActions obj) {
+		queue.put(new Object[]{process, obj});
+	}
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/ReprojectionQueue.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/ParseURIException.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/ParseURIException.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/ParseURIException.java	(revision 8183)
@@ -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.
+ */
+package org.gvsig.raster.tools.app.basic.raster.gui.wizard;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * Generic exception thrown in the Annotation API when the exception or error
+ * may be dealt by the program or the user of the program which is a client of
+ * the Annotation API.
+ *
+ * @author gvSIG team.
+ * @version $Id$
+ */
+public class ParseURIException extends BaseException {
+
+    /**
+     *
+     */
+    private static final long serialVersionUID = -385212859922234711L;
+
+    private static final String MESSAGE =
+        "An error has been produced in parsing URI";
+
+    private static final String KEY = "_ParseURIException";
+
+    /**
+     * Creates a new {@link AnnotationCreationException}.
+     *
+     * @param cause
+     *            the original cause
+     */
+    public ParseURIException(Throwable cause) {
+        super(MESSAGE, cause, KEY, serialVersionUID);
+    }
+
+    public ParseURIException(String message) {
+        super(message, KEY, serialVersionUID);
+    }
+
+    public ParseURIException(String message, Throwable cause) {
+        super(message, cause, KEY, serialVersionUID);
+    }
+}
Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/PrepareLayerAskWritableDirectory.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/PrepareLayerAskWritableDirectory.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/PrepareLayerAskWritableDirectory.java	(revision 8183)
@@ -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.tools.app.basic.raster.gui.wizard;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.net.URI;
+import java.util.Map;
+
+import javax.swing.JOptionPane;
+
+import org.apache.commons.lang3.StringUtils;
+
+import org.gvsig.app.prepareAction.PrepareContext;
+import org.gvsig.app.prepareAction.PrepareDataStoreParameters;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.mainplugin.beans.createlayer.WritableFolderPanel;
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * Mechanism to detect if a layer is in a folder with write permission. If the user does not have
+ * permission to write, the application need a directory with this permission to write metadata files.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class PrepareLayerAskWritableDirectory implements PrepareDataStoreParameters, ActionListener {
+	private DataStoreParameters         newParameters       = null;
+	private DataStoreParameters         oldParameters        = null;
+	private String                      selectedPath         = null;
+	private boolean                     applyToAllLayers     = false;
+
+	public DataStoreParameters prepare(DataStoreParameters storeParameters,
+			PrepareContext context) throws BaseException {
+		if(!(storeParameters instanceof RasterDataParameters) ||
+			((RasterDataParameters)storeParameters).isSourceTiled())
+			return storeParameters;
+
+		oldParameters = storeParameters;
+		URI uri = ((RasterDataParameters)storeParameters).getURI();
+
+		File file = new File(uri);
+		String folder = file.getParent();
+        String layerName = file.getName();
+        if (StringUtils.isEmpty(folder)) {
+            folder = System.getProperty("user.home");
+        }
+
+		if(!isValidFolder(folder)) {
+			if(applyToAllLayers) {
+				setFolderToNewDataParameters(selectedPath);
+			} else {
+				WritableFolderPanel panel = new WritableFolderPanel(folder, this, layerName);
+				applyToAllLayers = panel.aplyAllFiles();
+			}
+		} else {
+			return oldParameters;
+		}
+
+		return newParameters;
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if(e.getID() == 0) { //Cambio de directorio
+			selectedPath = e.getActionCommand();
+		}
+		if(e.getID() == ButtonsPanel.BUTTON_ACCEPT) {
+			if(isValidFolder(selectedPath)) {
+				setFolderToNewDataParameters(selectedPath);
+			} else {
+				JOptionPane.showMessageDialog(null, Messages.getText("folder_not_writable"), "", JOptionPane.WARNING_MESSAGE);
+				newParameters = null;
+			}
+		}
+
+		if(e.getID() == ButtonsPanel.BUTTON_CANCEL) {
+			newParameters = null;
+		}
+	}
+
+	private void setFolderToNewDataParameters(String path) {
+		newParameters = oldParameters;
+		newParameters.setDynValue(RasterDataParameters.FIELD_RMF_FOLDER, path);
+	}
+
+	private boolean isValidFolder(String folder) {
+		File path = new File(folder);
+		return (path.exists() && path.isDirectory() && path.canWrite());
+	}
+
+	public void post(DataStoreParameters storeParameters, PrepareContext context) {
+		applyToAllLayers = false;
+	}
+
+	public void pre(DataStoreParameters storeParameters, PrepareContext context) {
+	}
+
+	public void end(Object param) {
+	}
+
+	public String getDescription() {
+		return "Detects folders with write permission";
+	}
+
+	public String getName() {
+		return "PrepareLayerAskWritableDirectory";
+	}
+
+	public Object create() {
+		return this;
+	}
+
+	public Object create(Object[] args) {
+		return this;
+	}
+
+	@SuppressWarnings("unchecked")
+	public Object create(Map args) {
+		return this;
+	}
+
+	public void interrupted() {
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/PrepareLayerAskWritableDirectory.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/IFileOpen.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/IFileOpen.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/IFileOpen.java	(revision 8183)
@@ -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.raster.tools.app.basic.raster.gui.wizard;
+
+import java.io.File;
+import java.util.List;
+
+import javax.swing.filechooser.FileFilter;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontrol.MapControl;
+
+/**
+ * Interfaz que deben implementar todas aquellas extensiones que quieran
+ * aparecer en un punto com�n del cuadro de dialogo de apertura de ficheros.
+ *
+ * @version 03/09/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public interface IFileOpen {
+	/**
+	 * Metodo que se invocar� justo antes de abrir el panel de ficheros.
+	 */
+	public void pre();
+
+	/**
+	 * Metodo que se invocar� despues de haber aceptado los ficheros en el cuadro
+	 * de di�logo, para poder intentar configurar los par�metros de cada fichero.
+	 * Se pasa un fichero por parametro, si se devuelve null, el fichero no se
+	 * tomar� en cuenta, en caso contrario, se devolver� el fichero real que se
+	 * desea tratar (puede ser distinto al fichero de entrada).
+	 *
+	 * @param file
+	 * @return
+	 */
+
+	public File post(File file);
+
+	/**
+	 * Metodo que se invocar� al aceptar los ficheros. Se ejecuta despu�s del
+	 * pre() y el post(), es cuando se le da definitivamente a a�adir los
+	 * ficheros.
+	 * @param file
+	 * @param mapControl
+	 * @param driverName
+	 * @return
+	 */
+	public Envelope createLayer(File file, MapControl mapControl,
+			FileFilter driverName, IProjection proj);
+
+	/**
+	 * Devolver� todos los FileFilter que puede manejar dicha extensi�n
+	 * @return
+	 */
+	public List<FileFilter> getFileFilter();
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/IFileOpen.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/FileOpenVRTException.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/FileOpenVRTException.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/FileOpenVRTException.java	(revision 8183)
@@ -0,0 +1,30 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.raster.gui.wizard;
+
+public class FileOpenVRTException extends Exception {
+	private static final long serialVersionUID = -5497974020225978205L;
+
+	public FileOpenVRTException(String s) {
+		super(s);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/FileOpenVRTException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/DriverFileFilter.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/DriverFileFilter.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/DriverFileFilter.java	(revision 8183)
@@ -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.tools.app.basic.raster.gui.wizard;
+
+import java.io.File;
+import java.io.FileInputStream;
+
+import javax.swing.filechooser.FileFilter;
+
+import org.gvsig.raster.fmap.layers.DefaultFLyrRaster;
+/**
+ * Clase para indicar los ficheros que se ver�n en el JFileChooser.
+ * 
+ * @version 04/09/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class DriverFileFilter extends FileFilter {
+	/*
+	 * (non-Javadoc)
+	 * @see javax.swing.filechooser.FileFilter#accept(java.io.File)
+	 */
+	public boolean accept(File f) {
+		if (f.isDirectory())
+			return true;
+
+		if (f.getParentFile().getName().equals("cellhd")) {
+			if (f.getName().endsWith(".rmf") || f.getName().endsWith(".rmf~"))
+				return false;
+			return true;
+		}
+
+		// Comprobamos que no sea un rmf propio, osea, que contenga xml
+		if (f.getName().toLowerCase().endsWith(".rmf")) {
+			FileInputStream reader = null;
+			try {
+				reader = new FileInputStream(f);
+				String xml = "";
+				for (int i = 0; i < 6; i++)
+					xml += (char) reader.read();
+				if (xml.equals("<?xml "))
+					return false;
+			} catch (Exception e) {
+			} finally {
+				try {
+					reader.close();
+				} catch (Exception e) {}
+			}
+		}
+
+		return DefaultFLyrRaster.isFileSupported(f);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see javax.swing.filechooser.FileFilter#getDescription()
+	 */
+	public String getDescription() {
+		return "gvSIG Raster Driver";
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/DriverFileFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/FileOpenWizard.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/FileOpenWizard.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/FileOpenWizard.java	(revision 8183)
@@ -0,0 +1,470 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.raster.gui.wizard;
+
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.prefs.Preferences;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultListModel;
+import javax.swing.JPanel;
+import javax.swing.border.TitledBorder;
+import javax.swing.filechooser.FileFilter;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.addlayer.AddLayerDialog;
+import org.gvsig.app.gui.WizardPanel;
+import org.gvsig.app.gui.panels.CRSSelectPanel;
+import org.gvsig.app.project.documents.gui.ListManagerSkin;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.app.project.documents.view.gui.FPanelLocConfig;
+import org.gvsig.fmap.crs.CRSFactory;
+import org.gvsig.fmap.dal.DataStoreParameters;
+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.layers.FLayer;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.gui.beans.swing.JFileChooser;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+import org.gvsig.tools.extensionpoint.ExtensionPoint.Extension;
+import org.gvsig.utils.listManager.ListManagerListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Pesta�a donde estara la apertura de ficheros
+ *
+ * @version 04/09/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class FileOpenWizard extends WizardPanel implements ListManagerListener {
+	private static final GeometryManager 	geomManager 				= GeometryLocator.getGeometryManager();
+	private static final Logger 			logger        				= LoggerFactory.getLogger(FileOpenWizard.class);
+	private static final String 			OPEN_LAYER_FILE_CHOOSER_ID 	= "OPEN_LAYER_FILE_CHOOSER_ID";
+	private static final long 				serialVersionUID 			= 335310147513197564L;
+	private static String    				lastPath        			= null;
+	private JPanel            				jPanel2         			= null;
+	private JFileChooser      				fileChooser    				= null;
+	private CRSSelectPanel    				jPanelProj      			= null;
+	private ListManagerSkin  				listManagerSkin 			= null;
+	private boolean           				projection      			= false;
+	static private FileFilter 				lastFileFilter  			= null;
+	private TitledBorder      				titledBorder    			= null;
+
+	/**
+	 * Lista de manejadores de ficheros (extensiones)
+	 */
+	private ArrayList<IFileOpen> listFileOpen = new ArrayList<IFileOpen>();
+
+	/**
+	 * Construye un FileOpenWizard usando la extension por defecto
+	 * 'FileExtendingOpenDialog'
+	 */
+	public FileOpenWizard() {
+		this("FileExtendingOpenDialog");
+	}
+
+	/**
+	 * Construye un FileOpenWizard usando el punto de extension pasado por
+	 * parametro
+	 *
+	 * @param nameExtension
+	 *
+	 */
+	public FileOpenWizard(String nameExtension) {
+		this(nameExtension, true);
+	}
+	/**
+	 * Construye un FileOpenWizard usando el punto de extension pasado por
+	 * parametro
+	 * @param nameExtension
+	 */
+	public FileOpenWizard(String nameExtension, boolean proj) {
+		ExtensionPointManager epManager = ToolsLocator
+				.getExtensionPointManager();
+		if (!epManager.has(nameExtension))
+			return;
+
+		Iterator iterator = epManager.get(nameExtension).iterator();
+		Object obj = null;
+		while (iterator.hasNext()) {
+			try {
+				obj = ((Extension) iterator.next()).create();
+			} catch (Exception e) {
+				e.printStackTrace(); //FIXME Excepcion
+				continue;
+			}
+			if (obj instanceof IFileOpen)
+				listFileOpen.add((IFileOpen) obj);
+		}
+		init(null, proj);
+	}
+
+	/**
+	 * Creates a new FileOpenWizard object.
+	 * @param driverClasses
+	 * @param proj
+	 */
+	public FileOpenWizard(IFileOpen[] driverClasses, boolean proj) {
+		init(driverClasses, proj);
+	}
+
+	/**
+	 * Creates a new FileOpenWizard object.
+	 * @param driverClasses
+	 */
+	public FileOpenWizard(IFileOpen[] driverClasses) {
+		init(driverClasses, true);
+	}
+
+	/**
+	 * Creates a new FileOpenWizard object.
+	 * @param driverClasses
+	 * @param proj
+	 * @param title
+	 */
+	public FileOpenWizard(IFileOpen[] driverClasses, boolean proj, String title) {
+		setTitle(title);
+		init(driverClasses, proj);
+	}
+
+	/**
+	 * @param driverClasses2
+	 * @param b
+	 */
+	private void init(IFileOpen[] driverClasses, boolean projection) {
+		this.projection = projection;
+
+		if (driverClasses != null)
+			for (int i = 0; i < driverClasses.length; i++)
+				listFileOpen.add(driverClasses[i]);
+
+		if (lastPath == null) {
+			Preferences prefs = Preferences.userRoot().node("gvsig.foldering");
+			lastPath = prefs.get("DataFolder", null);
+		}
+
+		initialize();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.cit.gvsig.gui.WizardPanel#initWizard()
+	 */
+	public void initWizard() {
+		setTabName(PluginServices.getText(this, "Fichero_Raster"));
+		init(null, true);
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		this.setSize(514, 280);
+		this.setLayout(null);
+		this.add(getJPanel2(), null);
+	}
+
+	public File[] getFiles() {
+		MyFile[] files = (MyFile[]) getListManagerSkin().getListManager().getListModel().getObjects().toArray(new MyFile[0]);
+		File[] ret = new File[files.length];
+		int pos = files.length - 1;
+		for (int i = 0; i < files.length; i++) {
+			ret[pos] = files[i].getFile();
+			pos--;
+		}
+		return ret;
+	}
+
+	public MyFile[] getMyFiles() {
+		return (MyFile[]) getListManagerSkin().getListManager().getListModel().getObjects().toArray(new MyFile[0]);
+	}
+
+	/**
+	 * This method initializes jPanel2
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getJPanel2() {
+		if (jPanel2 == null) {
+			jPanel2 = new JPanel();
+			jPanel2.setLayout(null);
+			jPanel2.setBorder(getTitledBorder());
+			jPanel2.setPreferredSize(new Dimension(380, 200));
+			jPanel2.setBounds(2, 2, 506, 472);
+			if (projection)
+				jPanel2.add(getJPanelProj(), null);
+			jPanel2.add(getListManagerSkin(), null);
+		}
+
+		return jPanel2;
+	}
+
+	private TitledBorder getTitledBorder() {
+		if (titledBorder == null) {
+			titledBorder = BorderFactory.createTitledBorder(null, PluginServices.getText(this, "Seleccionar_fichero"), TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null);
+			titledBorder.setTitle(PluginServices.getText(this, PluginServices.getText(this, "Capas")));
+		}
+		return titledBorder;
+	}
+
+	public String[] getDriverNames() {
+		MyFile[] files = (MyFile[]) getListManagerSkin().getListManager().getListModel().getObjects().toArray(new MyFile[0]);
+		String[] ret = new String[files.length];
+		int pos = files.length - 1;
+
+		for (int i = 0; i < files.length; i++) {
+			ret[pos] = files[i].getFilter().getDescription();
+			pos--;
+		}
+		return ret;
+	}
+
+	/**
+	 * This method initializes jPanel
+	 * @return javax.swing.JPanel
+	 */
+	private CRSSelectPanel getJPanelProj() {
+		if (jPanelProj == null) {
+			IProjection proj = CRSFactory.getCRS("EPSG:23030");
+			if (PluginServices.getMainFrame() != null)
+				proj = AddLayerDialog.getLastProjection();
+
+			jPanelProj = CRSSelectPanel.getPanel(proj);
+			jPanelProj.setTransPanelActive(true);
+			jPanelProj.setBounds(11, 400, 448, 35);
+			jPanelProj.setPreferredSize(new Dimension(448, 35));
+			jPanelProj.addActionListener(new ActionListener() {
+				public void actionPerformed(ActionEvent e) {
+					if (jPanelProj.isOkPressed())
+						AddLayerDialog.setLastProjection(jPanelProj.getCurProj());
+				}
+			});
+
+		}
+		return jPanelProj;
+	}
+
+
+	/**
+	 * This method initializes listManagerDemoSkin
+	 * @return ListManagerSkin
+	 */
+	private ListManagerSkin getListManagerSkin() {
+		if (listManagerSkin == null) {
+			listManagerSkin = new ListManagerSkin(false);
+			listManagerSkin.setBounds(11, 21, 491, 363);
+			listManagerSkin.getListManager().setListener(this);
+		}
+		return listManagerSkin;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.utiles.listManager.ListManagerListener#addObjects()
+	 */
+	public Object[] addObjects() {
+		this.callStateChanged(true);
+		fileChooser = new JFileChooser(OPEN_LAYER_FILE_CHOOSER_ID, lastPath);
+		fileChooser.setMultiSelectionEnabled(true);
+		fileChooser.setAcceptAllFileFilterUsed(false);
+
+		boolean finded = false;
+		FileFilter auxFilter=null;
+		for (int i = 0; i < listFileOpen.size(); i++) {
+			IFileOpen fileOpen = listFileOpen.get(i);
+			fileOpen.pre();
+			List<FileFilter> aux = fileOpen.getFileFilter();
+
+			for (int j = 0; j < aux.size(); j++) {
+				FileFilter fileFilter = aux.get(j);
+				fileChooser.addChoosableFileFilter(fileFilter);
+				if (lastFileFilter!=null && lastFileFilter.getDescription().equals(fileFilter.getDescription())){
+					auxFilter=fileFilter;
+					finded = true;
+				}
+			}
+		}
+		if (finded && (lastFileFilter != null))
+			fileChooser.setFileFilter(auxFilter);
+
+		int result = fileChooser.showOpenDialog(this);
+
+		File[] newFiles = null;
+		ArrayList<MyFile> toAdd = new ArrayList<MyFile>();
+		if (result == JFileChooser.APPROVE_OPTION) {
+			lastPath = fileChooser.getCurrentDirectory().getAbsolutePath();
+			lastFileFilter = fileChooser.getFileFilter();
+			newFiles = fileChooser.getSelectedFiles();
+
+			IFileOpen lastFileOpen = null;
+			for (int i = 0; i < listFileOpen.size(); i++) {
+				IFileOpen fileOpen = listFileOpen.get(i);
+				List<FileFilter> aux = fileOpen.getFileFilter();
+				for (int j = 0; j < aux.size(); j++)
+					if (fileChooser.getFileFilter() == aux.get(j)) {
+						for (int iFile=0; iFile<newFiles.length; iFile++)
+							newFiles[iFile] = fileOpen.post(newFiles[iFile]);
+						lastFileOpen = fileOpen;
+						break;
+					}
+			}
+
+			for (int ind = 0; ind < newFiles.length; ind++) {
+				if (newFiles[ind] == null)
+					break;
+				toAdd.add(new MyFile(newFiles[ind], (fileChooser
+						.getFileFilter()), lastFileOpen));
+			}
+
+			return toAdd.toArray();
+		} else
+			return new Object[0];
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.cit.gvsig.gui.WizardPanel#execute()
+	 */
+	public void execute() {
+		if (getFiles() == null)
+			return;
+
+		MapControl mapControl = null;
+		IWindow[] w = PluginServices.getMDIManager().getAllWindows();
+
+		// Si se est� cargando la capa en el localizador se obtiene el mapcontrol de este
+		for (int i = 0; i < w.length; i++)
+			if (w[i] instanceof FPanelLocConfig) {
+				mapControl = ((FPanelLocConfig) w[i]).getMapCtrl();
+				DefaultListModel lstModel = (DefaultListModel) ((FPanelLocConfig) w[i]).getJList().getModel();
+				lstModel.clear();
+				for (int k = 0; k < getFiles().length; k++)
+					lstModel.addElement(getFiles()[k].getName());
+				for (int j = mapControl.getMapContext().getLayers().getLayersCount() - 1; j >= 0; j--) {
+					FLayer lyr = mapControl.getMapContext().getLayers().getLayer(j);
+					lstModel.addElement(lyr.getName());
+				}
+			}
+
+		// Obtiene la primera vista activa
+		if (mapControl == null)
+			for (int i = 0; i < w.length; i++) {
+				IWindow activeWindow = PluginServices.getMDIManager().getActiveWindow();
+				if (w[i] instanceof AbstractViewPanel && w[i].equals(activeWindow))
+					mapControl = ((AbstractViewPanel) w[i]).getMapControl();
+			}
+		// Si no hay ninguna activa obtiene la primera vista aunque no est� activa
+		if (mapControl == null)
+			for (int i = 0; i < w.length; i++)
+				if (w[i] instanceof AbstractViewPanel)
+					mapControl = ((AbstractViewPanel) w[i]).getMapControl();
+
+		//		if (mapControl == null) {
+		//			return;
+		//		}
+
+		Envelope[] rects = new Envelope[getFiles().length];
+		boolean first = false;
+
+		for (int i = getMyFiles().length - 1; i >= 0; i--) {
+			if (mapControl != null
+					&& mapControl.getMapContext().getViewPort().getExtent() == null)
+				first = true;
+			rects[i] = (getMyFiles()[i]).createLayer(mapControl);
+		}
+
+		if (first && (rects.length > 1)) {
+			Envelope rect;
+			try {
+				rect = geomManager.createEnvelope(
+						rects[0].getMinimum(0), rects[0].getMinimum(1), rects[0]
+								.getMaximum(0), rects[0].getMaximum(1),
+								SUBTYPES.GEOM2D);
+//				rect.setRect(rects[0]);
+				for (int i = 0; i < rects.length; i++)
+					if (rects[i] != null)
+						rect.add(rects[i]);
+				if (mapControl != null)
+					mapControl.getMapContext().getViewPort().setEnvelope(rect);
+			} catch (CreateEnvelopeException e) {
+				logger.error("Error creating the envelope", e);
+			}
+		}
+		if (mapControl != null)
+			mapControl.getMapContext().endAtomicEvent();// FIXME ??? y el begin
+	}
+
+	public void setTitle(String title) {
+		getTitledBorder().setTitle(title);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.utiles.listManager.ListManagerListener#getProperties(java.lang.Object)
+	 */
+	public Object getProperties(Object selected) {
+		return null;
+	}
+
+
+	/**
+	 * Obtiene la �ltima ruta seleccionada al a�adir ficheros.
+	 * @return Ruta del �ltimo fichero seleccionado
+	 */
+	public static String getLastPath() {
+		return lastPath;
+	}
+
+	/**
+	 * Asigna la �ltima ruta en una selecci�n de ficheros de disco. Es necesario
+	 * poder hacer esta asignaci�n desde fuera de FileOpenWizard ya que este path debe
+	 * ser com�n a toda la aplicaci�n. Hay otros puntos donde se seleccionan ficheros
+	 * de disco.
+	 * @param lastPath Ruta del �ltimo fichero de disco seleccionado
+	 */
+	public static void setLastPath(String path) {
+		lastPath = path;
+	}
+
+	public DataStoreParameters[] getParameters() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void close() {
+		// Nothing to do
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/FileOpenWizard.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/PrepareDataStoreParametersRaw.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/PrepareDataStoreParametersRaw.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/PrepareDataStoreParametersRaw.java	(revision 8183)
@@ -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.tools.app.basic.raster.gui.wizard;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.Map;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.app.prepareAction.PrepareContext;
+import org.gvsig.app.prepareAction.PrepareDataStoreParameters;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterFileStoreParameters;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+
+/**
+ * @author jmvivo
+ *
+ */
+public class PrepareDataStoreParametersRaw implements
+		PrepareDataStoreParameters {
+
+	public DataStoreParameters prepare(DataStoreParameters storeParamters,
+			PrepareContext context) {
+		if (!(storeParamters instanceof RasterFileStoreParameters))
+			return storeParamters;
+		RasterFileStoreParameters rasterParams = (RasterFileStoreParameters) storeParamters;
+		File file = rasterParams.getFile();
+		if (file == null)
+			return null;
+		
+		if (RasterLocator.getManager().getFileUtils().getExtensionFromFileName(file.getAbsolutePath()).equals("vrt")) {
+			try {
+				checkFileVRT(file);
+			} catch (FileOpenVRTException e) {
+				RasterSwingLibrary.messageBoxError(PluginServices.getText(this, "error_abrir_fichero") + " " + file.getName() + "\n\n" + PluginServices.getText(this, "informacion_adicional") + ":\n\n  " + e.getMessage(), this, e);
+				return null;
+			}
+		}
+
+		rasterParams.setFile(file);
+		return rasterParams;
+	}
+
+	/**
+	 * Comprueba si un fichero VRT esta en correcto estado, en caso contrario
+	 * lanza una excepcion indicando el tipo de error en la apertura.
+	 *
+	 * @param file
+	 * @throws FileOpenVRTException
+	 */
+	private void checkFileVRT(File file) throws FileOpenVRTException {
+		KXmlParser parser = new KXmlParser();
+		boolean end = false;
+		int currentTag;
+
+		FileReader fileReader = null;
+		try {
+			fileReader = new FileReader(file);
+			parser.setInput(fileReader);
+
+			currentTag = parser.nextTag();
+
+			parser.require(XmlPullParser.START_TAG, null, "VRTDataset");
+
+			while (!end) {
+				switch(currentTag) {
+				case KXmlParser.START_TAG:
+					if (compareName(parser, "VRTRasterBand")) {
+						checkSubTreeVRTRasterBand(parser, file);
+					} 
+					break;
+				case KXmlParser.END_TAG:
+					if (compareName(parser, "VRTRasterBand"))
+						end = true;
+					break;
+				case KXmlParser.TEXT:					
+					break;
+				}
+				if (!end)
+					currentTag = parser.next();
+			}
+
+		} catch (XmlPullParserException e) {
+			throw new FileOpenVRTException(PluginServices.getText(this,
+					"el_fichero")
+					+ " "
+					+ file.getName().toString()
+					+ " "
+					+ Messages.getText("esta_formato_desconocido"));
+		} catch (IOException e) {
+			throw new FileOpenVRTException(PluginServices.getText(this,
+					"no_puede_abrir_fichero")
+					+ " " + file.getName().toString());
+		} finally {
+			if (fileReader != null)
+				try {
+					fileReader.close();
+				} catch (IOException e) {
+				}
+		}
+	}
+	
+	private void checkSubTreeVRTRasterBand(KXmlParser parser, File file) throws XmlPullParserException, IOException, FileOpenVRTException {
+		int currentTag;
+		boolean end = false;
+
+		currentTag = parser.nextTag();
+
+		while (!end) {
+			switch(currentTag) {
+			case KXmlParser.START_TAG:
+				if (compareName(parser, "SourceFilename")) {
+					checkTagSourceFileName(parser, file);
+					end = true;
+				} else if(compareName(parser, "SimpleSource") || 
+						compareName(parser, "ComplexSource") || 
+						compareName(parser, "AveragedSource")) {
+					checkSubTreeSource(parser, file);
+				}
+				break;
+			case KXmlParser.END_TAG:
+				if (compareName(parser, "SourceFilename") ||
+					compareName(parser, "SimpleSource") || 
+					compareName(parser, "ComplexSource") || 
+					compareName(parser, "AveragedSource"))
+					end = true;
+				break;
+			case KXmlParser.TEXT:					
+				break;
+			}
+			if (!end)
+				currentTag = parser.next();
+		}
+	}
+	
+	private void checkSubTreeSource(KXmlParser parser, File file) throws XmlPullParserException, IOException, FileOpenVRTException {
+		int currentTag;
+		boolean end = false;
+
+		currentTag = parser.nextTag();
+
+		while (!end) {
+			switch(currentTag) {
+			case KXmlParser.START_TAG:
+				if (compareName(parser, "SourceFilename")) {
+					checkTagSourceFileName(parser, file);
+				} 
+			case KXmlParser.END_TAG:
+				if (compareName(parser, "SourceFilename"))
+					end = true;
+				break;
+			case KXmlParser.TEXT:					
+				break;
+			}
+			if (!end)
+				currentTag = parser.next();
+		}
+	}
+	
+	private void checkTagSourceFileName(KXmlParser parser, File file) throws XmlPullParserException, IOException, FileOpenVRTException {
+		for (int i = 0; i < parser.getAttributeCount(); i++) {
+			if (parser.getAttributeName(i).equals("relativetoVRT") && 
+				parser.getAttributeValue(i).equals("1")) {
+				String nameFile = parser.nextText();
+				nameFile = file.getParent() + File.separator + nameFile;
+				File tryFile = new File(nameFile);
+				if (!tryFile.exists())
+					throw new FileOpenVRTException(Messages.getText("no_existe_fichero") + " " + nameFile);
+			}
+		}
+	}
+
+	/**
+     * Compares the next name in the selected parser with the string passed
+     * by value.
+     * @param parser
+     * @param name
+     * @return
+     */
+    public boolean compareName(KXmlParser parser, String name) {
+    	String s = parser.getName();
+    	if(s.compareTo(name) == 0 || s.compareTo("ows:" + name) == 0)
+    		return true;
+    	return false;
+    }
+
+	public String getDescription() {
+		return "Prepare Raster Raw Stores";
+	}
+
+	public String getName() {
+		return "PrepareRaw";
+	}
+
+	public Object create() {
+		return this;
+	}
+
+	public Object create(Object[] args) {
+		return this;
+	}
+
+	@SuppressWarnings("rawtypes")
+	public Object create(Map args) {
+		return this;
+	}
+
+	public void post(DataStoreParameters storeParameters, PrepareContext context) {
+		
+	}
+
+	public void pre(DataStoreParameters storeParameters, PrepareContext context) {
+		
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/PrepareDataStoreParametersRaw.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/AbstractFileOpen.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/AbstractFileOpen.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/AbstractFileOpen.java	(revision 8183)
@@ -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.tools.app.basic.raster.gui.wizard;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.filechooser.FileFilter;
+/**
+ * Clase abstracta que deben implementar todas aquellas extensiones que quieran
+ * aparecer en un punto comun del cuadro de dialogo de apertura de ficheros.
+ *
+ * @author BorSanZa - Borja Sanchez Zamorano 
+ */
+public abstract class AbstractFileOpen implements IFileOpen {
+	private ArrayList<FileFilter> arrayFileFilter = null;
+
+	public void pre() {
+	}
+
+	public File post(File file) {
+		return file;
+	}
+
+	public final List<FileFilter> getFileFilter() {
+		if (arrayFileFilter == null) {
+			arrayFileFilter = new ArrayList<FileFilter>();
+		}
+		return arrayFileFilter;
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/AbstractFileOpen.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/MyFile.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/MyFile.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/MyFile.java	(revision 8183)
@@ -0,0 +1,72 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.raster.gui.wizard;
+
+import java.io.File;
+
+import javax.swing.filechooser.FileFilter;
+
+import org.gvsig.app.addlayer.AddLayerDialog;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontrol.MapControl;
+
+
+/**
+ * @version 05/09/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+	public class MyFile {
+		private File      f;
+		private FileFilter filter;
+		private IFileOpen fileOpen;
+
+
+	public MyFile(File f, FileFilter fileFilter, IFileOpen fileOpen) {
+			this.f = f;
+			this.filter = fileFilter;
+			this.fileOpen = fileOpen;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * @see java.lang.Object#toString()
+		 */
+		public String toString() {
+			return f.getName();
+		}
+
+		public FileFilter getFilter() {
+			return filter;
+		}
+
+		public IFileOpen getFileOpen() {
+			return fileOpen;
+		}
+
+		public Envelope createLayer(MapControl mapControl) {
+			return fileOpen.createLayer(f, mapControl, filter, AddLayerDialog
+				.getLastProjection());
+		}
+		public File getFile(){
+			return f;
+		}
+	}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/MyFile.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/PrepareDataStoreParametersVTR.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/PrepareDataStoreParametersVTR.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/PrepareDataStoreParametersVTR.java	(revision 8183)
@@ -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.tools.app.basic.raster.gui.wizard;
+
+import java.io.File;
+import java.util.Map;
+
+import org.gvsig.app.prepareAction.PrepareContext;
+import org.gvsig.app.prepareAction.PrepareDataStoreParameters;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterFileStoreParameters;
+import org.gvsig.raster.tools.app.basic.tool.raw.ui.main.OpenRawFileDefaultView;
+
+/**
+ * @author jmvivo
+ *
+ */
+public class PrepareDataStoreParametersVTR implements
+		PrepareDataStoreParameters {
+
+	public DataStoreParameters prepare(DataStoreParameters storeParamters,
+			PrepareContext context) {
+		if (!(storeParamters instanceof RasterFileStoreParameters))
+			return storeParamters;
+		RasterFileStoreParameters rasterParams = (RasterFileStoreParameters) storeParamters;
+		File file = rasterParams.getFile();
+		if (RasterLocator.getManager().getFileUtils().getExtensionFromFileName(file.getAbsolutePath()).equals("raw")) {
+			OpenRawFileDefaultView view = new OpenRawFileDefaultView(file.getAbsolutePath());
+ 			file = view.getImageFile();
+		}
+		if (file == null)
+			return null;
+		rasterParams.setFile(file);
+		return rasterParams;
+	}
+
+	public String getDescription() {
+		return "Prepare Raster VTR parameters";
+	}
+
+	public String getName() {
+		return "PrepareVTR";
+	}
+
+	public Object create() {
+		return this;
+	}
+
+	public Object create(Object[] args) {
+		return this;
+	}
+
+	@SuppressWarnings("unchecked")
+	public Object create(Map args) {
+		return this;
+	}
+
+	public void post(DataStoreParameters storeParameters, PrepareContext context) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void pre(DataStoreParameters storeParameters, PrepareContext context) {
+		// TODO Auto-generated method stub
+		
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard/PrepareDataStoreParametersVTR.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui/wizard
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/gui
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/bean/previewbase/RasterDataSourcePreview.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/bean/previewbase/RasterDataSourcePreview.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/bean/previewbase/RasterDataSourcePreview.java	(revision 8183)
@@ -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.tools.app.basic.raster.bean.previewbase;
+
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.exception.ReadException;
+import org.gvsig.fmap.geom.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.gui.beans.imagenavigator.ImageUnavailableException;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.preview.DataSourcePreview;
+import org.gvsig.tools.task.Cancellable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Source for a preview using a raster layer 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+@SuppressWarnings("deprecation")
+public class RasterDataSourcePreview implements DataSourcePreview {
+	private FLyrRaster              lyr               = null;
+	private IProjection             viewProjection    = null;
+	private static GeometryManager  geomManager       = GeometryLocator.getGeometryManager();
+	private static final Logger     logger            = LoggerFactory.getLogger(RasterDataSourcePreview.class);
+	
+	public RasterDataSourcePreview(FLyrRaster lyr, IProjection proj) {
+		this.lyr = lyr;
+		this.viewProjection = proj;
+	}
+	
+	public void closePreviewLayer() {
+		if (lyr != null) {
+			lyr.setRemoveRasterFlag(true);
+			lyr.removeLayerListener(null);
+		}
+	}
+
+	public Rectangle2D getBBoxRectangle() {
+		Extent e = lyr.getFullRasterExtent();
+		return e.toRectangle2D();
+	}
+
+	public double getCellSize() {
+		return lyr.getDataStore().getCellSize();
+	}
+	
+	public DataSourcePreview cloneDataSourcePreview() {
+		if(lyr != null) {
+			try {
+				IProjection viewProj = null;
+				if(lyr.getMapContext() != null)
+					viewProj = lyr.getMapContext().getProjection();
+				return new RasterDataSourcePreview((FLyrRaster)lyr.cloneLayer(), viewProj);
+			} catch (Exception e) {
+			}
+		}
+		return null;	
+	}
+
+	public void popStatus() {
+		if (lyr != null)
+			lyr.getRender().getFilterList().popStatus();
+	}
+
+	public void pushStatus() {
+		if (lyr != null)
+			lyr.getRender().getFilterList().pushStatus();
+	}
+	
+	public void draw(BufferedImage image, 
+			Graphics2D g, 
+			double[] coords, 
+			int w, 
+			int h, 
+			Cancellable cancel, 
+			double scale) throws ImageUnavailableException {
+		try {
+			// Inicializo el ViewPort
+			ViewPort vp = new ViewPort(viewProjection);
+			Envelope env;
+			try {
+				env = geomManager.createEnvelope(coords[0], coords[3], coords[2], coords[1], SUBTYPES.GEOM2D);
+				vp.setEnvelope(env);
+			} catch (CreateEnvelopeException e3) {
+				logger.error("Error drawing the image", e3);
+			}	
+			vp.setImageSize(new Dimension(w, h));
+			
+			if (lyr != null) {
+				lyr.setLayerInitialized(true);
+				lyr.draw(image, g, vp, cancel, scale);
+			}
+		} catch (ReadException e) {
+			throw new ImageUnavailableException("Error drawing raster");
+		}
+	}
+	
+	public Object getSource() {
+		return lyr;
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/bean/previewbase/RasterDataSourcePreview.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/bean/previewbase/ParamStruct.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/bean/previewbase/ParamStruct.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/bean/previewbase/ParamStruct.java	(revision 8183)
@@ -0,0 +1,117 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.app.basic.raster.bean.previewbase;
+
+import java.util.List;
+
+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;
+
+/**
+ * Estructura para los par�metros de PreviewFiltering. Contiene el nombre del 
+ * filtro, el par�metro y la clase de este.
+ * 
+ */
+public class ParamStruct {
+	String filterName   = null;
+	Params filterParam  = null;
+	Class<?>  filterClass  = null;
+	
+	/**
+	 * @return the filterName
+	 */
+	public String getFilterName() {
+		return filterName;
+	}
+
+	/**
+	 * @param filterName the filterName to set
+	 */
+	public void setFilterName(String filterName) {
+		this.filterName = filterName;
+	}
+
+	/**
+	 * @return the filterParam
+	 */
+	public Params getFilterParam() {
+		return filterParam;
+	}
+
+	/**
+	 * @param filterParam the filterParam to set
+	 */
+	public void setFilterParam(Params filterParam) {
+		this.filterParam = filterParam;
+	}
+
+	/**
+	 * @return the filterClass
+	 */
+	public Class<?> getFilterClass() {
+		return filterClass;
+	}
+
+	/**
+	 * @param filterClass the filterClass to set
+	 */
+	public void setFilterClass(Class<?> filterClass) {
+		this.filterClass = filterClass;
+	}
+	
+	/**
+	 * 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, List<ParamStruct> listFilterUsed) throws FilterTypeException, FilterManagerException {
+		filterList.clear();
+
+		for (int i = 0; i < listFilterUsed.size(); i++) {
+			ParamStruct aux = (ParamStruct) listFilterUsed.get(i);
+			RasterFilterListManager filterManager = filterList.getManagerByFilterClass(aux.getFilterClass());
+			filterManager.addFilter(aux.getFilterClass(), aux.getFilterParam());
+		}
+
+		filterList.resetPercent();
+	}
+	
+	public ParamStruct clone() {
+		ParamStruct p = new ParamStruct();
+		p.filterName = this.filterName;
+		p.filterClass = this.filterClass;
+		try {
+			p.filterParam = (Params)filterParam.clone();
+			return p;
+		} catch (CloneNotSupportedException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		return null;
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/bean/previewbase/ParamStruct.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/bean/previewbase
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/bean/stretchselector/StretchSelectorPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/bean/stretchselector/StretchSelectorPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/bean/stretchselector/StretchSelectorPanel.java	(revision 8183)
@@ -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.tools.app.basic.raster.bean.stretchselector;
+
+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.util.EventObject;
+import java.util.Observable;
+import java.util.Observer;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.gui.beans.datainput.DataInputContainerListener;
+import org.gvsig.gui.beans.datainput.DataInputField;
+import org.gvsig.raster.util.BasePanel;
+import org.gvsig.raster.util.GenericBasePanel;
+
+
+/**
+ * Clase que contiene el panel con los elementos para a�adir una serie
+ * de intervalos. La selecci�n de intervalos puede ser seleccionando el n�mero de
+ * estos para una distancia definida entre un m�ximo y un m�nimo. En este caso se
+ * calcular� autom�ticamente la distancia entre los tramos. Tambi�n puede ser calculada
+ * a partir de una distancia dada. En este caso calcular� autom�ticamenet el n�mero de 
+ * tramos para la longitud total.
+ * 
+ * El controlador est� metido dentro del mismo panel por lo que tendr� tambi�n una referencia
+ * al modelo de datos.
+ * 
+ * 06/08/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class StretchSelectorPanel extends BasePanel implements ActionListener, DataInputContainerListener, Observer {
+	private static final long    serialVersionUID     = 1638303379491319120L;
+
+	private boolean              selectedCount        = false;
+	private ButtonGroup          buttonGroup1         = null;
+
+	private JLabel               jLabelMinim          = null;
+	private JLabel               jLabelMaxim          = null;
+	private BasePanel            jPanel1              = null;
+	private JRadioButton         jRadioIntervalSize   = null;
+	private JRadioButton         jRadioIntervalNumber = null;
+
+	private DataInputField       jTextMinim           = null;
+	private DataInputField       jTextMaxim           = null;
+	private DataInputField       jTextValue           = null;
+	private StretchSelectorData  data                 = null;
+		
+	/**
+	 * Constructor. Llama al inicializador de elementos gr�ficos
+	 */
+	public StretchSelectorPanel() {
+		init();
+		translate();
+	}
+	
+	/**
+	 * Constructor. Llama al inicializador de elementos gr�ficos
+	 */
+	public StretchSelectorPanel(StretchSelectorData data) {
+		this.data = data;
+		this.data.addObserver(this);
+		init();
+		translate();
+	}
+	
+	protected void translate() {
+		jLabelMinim.setText(getText(this, "minimo") + ":");
+		jLabelMaxim.setText(getText(this, "maximo") + ":");
+		getIntervalSize().setText(getText(this, "tamano_intervalo"));
+		getIntervalNumber().setText(getText(this, "n_intervalos"));
+	}
+	
+	/**
+	 * Inicializa los elementos gr�ficos
+	 */
+	protected void init() {
+		GridBagConstraints gridBagConstraints;
+
+		setLayout(new GridBagLayout());
+		jPanel1 = new GenericBasePanel();
+		jPanel1.setLayout(new GridBagLayout());
+		jPanel1.setBorder(BorderFactory.createTitledBorder(""));
+
+		int y = 1;
+
+	    jLabelMinim = new JLabel();
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = y;
+		gridBagConstraints.anchor = GridBagConstraints.EAST;
+		gridBagConstraints.insets = new Insets(2, 5, 2, 2);
+		add(jLabelMinim, gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = y;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.insets = new Insets(2, 2, 2, 5);
+		add(getMinimText(), gridBagConstraints);
+
+		y++;
+	    jLabelMaxim = new JLabel();
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = y;
+		gridBagConstraints.anchor = GridBagConstraints.EAST;
+		gridBagConstraints.insets = new Insets(2, 5, 2, 2);
+		add(jLabelMaxim, gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = y;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.insets = new Insets(2, 2, 2, 5);
+		add(getMaximunText(), gridBagConstraints);
+
+		y++;
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = y;
+		gridBagConstraints.gridwidth = 2;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(2, 5, 0, 5);
+		add(jPanel1, gridBagConstraints);
+
+		// Panel vacio
+		y++;
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = y;
+		gridBagConstraints.gridwidth = 2;
+		gridBagConstraints.fill = GridBagConstraints.BOTH;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.weighty = 1.0;
+		JPanel panel2 = new JPanel();
+		panel2.setPreferredSize(new Dimension(0, 0));
+		add(panel2, gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(5, 5, 2, 5);
+		jPanel1.add(getIntervalSize(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(2, 5, 2, 5);
+		jPanel1.add(getIntervalNumber(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 2;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.insets = new Insets(2, 5, 5, 5);
+		jPanel1.add(getIntervalInputField(), gridBagConstraints);
+
+		buttonGroup1 = new ButtonGroup();
+		buttonGroup1.add(getIntervalSize());
+		buttonGroup1.add(getIntervalNumber());
+	}
+	
+	/**
+	 * Obtiene el modelo de datos o crea uno si no encuentra ninguno
+	 * @return StretchSelectorData
+	 */
+	public StretchSelectorData getData() {
+		if(data == null) {
+			data = new StretchSelectorData();
+			data.addObserver(this);
+		}
+		return data;
+	}
+	
+	/**
+	 * Asigna el modelo de datos y a�ade el panel como observador
+	 * @param data
+	 */
+	public void setData(StretchSelectorData data) {
+		this.data = data;
+		data.addObserver(this);
+	}
+	
+	/**
+	 * Obtiene el componente con la entrada de texto para el valor del m�nimo
+	 * @return DataInputField
+	 */
+	private DataInputField getIntervalInputField() {
+		if(jTextValue == null) {
+			jTextValue = new DataInputField();
+			jTextValue.setValue(Double.valueOf(255).toString());
+			jTextValue.addValueChangedListener(this);
+		}
+		return jTextValue;			
+	}
+	
+	/**
+	 * Obtiene el componente con la entrada de texto para el valor del m�nimo
+	 * @return DataInputField
+	 */
+	private DataInputField getMinimText() {
+		if(jTextMinim == null) {
+			jTextMinim = new DataInputField();
+			jTextMinim.setValue(Double.valueOf("0").toString());
+			jTextMinim.addValueChangedListener(this);
+		}
+		return jTextMinim;			
+	}
+	
+	/**
+	 * Obtiene el componente con la entrada de texto para el valor del m�nimo
+	 * @return DataInputField
+	 */
+	private DataInputField getMaximunText() {
+		if(jTextMaxim == null) {
+			jTextMaxim = new DataInputField();
+			jTextMaxim.setValue(Double.valueOf("255").toString());
+			jTextMaxim.addValueChangedListener(this);
+		}
+		return jTextMaxim;			
+	}
+	
+	/**
+	 * Obtiene el componente bot�n de selecci�n de creaci�n de tramos por valor del intervalo
+	 * @return JRadioButton
+	 */
+	public JRadioButton getIntervalSize() {
+		if(jRadioIntervalSize == null) {
+			jRadioIntervalSize = new JRadioButton(PluginServices.getText(this, "tamano_intervalo"), true);
+			jRadioIntervalSize.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+			jRadioIntervalSize.setMargin(new Insets(0, 0, 0, 0));
+			jRadioIntervalSize.addActionListener(this);
+		}
+		return jRadioIntervalSize;			
+	}
+	
+	/**
+	 * Obtiene el componente bot�n de selecci�n de creaci�n de tramos por n�mero de intervalos
+	 * @return JRadioButton
+	 */
+	public JRadioButton getIntervalNumber() {
+		if(jRadioIntervalNumber == null) {
+			jRadioIntervalNumber = new JRadioButton(PluginServices.getText(this, "n_intervalos"));
+			jRadioIntervalNumber.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+			jRadioIntervalNumber.setMargin(new Insets(0, 0, 0, 0));
+			jRadioIntervalNumber.addActionListener(this);
+		}
+		return jRadioIntervalNumber;			
+	}
+		
+	/************************************
+	 *           FUNCIONALIDAD
+	 ************************************/
+
+	/**
+	 * Actualiza el modelo de datos
+	 */
+	private void updateData() {
+		if (getIntervalNumber().isSelected()) {
+			if (!selectedCount) {
+				getData().setIntervalSize(getIntervalInputField().getValue());
+				selectedCount = true;
+			}
+		} else {
+			if (selectedCount) {
+				getData().setNumber(getIntervalInputField().getValue());
+				selectedCount = false;
+			}
+		}
+		getData().setMin(getMinimText().getValue());
+		getData().setMax(getMaximunText().getValue());	
+	}
+	
+	public void actionPerformed(ActionEvent e) {
+		if(!isEnableValueChangedEvent())
+			return;
+		updateData();
+	}
+	
+	public void actionValueChanged(EventObject e) {
+		if(!isEnableValueChangedEvent())
+			return;
+		getInterval();
+	}
+
+	/**
+	 * Devuelve un intervalo valido
+	 * @return
+	 */
+	public double getInterval() {
+		getData().setMin(getMinimText().getValue());
+		getData().setMax(getMaximunText().getValue());	
+		if (getIntervalNumber().isSelected())
+			getData().setNumber(getIntervalInputField().getValue());
+		else
+			getData().setIntervalSize(getIntervalInputField().getValue());
+		double value = Double.parseDouble(getIntervalInputField().getValue());
+		double value2 = value;
+		if (getIntervalSize().isSelected()) {
+			if (value > Math.abs(getData().getMaximum() - getData().getMinimum()))
+				value = Math.abs(getData().getMaximum() - getData().getMinimum());
+			if (value <= 0)
+				value = 1;
+		} else {
+			if (value < 1)
+				value = 1;
+		}
+		value = Math.abs(value);
+		
+		if (value != value2) {
+			if (getIntervalNumber().isSelected())
+				getData().setNumber(Double.valueOf(value).toString());
+			else
+				getData().setIntervalSize(Double.valueOf(value).toString());
+		}
+		return value;
+	}
+	
+	/**
+	 * Actualiza los valores de los paneles cuando los datos de ClippingData varian
+	 * @param o 
+	 * @param arg
+	 */
+	public void update(Observable o, Object arg) {
+		if(!(o instanceof StretchSelectorData))
+			return;
+		StretchSelectorData data = (StretchSelectorData)o;
+		
+		setEnableValueChangedEvent(false);
+		if(getIntervalNumber().isSelected())
+			getIntervalInputField().setValue(data.getNumber());
+		if(getIntervalSize().isSelected())
+			getIntervalInputField().setValue(data.getIntervalSize());
+		getMinimText().setValue(data.getMin());
+		getMaximunText().setValue(data.getMax());
+		setEnableValueChangedEvent(true);
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/bean/stretchselector/StretchSelectorPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/bean/stretchselector/StretchSelectorData.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/bean/stretchselector/StretchSelectorData.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/bean/stretchselector/StretchSelectorData.java	(revision 8183)
@@ -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.tools.app.basic.raster.bean.stretchselector;
+
+import java.util.Observable;
+
+/**
+ * Modelo de datos para el componente de selecci�n de lista de tramos.
+ * 
+ * 06/08/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class StretchSelectorData extends Observable {
+	private String         size                 = "255";
+	private String         number               = "1";
+	private String         min                  = "0";
+	private String         max                  = "255";
+	
+	/**
+	 * Devuelve el n�mero de tramos
+	 * @return
+	 */
+	public int getStretchNumber() {
+		try {
+			return (int)Double.parseDouble(number);
+		} catch (NumberFormatException e) {
+			return 0;
+		}
+	}
+	
+	/**
+	 * Devuelve el tama�o de tramo
+	 * @return
+	 */
+	public double getStretchSize() {
+		try {
+			return Double.parseDouble(size);
+		} catch (NumberFormatException e) {
+			return 0;
+		}
+	}
+	
+	/**
+	 * Devuelve el minimo
+	 * @return
+	 */
+	public double getMinimum() {
+		try {
+			return Double.parseDouble(min);
+		} catch (NumberFormatException e) {
+			return 0;
+		}
+	}
+
+	/**
+	 * Devuelve el maximo
+	 * @return
+	 */
+	public double getMaximum() {
+		try {
+			return Double.parseDouble(max);
+		} catch (NumberFormatException e) {
+			return 0;
+		}
+	}
+	
+	/**
+	 * Obtiene el valor m�ximo del intervalo
+	 * @return 
+	 */
+	public String getMax() {
+		return max;
+	}
+
+	/**
+	 * Asigna el valor m�ximo del intervalo
+	 * @param max
+	 */
+	public void setMax(String max) {
+		this.max = max;
+	}
+
+	/**
+	 * Obtiene el valor m�nimo del intervalo
+	 * @return
+	 */
+	public String getMin() {
+		return min;
+	}
+
+	/**
+	 * Asigna el valor m�nimo del intervalo
+	 * @param min
+	 */
+	public void setMin(String min) {
+		this.min = min;
+	}
+
+	/**
+	 * Obtiene el valor del tama�o de intervalo
+	 * @return
+	 */
+	public String getIntervalSize() {
+		return size;
+	}
+	
+	/**
+	 * Asigna el valor de tama�o de intervalo
+	 * @param interval
+	 */
+	public void setIntervalSize(String size) {
+		this.size = size;
+		updateObservers();
+	}
+	
+	/**
+	 * Obtiene el n�mero de intervalos
+	 * @return
+	 */
+	public String getNumber() {
+		return number;
+	}
+	
+	/**
+	 * Asigna el n�mero de intervalos
+	 * @param number
+	 */
+	public void setNumber(String number) {
+		this.number = number;
+		updateObservers();
+	}
+	
+	/**
+	 * Actualiza datos y llama al update de los observadores
+	 */
+	public void updateObservers() {
+		setChanged();
+		notifyObservers();
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/bean/stretchselector/StretchSelectorData.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/bean/stretchselector
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/bean
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java/org
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/java
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_en.properties
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_en.properties	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_en.properties	(revision 8183)
@@ -0,0 +1,603 @@
+#Translations for language [en]
+#Mon Oct 30 09:38:21 CET 2006
+accept=Accept
+apply=Apply
+activar=Activate
+addband_error=Bands haven't been added to selected dataset.
+analysisview=Analysis View
+ancho_alto=Weight X Height
+archivo=File
+bands_panel=Bands
+bands_number=Bands number
+blue=Blue
+gray=Gray
+cumulative=Cumulative
+cumulative_logarithmic=Cumulative logarithmic
+header_Size=Header size
+file_size_in_bytes=File size
+data_type=Data type
+byte_order=Byte order
+type_of_interleaving=Type of interleaving
+output_file_too_big=Output image is too big.
+output_file_too_big_jpeg2000=Output image is too big for JPEG2000 format.
+output_header_format=Header output format
+select_image_geometry=Raster geometry selection
+open_raw_file=Open RAW File
+brillo=Brightness
+Brightness=Brightness
+brillo_y_contraste=Brightness and Contrast
+de=de
+sharpen=Sharpen
+cancelando=Cancel
+colores=Colors adjust
+cargar_toc=Would you like to load layer?
+center_raster=Center raster layer on View
+tfw_load=To load georeferencing coordinates from tfw file
+closeanalysisview=Close analisys view
+compress=Compress
+confirmacion=Confirmation
+contraste=Contrast
+Contrast=Contrast
+elementos=Elements
+luminosity=Luminosity
+tolumsa=HSL balance
+eliminar_extremos=Remove ends
+RemoveEnds=Remove ends
+endinfo=End statistics
+error_aplicando_filtro=Error adding filter
+error_adding_filters=Selected filters are causing problems.\n Processes won't be executed. 
+error_render_preview=Error rendering preview
+error_setview_preview=Error setting preview
+error_carga_capa=Error loading layer
+error_writing_raster_file=It's not possible to write in this path
+error_georasterwriter=Writing error in GeoRasterWriter.
+error_lectura=It's not possible to read from this path
+error_not_suported_extension=Couldn't find writer. Not supported extension.
+error_opened_file=File is opened in a project view. Close layer before saving.
+error_props_show=It's not possible to operate with the layer now. Wait a moment please.
+error_props_tabs=Properties panel was closed because it wasn't panels
+error_extensiones_soportadas=Error getting supported extension list. The layer can't be exported
+error_writer=Writer not found.
+raster_error_file_exists=File already exists. Would you like to overwrite it?
+error_file_not_found=File not found
+error_file_not_valid=File not valid
+error_file_not_writable=It's not possible to create output file
+error_importando_tabla_color_rmf=Selected rmf file hasn't color tables.
+error_load_layer=It was not possible load layer. We can try it by hand
+error_salvando_rmf=Error writing in rmf file
+error_transformacion=Invalid transformation
+error_transformacion1=It's not possible to calc inverse transformation of any point
+error_rowtable=Error adding row to the table
+error_creando_filtro=Error creating filter
+error_lookingfor_view=Selected view not found.\n It's not possible to load georeferencing view
+error_point_file=Selected points file is not valid
+error_view_not_found=Error: View not found
+error_dont_exists_layer=The layer don't exists. It was not possible show preview.
+error_processing=An exception has been launched.\n The process was aborted.\n (gvSIG.log for more information)
+error_cutting=An exception has been throwed cutting the raster
+error_filtering=An exception has been throwed adding filters
+error_rois_table=ROIs Table error.
+error_creating_rois=Error creating ROIs.
+escale=Scale
+espectrales=Spectral functions
+interpolando=Interpolating
+salvando_imagen=Saving image
+cancelando_espere=Cancelling. Wait a moment, please ...
+radiometricos=Radiometric enhanced
+espaciales=Spatial functions
+suavizado=Smooth
+deteccion_bordes=Border detection
+espere=Wait a moment, please
+extension_no_soportada=Selected format is not supported
+file=File
+file_too_big=Input raster is too big to create a TIFF file (> 4GB).\n The result of the process will be compress to JPEG2000.
+filtro_de=Filter of
+formato=Format
+bmp_file=BMP File
+jpeg_file=JPEG File 
+png_file=PNG File
+tif_file=TIF File
+general_info=Dataset information
+generando_bloque=Creating block
+generando_recorte=Clippping
+geolocation=Geolocalization
+georref=Georeferencing
+georreferenciacion=Georeferencing
+get_tool_focus=Gets the tool focus
+green=Green
+ancho=Width
+alto=Height
+height=Height
+histogram_error=Error calculating histogram
+increase=Cursor Zoom
+incremento_recorte=Progress increment
+info=Info
+level_slice=Level slice
+leyendo_raster=Reading input data raster. \u00a1Warning!. This operation could to take a few minutes. Wait a moment, please...
+lineal_directo=Linear
+lineas=Lines
+linf_der=Lower right
+lsup_izq=Upper left
+msg_save_raster=The operation will be cancelled. Would you like to go on?
+mtspixel=Cell size
+name=Name
+nbandas=Bands number
+no=No
+no_driver_escritura=It's not possible to get write driver. The raster is not in disk yet.
+onSharpening=Activate pansharpening
+opacidad=Opacity
+poligonos=Poligons
+previsualizacion=Preview
+preview_not_available=Preview is not available. It's not possible copy the layer
+props=Properties
+puntos=Points
+rasterizando=Rasterizing
+realce=Enhanced
+realces=Enhanced
+red=Red
+recorte_de_colas=Clipping tail(%)
+TailTrim=Clipping tail (%)
+resolution=Resolution
+salvando_bloque=Saving block
+salvar_raster_geo=Save view to georeferenced raster
+salvar_rois=Save ROIS to shp file
+salvando_raster=Save to raster
+saveas=Save as
+scale=Scale
+seleccionar_capas_raster=Select raster layers
+seleccionar_fichero=Select file
+select=Select
+selectBandaRefinado=Select refined band
+si=Yes
+size=Size
+standard=Standard
+tarea_en_progreso=Task in progress
+tipo_dato=Data type
+transparencia=Transparency
+transp_by_pixel=Transparencia by pixel
+transp_selection=Transparencia by selection
+time=Time
+width=Width
+yes=Yes
+coor_geograficas=Geographics coordinates
+tamPixX=Pixel size in X
+tamPixY=Pixel size int Y
+coor_right=Right
+coor_up=Up
+coor_left=Left
+coor_down=Down
+coor_center=Center
+metadata=Metadata
+origin=Origin
+histograma=Histogram
+histograms=Histograms
+datos_visualizados=Visualize data
+vista_datasource=View extension
+imagen_completa=Full image
+normal=Usual
+accumulated=Acumulate
+logaritmic=Logar\u00edtmic
+band=Band
+generando_histograma=Generating histogram. Wait a moment, please,...
+calculando_histograma=Calculating histogram values
+ocultar_estadisticas=Hide statistics
+mostrar_estadisticas=Show statistics
+boton_mostrar=Show all
+boton_limpiar=Clean
+recorte=Clip raster layer
+coordenadas_pixel=Pixel coordinates
+sup_izq=Upper left
+inf_der=Lower right
+coordenadas_reales=Real coordinates
+fullExtent=Raster layer's complete extent 
+select_tool=Select from view
+contraer=Contract
+expandir=Expand
+resolucion_espacial=Resolution
+tamanyo_celda=Cell size
+ancho_x_alto=Width x Height
+celda=Cell
+vecino_+_proximo=Nearest neighbourhood
+bilinear=Bilinear
+distancia_inversa=Inverse distance
+bicubico=Bicubic
+b_splines=B-Spline
+seleccion_bandas=Bands
+crear_1_capa_por_banda=Create a layer for each band
+otras_opciones=Options
+nombre_capas=Layer names
+nombre_capa=Layer name
+cargar_en_toc=Load layer
+seleccionar_directorio=Select a directory
+coordenadas_recorte=Coordinates
+guardar_en_disco=Save on disk automatically
+guardar_predeterminado=Save as default
+calculando_estadisticas=Calculating statistics
+estadisticas_calculadas=Calculated statistics.
+vista_previa=Preview
+aplicar_capa=Apply on layer
+aplicar_vista_previa=Apply on preview
+filtros=RGB Filters
+solo_visualizacion=Only on visualization
+generar_fichero=Generate file
+abrir_memoria=Open in memory
+capa_nueva=New layer
+enabled=Active
+brightness=Brightness
+contrast=Contrast
+enhanced=Enhanced
+enhanced_rad=Radiometric enhanced
+rgbtohsl=RGB->HSL
+hsltorgb=HSL->RGB
+rgbtocmyk=RGB->CMYK
+cmyktorgb=CMYK->RGB
+colorbalancecmy=CMY balance
+colorbalancergb=RGB balance
+sobel=Sobel
+roberts=Roberts
+prewitt=Prewitt
+freichen=Freichen
+median=Median
+moda=Mode
+pasobajo=Low pass
+pasoalto=High pass
+gauss=Gauss
+personalizado=Custom
+aplicando_filtros=Applying filters
+guardando_capa=Saving layer
+ruta=Directory
+cambiar_ruta=Change...
+transparencia=Transparency
+tablas_color=Color table
+transparencia=Transparency
+pansharp= Pansharp
+ul=Upper left
+ur=Upper right
+lr=Lower right
+ll=Lower left
+regiones_interes=Area of interest
+rotX=X rotation
+rotY=Y rotation
+ux=X
+uy=Y
+px=Pix X
+py=Pix Y
+rx=Rot X
+ry=Rot Y
+geolocation=Geolocalization
+error_transformacion=Error in transformation parameters
+salvar_transf=Save current transformation as default
+back_transf=Go to last transformation
+next_transf=Go to next transformation
+aplicar_transf=Set trasformation
+first_transf=Go to first transformation
+reset_transf=Inicializate with disk transformation
+aviso_write_transform=The raster layer georeferencing is going to be changed. Would you like to go on?
+aviso_salir_salvando=There is changes in georeferencing data. Would you like to save and overwrite raster layer's georeferencing data?
+tabla=Table
+rampa=Gradient
+interpolado=Interpolated
+activar_tablas_color=Activate color table
+tabinterpolated_color=Color
+comprimir_paleta=It's possible to compress color palette. Would you like to do that?
+tabla_actual=Current table
+desea_guardar_cambios=Would you like to save changes?
+desea_borrar_librerias=Would you like to delete selected libraries?
+nueva_libreria=New library
+nueva_libreria_title=New library
+duplicar_libreria=Duplicate library
+libreria=Library
+minimo=Minimun
+maximo=Maximun
+minimoRGB=RGB minimun
+maximoRGB=RGB maximun
+varianza=Varianza
+media=Media
+ajustar_limites=Limits adjust
+limites=Limits
+guardar_como_predeterminado=Would you like to save current color table as default of this layer?
+nombre=Name
+borrar_libreria=Delete library
+interpolacion=Interpolation
+restablecer=Restore
+tamano_intervalo=Interval size
+n_intervalos=Number of intervals
+confirmar=Confirm
+addlibrary_supera_limite=The piece number is too big. It could take too much time. Would you like to go on?
+equidistar=Middle distance
+escala_minima=Minimum scale
+escala_maxima=Maximun scale
+rango_de_escalas=Scale range
+no_mostrar_la_capa_cuando_la_escala_sea=Not show the layer when the scale 
+menor_de=Less than
+mayor_de=Greater than
+scale_panel=Scale
+no_existe_fichero=File doesn't exists
+el_fichero=The file
+esta_formato_desconocido=is in a not recognized format
+no_puede_abrir_fichero=The file can't be opened
+error_abrir_fichero=Error opening file
+informacion_adicional=Aditional information
+files=Files
+todos_soportados=All supported
+export_libreria=Export library
+valor_general=General value
+transparente=Transparent
+activar_uso_nodata=Active NoData
+tratar_nodata_transparente=Set NoData value to transparent
+nodata=NoData
+import_libreria=Import library
+overviews_generating=Generating pyramid
+incremento_overview=Increase in overviews generation
+generar_overviews=Generate overviews
+sobreescribir_datos_overview=Generate overview process could <BR>overwrite the file. Would you like to go on?
+sobreescribir_overviews=The image already has overviews.<BR> Would you like to overwrite them?
+layer_without_georref=The layer has not geographic reference.<BR> Would you like to introduce it manually?
+num_overviews=Overviews Number
+algorithm=Algorithm
+overviews=Overviews
+proporcion_overviews=Ratio
+generacion_overviews=Create overviews when load a raster
+vecino_cercano=Nearest neightbourhood
+media=Media
+media_phase=Media Mag/Phase
+cache=Cache
+preference_cache_warning=<html><center><b>WARNING: You mustn't to change this section if you're not sure what you are doing</b></center></html>
+tamanyo=Size
+paginas_grupo=Pages x Group
+tamanyo_pagina=Page size
+bloques_procesos=Process blocks
+rutas=Paths
+temporales=Temporary
+general=General
+num_clases=Number of classes
+previsualizar_automaticamente_raster=Preview automatically changing properties
+pedir_coordenadas_georreferenciacion=Ask for coordinates when a raster without georeferencing is loaded
+ask_for_projection=Ask for projection when the raster loaded has different projection from view
+carga_capas=Load layers
+tabla_color=Color tables
+loadlayer_aplicar=When load a DEM set
+global=Global
+capa=Layer
+nodata_modificado_continuar=Default NoData value is going to be change. Would you like to go on?
+transf=Transformation
+corners=Corners
+increase_statistics=Increment calculating statistics
+stats=Statistics
+statistics_generation=Generating statistics
+recalc_stats=Recalc
+affine_algorithm=Afin transformation
+polynomial_algorithm=Polinomial transformation
+georef_type=Georeference type
+georef_file=Fichero a georreferenciar
+georef_algorithm=Georeferencing algorithm
+without_map=Without reference cartography
+with_map=With reference cartography
+layer_not_loaded=There isn't a velid layer. Please, select a raster layer
+full_view=Full zoom
+prev_zoom=Last zoom
+select_zoom_area=Zoom selecting area
+zoom_menos=Decrease zoom level
+zoom_mas=Increase zoom level
+Umbral=Threshold
+Compare=Compare
+LadoVentana=Window side
+Agudeza=Sharpness
+color_interpretation_continue=It's going to change default color interpretationlor for this raster. Would you like to go on?
+regionalpha=Transparent area
+combinacion_no_asignable=It's not possible to save this selection of bands as default.\n A band only can to have one color interpretation
+end_georef=Exit to georeferencing
+ask_end_georef=Do you want to close georeferencing aplication?
+no_rows=There isn't entries in point table
+no_rows_selected=There aren't selected entries in points table
+table_not_initialize=Table not initialize
+capa_raster=Raster layer
+process_raster=Raster process
+geo_raster=GeoRaster
+show_number=Show control point number graphically
+add_errors_csv=Add errors to CSV file
+center_view=Center view to selected point
+error_set_view=Error setting load view parameters
+no_selected_points=It's not possible to center view to a point.\n There aren't selected points 
+value_not_valid=Value not valid in one cell
+nodatavalue_not_valid=Value not valid. The nodata value is removed of this layer.
+georef_loading=Loading georeferencig module
+move_image=Move image
+add-point=Add point
+process=Process
+save_to_xml=Save control point in raster metadata file
+load_from_xml=Load control point from raster metadata file
+save_to_ascii=Save control point in CSV file
+load_from_ascii=Load control point from CSV file
+eliminar_puntos=This operation will delete all points \n in point table.\n Would you like to go on?
+raster_export=Export to raster
+transformaciones_geograficas=Geographic transformations
+sobreescribir_puntos=This function will delete all control points\n in raster metadata file.\n Would you like to go on?
+start_save=You can begin to select a area on the view 
+input_hist=Input
+output_hist=Output
+clip=Clip
+levels=Levels
+operation=Operation
+band=Bands
+drawing_type=Drawed
+histogram_type=Type
+range_wrong=Wrong range values.\n
+select_rgb=Select RGB clicking on view
+mascaras=Masks
+value=Value
+inversa=Inverse
+logarithmical=Logarithmic
+exponential=Exponential
+rois_needed=<html><b>Warning:</b> It's necesary some ROI to<BR> apply this filter. Please, go to the dialog<BR> "Interest regions" and select at least one</html>.
+adjust_to_rois=Adjust to maximun extension defined by layer ROIs
+square_root=Square root
+pow=Square
+apply_all=Apply selected option to all files
+not_load=Don't load the layer
+ignore_raster_proj=Use the view projection in the raster layer and load
+reproject=Reproject raster to view projection
+change_view_proj=Change the view projection to raster projection
+proj_options=Projection options
+dif_proj=Projection of selected raster is diferent<br>that view projection. Please, select an option.
+desactivado=Deactivate
+color=Color
+clase=Class
+valor=Value
+hasta=Final
+alpha=Alpha
+anadir_filtro=Add filter
+eliminar_filtro=Delete filter
+stats=Statistics
+select_proj=Select projection
+src_proj=source projection
+dest_proj=target projection
+reprojecting=Reprojecting
+error_reprojecting=Reprojecting error
+dest_file=target file
+capa_a_reproyectar=Reproject layer 
+toc_reproject=Reproject layer
+layer=Layer
+ask_generar_overviews=Do you want build overviews?
+error_create_overviews=It was not possible to create overviews
+error_write_overviews=It was not possible to save overviews
+highpassfilter=High Pass filter
+radio=Radio
+noisefilter=Noise filter
+grayescaleconversion=Gray Scale Conversion
+outputscale=Output Scale
+path=Path
+porarea=Area selection
+porroi=ROI selection
+vectbbox=Select all inside bounding box
+vectinside=Set nodata in all outside regions values
+selectROI=ROI selection
+vectorization=Vectorization
+prev=Last
+posterization=Posterization
+panel_preview_not_available=Preview not available for this panel
+nograyscale=It wasn't possible to add\n gray scale filter
+noposterization=It wasn't possible to add\n posterization filter
+threshold=Threshold
+selectarea=Selection
+grayconversionscale=B/W Conversion
+vectorization=Vectorization
+vector_generation=Vector generation
+clip_raster_again=Would you like to cut raster again?
+filter_raster_again=Would you like to process raster again?
+modefilter=Filtero de Moda
+nomedian=It wasn't possible to add\n median filter
+loadstretch=Load Stretch
+stretch=Stretch
+datatype_not_byte=Would you like a stretch selection?
+grayscaleconversion=Gray Scale
+path_not_valid=Path not valid
+source_too_big=Source layer is too big.\n Would you like to go on?
+load_parameters=Load parameters
+save_parameters=Save parameters
+equalization=Equalization
+memoria_excedida=There isn't enough memory for this operation.\n You can try to change JVM parameters \n or build a smaller image.
+black=Black
+corner_threshold=Corner threshold
+curve_optimization=Curve optimization
+despeckle=Despeckle
+left=Left
+majority=Majority
+minority=Minority
+optimization_tolerance=Optimization tolerance
+output_quantization=Output quantization
+policy=Policy
+potracelines=Potrace parameters
+random=Random
+right=Right
+white=White
+wrong_resolution=You should introduce the output raster resolution.\n Height and width in pixels
+downloading_image=Downloading image from the server.\n This operation could take a few minutes.
+remember_select_size=WARNING!\n Now, you have to select the output size.
+no_resolution_level=The selected layer is not tiled with resolution levels. \nThis zoom cannot be applied.
+max_zoom_reached=Maximum resolution level reached
+min_zoom_reached=Minimum resolution level reached
+there_arent_selected=There aren't a layer selected with resolution levels 
+goto_resolution_level=Go to the next/previous resolution level
+colortables_not_loaded=Color tables dialog cannot be opened
+error_computing_histogram=Error computing the histogram
+nbandas_file=Bands in file
+tipo_proveedor=Provider type
+file_exists_rename=The file exists and will be renamed
+guardar_box_value=Save as NoData the selected value in the text box
+restore=Restore
+restore_native_value=Restore the original NoData value
+default_value=Default value
+set_configuration_value=Assigns the NoData value by default in gvSIG configuration
+delete=Delete
+delete_value=Deletes the NoData value of this layer
+tratar_nodata_transparente=Draw the NoData values transparent
+value_not_valid=This NoData value is not valid
+round_pixels=Round off pixels
+tiled_layer=Would you like to use tile cache with the selected layers?
+tiled_layer2=Would you like to load layers normally or caching data as tiles?
+normally=Normally
+tiled=Tiled
+all_normally=Normally all
+all_tiled=Tiled all
+yes_dont_ask_anymore=Yes for all
+no_dont_ask_anymore=Not for all
+open_window=Exits an open pixel inspector.\n Close the window before continue
+info=Information
+view=View
+layer_list=Layer list
+band_values=Values by band
+pixel_point=Pixel
+view_point=View
+world_point=Map
+bands=Bands
+colors=Colors
+coords=Coordinates
+lat=Latitude
+long=Longitude
+red=Red
+green=Green
+blue=Blue
+infobypoint=Info by point
+export_view_to_image=Export view to image
+resolution_method_selection=Method of resolution selection
+reproject_on_the_fly=Reproject on the fly
+colortable_not_active=The color table is off for this layer. Activate the check box or these will be remove from this layer.
+change_datatype=Change data type
+adjust_dec2int=Decimal to integer
+adjust_big2small=Major to minor
+output_too_big=The size of the output file too big
+some_parameter_is_not_correct=Some parameter is not correct. Review the dialog
+filename_cannot_be_empty=The file name cannot be empty
+scale_cannot_be_zero=The scale cannot be zero
+height_cannot_be_zero=The height cannot be zero
+width_cannot_be_zero=The width cannot be zero
+cellsize_cannot_be_zero=The cellsize cannot be zero
+wc_wrong=The world coordinates are wrong
+different_projection=The view and some of the loaded layers have different projections.\n The result layer will have the view projection.
+clip_view=Clip view
+overwrite_projection=The layer projection, in its metadata file (RMF) will be overwritten with the view projection.\n Would you like to go on?
+set_view_projection=Set projection
+error_saving_rois_rmf=Error saving the ROI in the metadata file
+problems_loading_rois=Problems loading regions of interest from the file.\n The execution of gvSIG will continue normally.
+remove_roi_file_link=Would you like to remove the link with the ROI file? This file will not be removed from disk.
+folder_not_writable=The selected layer is in a not writable folder. Please, select a writable folder to save metadata
+folder=Folder
+folder_not_writable1=This folder is not writable
+view_not_active=The active window is not a View
+grayscale=Gray scale
+typeBand=Bands
+gv_tools=gvSIG Tools
+group_tools=Tools for raster layers
+raster_layer_not_active=This tool needs a raster layer selected in the view
+radiometric_enhancedment=Radiometric enhancedment
+reprojection=Reprojection
+filters=Filters
+clip_raster=Clip
+save_as=Export
+overviews=Overviews
+layer_datatype=Change data type
+no_statistics_computed=No statistics computed
+not_defined=Not defined
+photometric=Photometric
+compression=Compression
\ No newline at end of file

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_gl.properties
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_gl.properties	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_gl.properties	(revision 8183)
@@ -0,0 +1,38 @@
+#Translations for language [gl]
+#Mon Oct 30 09:38:21 CET 2006
+activar=Activate
+brillo=Brillo
+brillo_y_contraste=Brillo e Contraste
+compress=Compresi\u00f3n
+confirmacion=Confirmaci\u00f3n
+contraste=Contraste
+eliminar_extremos=Eliminar extremos
+endinfo=Estat\u00edsticas de remate
+error_file_exists=O arquivo xa existe. \u00bfDesexa sobreescribilo?
+error_file_not_writable=Non \u00e9 posible crear o arquivo de salida
+espere=Por favor, espere
+file=Arquivo
+height=Alto
+lineal_directo=Lineal directo
+linf_der=Inf Der
+lsup_izq=Sup Esq
+msg_save_raster=Vaise canelar a operaci\u00f3n. \u00bfDesexa continuar?
+mtspixel=Mts/pixel
+no=Non
+onSharpening=Activar pansharpening
+previsualizacion=Previsualizaci\u00f3n
+props=Propiedades
+realce=Realce
+realces=
+recorte_colas=Recorte colas
+resolution=Resoluci\u00f3n
+salvar_raster=Gardar a raster xeoreferenciado
+scale=Escalar
+seleccionar_fichero=Seleccionar arquivo
+select=
+selectBandaRefinado=Seleccionar Banda de Refinado
+size=Tama\u00f1o
+tarea_en_progreso=Tarea En progreso
+time=Tempo
+width=Ancho
+yes=Si

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_gl.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_ca.properties
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_ca.properties	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_ca.properties	(revision 8183)
@@ -0,0 +1,38 @@
+#Translations for language [ca]
+#Mon Oct 30 09:38:21 CET 2006
+activar=Activar
+brillo=Brillantor
+brillo_y_contraste=Brillantor i contrast
+compress=Compressi\u00f3
+confirmacion=Confirmaci\u00f3
+contraste=Contrast
+eliminar_extremos=Eliminar extrems
+endinfo=Estad\u00edstiques de finalitzaci\u00f3
+error_file_exists=El fitxer ja existix. Vol sobreescriure'l?
+error_file_not_writable=No \u00e9s possible crear el fitxer d'eixida
+espere=Per favor, espereu
+file=Fitxer
+height=Al\u00e7ada
+lineal_directo=Lineal directe
+linf_der=Inf Der
+lsup_izq=Sup Esq
+msg_save_raster=L'operaci\u00f3 va a cancel\u00b7lar-se. Vol continuar?
+mtspixel=Mts/p\u00edxel
+no=No
+onSharpening=Activa pansharpening
+previsualizacion=Previsualitzaci\u00f3
+props=Propietats
+realce=Relleu
+realces=
+recorte_colas=Retall de cues
+resolution=Resoluci\u00f3
+salvar_raster=Salvar el raster georeferenciat
+scale=Escalar
+seleccionar_fichero=Seleccionar fitxer
+select=
+selectBandaRefinado=Seleccionar Banda de Refinat
+size=Dimensi\u00f3
+tarea_en_progreso=Tasca en progr\u00e9s
+time=Temps
+width=Amplada
+yes=S\u00ed

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_ca.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_pt.properties
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_pt.properties	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_pt.properties	(revision 8183)
@@ -0,0 +1,38 @@
+#Translations for language [pt]
+#Mon Oct 30 09:38:21 CET 2006
+activar=Activate
+brillo=Brightness
+brillo_y_contraste=
+compress=Compression
+confirmacion=
+contraste=Contrast
+eliminar_extremos=Remover extremos
+endinfo=
+error_file_exists=
+error_file_not_writable=
+espere=Por favor, espere
+file=
+height=
+lineal_directo=Lineal direito
+linf_der=Inf. dir.  X
+lsup_izq=Sup. esq. X
+msg_save_raster=
+mtspixel=Mts/pixel
+no=No
+onSharpening=Activar "pansharpening"
+previsualizacion=
+props=
+realce=Realce
+realces=
+recorte_colas=Recorte de filas
+resolution=
+salvar_raster=Guardar como raster
+scale=Escala
+seleccionar_fichero=
+select=
+selectBandaRefinado=Seleccionador de bandas de refinado
+size=
+tarea_en_progreso=Tarefa em progresso
+time=
+width=Ampl\u00e0ria
+yes=

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_pt.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/config.xml
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/config.xml	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/config.xml	(revision 8183)
@@ -0,0 +1,336 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<plugin-config>
+	<depends plugin-name="org.gvsig.raster.mainplugin" />
+	<depends plugin-name="org.gvsig.app.document.table.app.mainplugin" />
+
+	<depends plugin-name="org.gvsig.geoprocess.app.mainplugin" optional="true" />
+	<depends plugin-name="org.gvsig.geoprocess.app.algorithm" optional="true" />
+
+	<resourceBundle name="text"/>
+	<libraries library-dir="lib"/>
+	<extensions>
+
+		<!--Menu Raster -->
+
+		<extension class-name="org.gvsig.raster.tools.app.basic.RasterExtension"
+			description=""
+			active="true"
+			priority="1">
+
+      <menu text="Layer/capa_raster"
+        position="000601405"
+        is_separator="true"/>
+
+			<tool-bar name="View_Tools_Zooms" position="420">
+				<selectable-tool icon="layer-zoom-res-level" action-command="ZoomResolutionLevel" tooltip="goto_resolution_level" position="7"/>
+			</tool-bar>
+
+			<!--Menu Raster layer -->
+
+			<menu text="Layer/capa_raster/seleccionar_capas_raster"
+				name="raster-tools-select-layer"/>
+
+			<action
+        		name="raster-tools-select-layer"
+        		label="seleccionar_capas_raster"
+        		action-command="SelectLayer"
+        		icon="view-select-raster-layer"
+        		position="000601410"
+        	/>
+
+			<menu text="Layer/capa_raster/histograma"
+				name="raster-tools-histograma"/>
+
+			<action
+        		name="raster-tools-histograma"
+        		label="histograma"
+        		action-command="HistogramPanel"
+        		icon="layer-histogram"
+        		position="000601420"
+        		accelerator="Ctrl+Alt+H"
+        	/>
+
+			<menu text="Layer/capa_raster/tablas_color"
+				name="raster-tools-tablas-color"/>
+
+			<action
+        		name="raster-tools-tablas-color"
+        		label="tablas_color"
+        		action-command="ViewColorTable"
+        		icon="layer-color-table"
+        		position="000601430"
+        		accelerator="Ctrl+Alt+T"
+        	/>
+
+			<menu text="Layer/capa_raster/regiones_interes"
+				name="raster-tools-regiones-interes"/>
+
+			<action
+        		name="raster-tools-regiones-interes"
+        		label="regiones_interes"
+        		action-command="RoisManager"
+        		icon="layer-modify-roi"
+        		position="000601450"
+        		accelerator="Ctrl+Alt+A"
+        	/>
+
+			<menu text="Layer/capa_raster/generar_overviews"
+				name="raster-tools-generar-overviews"/>
+
+			<action
+        		name="raster-tools-generar-overviews"
+        		label="generar_overviews"
+        		action-command="Overviews"
+        		icon="layer-modify-overviews"
+        		position="000601460"
+        		accelerator="Ctrl+Alt+O"
+        	/>
+
+			<menu text="Layer/capa_raster/analysisview"
+				name="raster-tools-analysisview"/>
+
+			<action
+        		name="raster-tools-analysisview"
+        		label="analysisview"
+        		action-command="ViewRasterAnalysis"
+        		icon="view-raster-analysis"
+        		position="000601470"
+        		accelerator="Ctrl+Alt+K"
+        	/>
+
+			<menu text="Layer/capa_raster/goto_resolution_level"
+				name="raster-tools-resolutionlevel"/>
+
+			<action
+        		name="raster-tools-resolutionlevel"
+        		label="goto_resolution_level"
+        		action-command="ZoomResolutionLevel"
+        		icon="layer-zoom-res-level"
+        		position="000601480"
+        		accelerator="Ctrl+Alt++"
+        	/>
+
+      <!--FIN Menu Raster layer-->
+
+
+      <!--Menu Raster dataset-->
+
+    	<!--FIN Menu Raster dataset-->
+
+
+    	<!--Menu Multiespectral layer-->
+
+    	<!-- FIN Menu Multiespectral layer-->
+
+
+    	<!--Menu Enhanced-->
+
+      		<menu text="Layer/enhanced/filtros"
+				name="raster-tools-filter"/>
+
+			<action
+        		name="raster-tools-filter"
+        		label="filtros"
+        		action-command="FilterPanel"
+        		icon="layer-filter-raster"
+        		position="000601700"
+        		accelerator="Ctrl+Alt+F"
+        	/>
+
+			<menu text="Layer/enhanced/enhanced_rad"
+				name="raster-tools-enhanced-rad"/>
+
+			<action
+        		name="raster-tools-enhanced-rad"
+        		label="enhanced_rad"
+        		action-command="EnhancedPanel"
+        		icon="layer-enhanced"
+        		position="000601710"
+        		accelerator="Ctrl+Alt+E"
+        	/>
+
+      <!-- FIN Menu Enhanced-->
+
+
+      <!--Menu Geographic transformations-->
+
+			<menu text="Layer/transformaciones_geograficas/geolocation"
+				name="raster-tools-geolocation"/>
+
+			<action
+        		name="raster-tools-geolocation"
+        		label="geolocation"
+        		action-command="GeoLocation"
+        		icon="layer-geolocalization"
+        		position="000601810"
+        		accelerator="Ctrl+Alt+G"
+        	/>
+
+      		<menu text="Layer/transformaciones_geograficas/set_view_projection"
+				name="raster-tools-set-view-projection"/>
+
+			<action
+        		name="raster-tools-set-view-projection"
+        		label="set_view_projection"
+        		action-command="SetProjection"
+        		icon="setviewprojection-raster-icon"
+        		position="000601820"
+        		accelerator=""
+        	/>
+
+      		<!--FIN Menu Geographic transformations-->
+
+
+			<!--Menu Exportar a-->
+
+			<menu text="Layer/export_to/saveas"
+				name="raster-tools-saveas"/>
+
+			<action
+        		name="raster-tools-saveas"
+        		label="saveas"
+        		action-command="SaveAs"
+        		icon="layer-saveas"
+        		position="000601910"
+        		accelerator="Ctrl+Alt+S"
+        	/>
+
+			<menu text="Layer/export_to/recorte"
+				name="raster-tools-clip"/>
+
+			<action
+        		name="raster-tools-clip"
+        		label="recorte"
+        		action-command="ClippingPanel"
+        		icon="layer-clip-raster"
+        		position="000601920"
+        		accelerator="Ctrl+Alt+C"
+        	/>
+
+      <menu text="Layer/export_to/change_datatype"
+        name="raster-tools-change-datatype"/>
+
+      <action
+            name="raster-tools-change-datatype"
+            label="change_datatype"
+            action-command="LayerDatatype"
+            icon="datatype-icon"
+            position="000601930"
+            accelerator=""
+          />
+
+		  <!-- ************* -->
+
+			<menu text="View/seleccionar_capas_raster"
+				name="raster-tools-select-layer"/>
+
+			<action
+        		name="raster-tools-select-layer"
+        		label="seleccionar_capas_raster"
+        		action-command="SelectLayer"
+        		icon="view-select-raster-layer"
+        		position="0"
+        	/>
+
+
+      <!--Menu Vista/Exportar -->
+
+			<menu text="View/export/export_view_to_image"
+				name="raster-tools-export-view"/>
+
+     <action
+        		name="raster-tools-export-view"
+        		label="export_view_to_image"
+        		action-command="SaveViewToImageRaster"
+        		icon="view-export-image"
+        		position="0"
+        		accelerator="Ctrl+Alt+V"
+        	/>
+
+      <menu text="View/export/salvar_raster_geo"
+        name="raster-tools-save-geo"/>
+
+      <action
+            name="raster-tools-save-geo"
+            label="salvar_raster_geo"
+            action-command="SaveViewToRaster"
+            icon="view-export-georeferenced-raster"
+            position="0"
+            accelerator="Ctrl+Alt+W"
+          />
+
+      <!-- ************* -->
+
+
+      <menu text="Layer"
+        position="000601935"
+        is_separator="true"/>
+
+      <menu text="Layer/propiedades_raster"
+        name="raster-tools-properties"/>
+
+      <action
+            name="raster-tools-properties"
+            label="propiedades_raster"
+            action-command="RasterProperties"
+            icon="layer-properties-raster"
+            position="000601940"
+            accelerator="Ctrl+Alt+P"
+          />
+
+			<menu text="View/analysisview"
+				name="raster-tools-analysisview"/>
+
+			<action
+        		name="raster-tools-analysisview"
+        		label="analysisview"
+        		action-command="ViewRasterAnalysis"
+        		icon="view-raster-analysis"
+        		position="0"
+        		accelerator="Ctrl+Alt+K"
+        	/>
+
+		</extension>
+
+		<extension class-name="org.gvsig.raster.tools.app.basic.tool.infobypoint.InfoByRasterPointExtension"
+			description="Extensi�n encargada de gestionar la herramienta de info."
+			active="true">
+			 <action
+        		name="layer-info-by-raster-point"
+        		label="_point_information"
+        		tooltip="_Show_point_information"
+        		action-command="INFO_BY_PIXEL"
+        		icon="layer-info-by-pixel"
+        		position="0"
+        		/>
+		</extension>
+
+		<!--<extension class-name="org.gvsig.raster.tools.app.basic.tool.infobypoint.InfoByRasterPointExtension"
+			description="Informaci�n por p�xel"
+			active="true"
+			priority="1">
+			<tool-bar name="Info_By_Pixel" position="3">
+				<selectable-tool icon="info-by-pixel" action-command="INFO_BY_PIXEL" tooltip="info_by_pixel" position="7"/>
+			</tool-bar>
+		</extension>
+		<extension class-name="org.gvsig.raster.tools.app.basic.SystemGCExtension"
+			description=""
+			active="true">
+			<menu text="Test/System GC"/>
+		</extension>
+		<extension class-name="org.gvsig.raster.tools.app.basic.tool.infobypoint.InfoByRasterPointExtension"
+			description="Extensi�n encargada de gestionar la herramienta de info."
+			active="true"
+			priority="29">
+			<menu text="Vista/consulta"
+				position="30030"
+				is_separator="true"/>
+			<menu text="Vista/consulta/informacion" position="3003010" action-command="INFO_BY_PIXEL" icon="view-query-information"/>
+			<tool-bar name="View_Tools_Query" position="5">
+				<selectable-tool icon="view-query-information" action-command="INFO_BY_PIXEL"  tooltip="informacion" position="1"/>
+			</tool-bar>
+		</extension>
+		-->
+
+	</extensions>
+</plugin-config>

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_cs.properties
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_cs.properties	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_cs.properties	(revision 8183)
@@ -0,0 +1,38 @@
+#Translations for language [cs]
+#Mon Nov 06 09:04:31 CET 2006
+activar=Activate
+brillo=Jas
+brillo_y_contraste=Jas a kontrats
+compress=Komprese
+confirmacion=Potvr\u010f \u017ee
+contraste=Contrast
+eliminar_extremos=Odstranit hrany
+endinfo=Finalization Statistics
+error_file_exists=Soubor u\u017e existuje. P\u0159ejete si jej p\u0159epsat?
+error_file_not_writable=Nen\u00ed mo\u017en\u00e9 vytvo\u0159it v\u00fdstupn\u00ed soubor.
+espere=Pros\u00edm \u010dekejte
+file=Soubor
+height=V\u00fd\u0161ka
+lineal_directo=P\u0159\u00edmo line\u00e1rn\u00ed
+linf_der=dole vpravo X
+lsup_izq=Naho\u0159e vlevo X
+msg_save_raster=Operace bude zru\u0161ena. Chcete pokra\u010dovat?
+mtspixel=Mts/pixel
+no=No
+onSharpening=Aktivace doost\u0159ov\u00e1n\u00ed
+previsualizacion=Preview
+props=Vlastnosti
+realce=vylep\u0161en\u00ed
+realces=Vylep\u0161en\u00ed
+recorte_colas=O\u0159ez fronty
+resolution=Rozli\u0161en\u00ed ??
+salvar_raster=Ulo\u017eit jako rastr
+scale=M\u011b\u0159\u00edtko
+seleccionar_fichero=vyber soubor
+select=Vyber
+selectBandaRefinado=V\u00fdb\u011br Panchromatick\u00e9ho p\u00e1sma
+size=Velikost
+tarea_en_progreso=B\u011b\u017e\u00edc\u00ed proces
+time=\u010cas
+width=Ampl\u00e0ria
+yes=Ano

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_cs.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/decrease-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/decrease-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/plantilla.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/plantilla.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/tiles.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/tiles.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/options-icon.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/options-icon.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/selecttool-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/selecttool-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/forward.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/forward.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/backward-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/backward-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/next-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/next-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/gvsig-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/gvsig-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/down.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/down.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/setviewprojection-raster-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/setviewprojection-raster-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/x.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/x.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/pixel-increase.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/pixel-increase.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/reset-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/reset-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/y.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/y.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/gvsig-icon16x16.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/gvsig-icon16x16.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/addlayer-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/addlayer-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/blank-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/blank-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/line-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/line-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/round-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/round-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/point-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/point-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/pref-raster-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/pref-raster-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/selectrgb-icon.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/selectrgb-icon.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/icoBlue.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/icoBlue.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/duplicate_icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/duplicate_icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/datatype-icon.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/datatype-icon.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/exporttoascii-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/exporttoascii-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/delall-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/delall-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/exporttocsv-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/exporttocsv-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/FlechaMoveCursor.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/FlechaMoveCursor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/geoloc.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/geoloc.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/rectangle-select-cursor.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/rectangle-select-cursor.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/inclizq-arrow-cursor.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/inclizq-arrow-cursor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/line-cursor.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/line-cursor.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/polygon-cursor.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/polygon-cursor.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/shear-x-cursor.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/shear-x-cursor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/shear-y-cursor.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/shear-y-cursor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/inclder-arrow-cursor.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/inclder-arrow-cursor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/point-cursor.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/point-cursor.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/hand-cursor.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/hand-cursor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/rot-sup-izq-cursor.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/rot-sup-izq-cursor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/not-valid-cursor.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/not-valid-cursor.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/rotate-cursor.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/rotate-cursor.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/rot-inf-izq-cursor.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/rot-inf-izq-cursor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/hor-arrow-cursor.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/hor-arrow-cursor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/rot-sup-der-cursor.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/rot-sup-der-cursor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/zoom-pixel-cursor.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/zoom-pixel-cursor.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/ver-arrow-cursor.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/ver-arrow-cursor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/point-select-cursor.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/point-select-cursor.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/rot-inf-der-cursor.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/rot-inf-der-cursor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/zoom-in-cursor.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/zoom-in-cursor.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/RotSupDerCursor.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor/RotSupDerCursor.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/cursor
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/forward-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/forward-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/icon_endprocess.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/icon_endprocess.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/upleft.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/upleft.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/add-icon.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/add-icon.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/centerpoint-icon.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/centerpoint-icon.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/selectzoomarea-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/selectzoomarea-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/downright.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/downright.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/focus-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/focus-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/icoRed.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/icoRed.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/filter.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/filter.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/prevzoom-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/prevzoom-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/polygon-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/polygon-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/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.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/map-ok-ico.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/backward.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/backward.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/increase-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/increase-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/fullextent-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/fullextent-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/exit-icon.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/exit-icon.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/mas.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/mas.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/fullview-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/fullview-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/up.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/up.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/back-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/back-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/tfwload-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/tfwload-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/centerraster-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/centerraster-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/layer-modify-roi.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/layer-modify-roi.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/Point.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/Point.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/view-select-raster-layer.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/view-select-raster-layer.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-clip-raster.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-clip-raster.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/georef.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/georef.jpg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-histogram.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-histogram.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-modify-overviews.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-modify-overviews.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/view-export-image.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/view-export-image.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-vectorization.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-vectorization.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/view-raster-analysis.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/view-raster-analysis.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-color-table.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-color-table.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/reproject.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/reproject.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-enhanced.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-enhanced.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-clip-raster.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-clip-raster.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/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.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/menu-raster-export.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/view-export-georeferenced-raster.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/view-export-georeferenced-raster.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-geolocalization.ico
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-geolocalization.ico
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/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.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-properties-raster.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/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.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/menu-process-icon.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-modify-roi.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-modify-roi.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/tools-raster-reproject.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/tools-raster-reproject.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/pic1388370.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/pic1388370.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-zoom-res-level.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-zoom-res-level.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/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.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/menu-transgeo-icon.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-info-by-pixel.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-info-by-pixel.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-saveas.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-saveas.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-filter-raster.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-filter-raster.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-geolocalization.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action/layer-geolocalization.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/action
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/undo-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/undo-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/rotar-icon.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/rotar-icon.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/import-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/import-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/importfromcsv-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/importfromcsv-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/view-query-information.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images/view-query-information.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/images
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/build.number
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/build.number	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/build.number	(revision 8183)
@@ -0,0 +1,3 @@
+#Build Number for ANT. Do not edit!
+#Tue Apr 28 16:00:47 CEST 2009
+build.number=2005
Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_fr.properties
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_fr.properties	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_fr.properties	(revision 8183)
@@ -0,0 +1,38 @@
+#Translations for language [fr]
+#Mon Oct 30 09:38:21 CET 2006
+activar=Activate
+brillo=Luminosit\u00e9
+brillo_y_contraste=Luminosit\u00e9 et contrate
+compress=Compression
+confirmacion=Confirmation
+contraste=Contraste
+eliminar_extremos=Eliminer les extr\u00eames
+endinfo=Statistiques
+error_file_exists=Le fichier existe d\u00e9j\u00e0. Voulez-vous continuer ?
+error_file_not_writable=Impossible d'\u00e9crire le fichier de sortie.
+espere=Patientez s.v.p.
+file=Fichier
+height=Hauteur
+lineal_directo=Lin\u00e9aire direct
+linf_der=Inf. droite
+lsup_izq=Sup. gauche
+msg_save_raster=L'op\u00e9ration va \u00eatre annul\u00e9e ?
+mtspixel=Mts/pixel
+no=Non
+onSharpening=Am\u00e9liorer la r\u00e9solution planim\u00e9trique
+previsualizacion=Pr\u00e9visualisation.
+props=Propri\u00e9t\u00e9s
+realce=R\u00e9heussement
+realces=
+recorte_colas=Couper les r\u00e9sidus
+resolution=R\u00e9solution
+salvar_raster=Enregistrer le raster g\u00e9or\u00e9f\u00e9renc\u00e9.
+scale=Echelle
+seleccionar_fichero=S\u00e9lectionner le fichier
+select=
+selectBandaRefinado=S\u00e9lectionner la bande d'am\u00e9lioration.
+size=Taille
+tarea_en_progreso=T\u00e2che en progression.
+time=Temps
+width=Largeur
+yes=Oui

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_fr.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_de.properties
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_de.properties	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_de.properties	(revision 8183)
@@ -0,0 +1,239 @@
+#Translations for language [de]
+#Wed Oct 08 17:54:43 CEST 2008
+abrir_memoria=
+accept=OK
+activar=Aktivieren
+addlibrary_supera_limite=
+alto=H\u00f6he
+ancho=Breite
+ancho_alto=Breite x H\u00f6he
+ancho_x_alto=
+aplicando_filtros=
+aplicar_transf=
+aplicar_vista_previa=
+apply=Anwenden
+apply_all=
+archivo=
+aviso_salir_salvando=
+aviso_write_transform=
+b_splines=
+back_transf=
+band=
+banda=
+bandas=Farbstreifen
+bands_number=
+bands_panel=
+bicubico=
+bilinear=
+borrar=L\u00f6schen
+boton_limpiar=
+boton_mostrar=
+brillo=Helligkeit
+brillo_y_contraste=Helligkeit und Kontrast
+byte_order=
+calculando_histograma=
+cambiar_ruta=
+cancel=Abbrechen
+capa_a_reproyectar=
+capa_nueva=
+cargar=laden
+cargar_en_toc=
+celda=
+center_raster=
+cerrar=schlie\u00dfen
+change_view_proj=
+close=Schlie\u00dfen
+color=Farbe\:
+compress=Kompression
+confirmacion=Best\u00e4tigung
+confirmar=
+contraste=Kontrast
+coor_geograficas=Geografische Koordinaten
+coordenadas_erroneas=
+coordenadas_pixel=
+coordenadas_reales=
+coordenadas_recorte=
+corners=
+crear_1_capa_por_banda=
+crear_tabla=
+data_type=
+datos_visualizados=
+de=von
+dif_proj=
+distancia_inversa=
+el_fichero=
+eliminar_extremos=Eckpunkte l\u00f6schen
+endinfo=Zusammenfassung
+enhanced=
+error_abrir_fichero=
+error_adding_filters=
+error_cargar_capa=
+error_dont_exists_layer=
+error_writing_raster_file=Das Projekt konnte nicht gespeichert werden
+error_file_exists=Die Datei existiert bereits. Soll sie \u00fcberschrieben werden?
+error_file_not_found=
+error_file_not_valid=
+error_file_not_writable=Output Datei konnte nicht erstellt werden
+error_lectura=Das Projekt konnte nicht ge\u00f6ffnet werden
+error_preview_render=
+error_salvando_rmf=
+error_transformacion=
+escala_maxima=Maximalma\u00dfstab
+escala_minima=Minimalma\u00dfstab
+escale=
+espere=Warten sie bitte.
+esta_formato_desconocido=
+exportar=Exportieren
+extension_no_soportada=
+extents_no_coincidentes=Ausma\u00dfe des ausgew\u00e4hlten Bildes stimmen nicht mit dem Originalbild \u00fcberein.
+file=Datei
+file_doesn_exists=
+file_size_in_bytes=
+files=
+filtro_de=
+filtros=
+first_transf=
+formato=Format
+general=Allgemein
+general_info=
+generar_fichero=
+generar_overviews=
+geolocation=
+georref=
+green=
+guardar_en_disco=
+guess_image_geometry=
+header_Size=
+height=H\u00f6he
+help=
+histograma=
+ignore_raster_proj=
+imagen_completa=
+increase=
+increase_statistics=
+incremento_overview=
+info=Information
+informacion_adicional=
+interpolacion=
+layer_without_georref=
+lineal_directo=Direkt- Lineal
+lineas=
+linf_der=X-Wert unten rechts
+ll=
+lr=
+lsup_izq=X-Wert oben links
+maximo=Maximal
+mayor_de=
+media=Mittel
+mediana=
+menor_de=
+metadata=
+metodo=
+minimo=Minimal
+mostrar_estadisticas=
+msg_save_raster=Der Vorgang wurde abgebrochen. M\u00f6chten Sie es noch einmal versuchen?
+mtspixel=Meter/Pixel
+n_intervalos=
+nbandas=
+next_transf=
+no=Nein
+no_driver_escritura=
+no_existe_fichero=
+no_mostrar_la_capa_cuando_la_escala_sea=
+no_puede_abrir_fichero=
+nodata=
+nombre=Name
+nombre_capa=Name des Layers
+nombre_capas=
+not_load=
+npixeles=
+nueva_libreria_title=
+nuevo=Neu
+ocultar_estadisticas=
+onSharpening=Pansharpening aktivieren
+opacidad=Undurchsichtigkeit
+opciones=Optionen
+options=Optionen
+origen=
+origin=
+otras_opciones=
+output_header_format=
+overviews_generating=
+pansharp=
+path=Pfad
+pixeles=Pixel
+poligonos=
+preferencias=Einstellungen
+previsualizacion=Vorschau
+proj_options=
+projection=Projektion
+properties=Eigenschaften
+props=Eigenschaften
+puntos=Punkte
+px=
+py=
+rango_de_escalas=Ma\u00dfstabsbereich
+rasterizando=
+realce=Optimierung\n
+realces=Hervorheben
+recorte=Ausschnitt
+recorte_colas=Zuschnitt der Randbereiche
+recorte_de_colas=
+red=
+regiones_interes=
+reproject=
+reprojecting=
+reset_transf=
+resolucion_espacial=
+resolution=Aufl\u00f6sung
+restablecer=
+RGB=
+rotX=
+rotY=
+ruta=
+rx=
+ry=
+salvando_bloque=
+salvando_raster=
+salvar=Speichern
+salvar_raster=Als Raster sichern
+salvar_raster_geo=
+salvar_transf=
+saveas=
+scale=Skalieren
+seleccion_bandas=
+seleccionar_directorio=
+seleccionar_fichero=Datei ausw\u00e4hlen
+select=Ausw\u00e4hlen
+select_image_geometry=
+selectBandaRefinado=Panchromatische Bandauswahl
+si=ja
+size=Gr\u00f6\u00dfe
+solo_visualizacion=
+statistics_generation=
+stats=
+tablas_color=
+tamano_intervalo=
+tamanyo_celda=
+tamPixX=Pixel Gr\u00f6\u00dfe X
+tamPixY=Pixel Gr\u00f6\u00dfe Y
+tarea_en_progreso=Auftrag wird bearbeitet
+tfw_load=
+time=Zeit
+tipo=Typ
+tipo_dato=Datentyp
+todos_soportados=
+transf=
+transp_by_pixel=
+transp_selection=
+transparencia=Transparenz
+type_of_interleaving=
+ul=
+ur=
+ux=
+uy=
+vecino_+_proximo=
+vectorization=
+width=Breite
+yes=Ja
+Zoom_pixel=Zoom zur Rasteraufl\u00f6sung

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_de.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_eu.properties
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_eu.properties	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_eu.properties	(revision 8183)
@@ -0,0 +1,38 @@
+#Translations for language [eu]
+#Mon Oct 30 09:38:21 CET 2006
+activar=Activate
+brillo=Distira
+brillo_y_contraste=Distira eta kontrastea
+compress=Konpresioa
+confirmacion=Baieztapena
+contraste=Kontrastea
+eliminar_extremos=Ezabatu muturrak
+endinfo=Amaiera estatistikak
+error_file_exists=Fitxategi hau badago. Gainean idaztea nahi duzu?
+error_file_not_writable=Ezin da irteera fitxategirik sortu.
+espere=Itxaron, mesedez
+file=Fitxategia
+height=Altuera
+lineal_directo=Zuzeneko lineala
+linf_der=Inf Der
+lsup_izq=Goi-ezker
+msg_save_raster=Eragiketa utzi egingo da. Jarraitu nahi duzu?
+mtspixel=Mts/pixel
+no=Ez
+onSharpening=Aktibatu pansharpening
+previsualizacion=Aurrebista
+props=Ezaugarriak
+realce=Irtengunea
+realces=
+recorte_colas=Ilarak ebaki
+resolution=Ebazpena
+salvar_raster=Gorde raster geoerreferentziatuan.
+scale=Eskala
+seleccionar_fichero=Hautatu fitxategia
+select=
+selectBandaRefinado=Hautatu fintze-banda
+size=Tamaina
+tarea_en_progreso=Ataza gauzatzen
+time=Denbora
+width=Zabalera
+yes=Bai

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_eu.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_it.properties
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_it.properties	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_it.properties	(revision 8183)
@@ -0,0 +1,40 @@
+#Translations for language [it]
+#Tue Nov 07 12:30:01 CET 2006
+activar=Attiva
+brillo=Luminosit\u00e1
+brillo_y_contraste=Luminosit\u00e0 e Contrasto
+compress=Compressione
+confirmacion=Conferma
+contraste=Contrasto
+eliminar_extremos=Elimina gli estremi
+endinfo=Statistiche di finalizzazione
+error_file_exists=Il file esiste gi\u00e0. Sovrascriverlo?
+error_file_not_writable=Non \u00e8 possibile scrivere il file di output.
+espere=Attendere, per favore
+file=File
+height=Altezza
+lineal_directo=Lineare diretto
+linf_der=X in basso a destra
+lsup_izq=X in alto a sinistra
+msg_save_raster=L'operazione verr\u00e0 cancellata. Continuare?
+mtspixel=Mts/pixel
+no=No
+onSharpening=Attiva pansharpening
+previsualizacion=Anteprima
+props=Propriet\u00e0
+realce=Ottimizzazione
+realces=Ottimizzazione
+recorte_colas=Ritaglio degli estremi
+resolution=Risoluzione
+salvar_raster=Salva raster
+scale=Scala
+seleccionar_fichero=Seleziona file
+select=Seleziona
+selectBandaRefinado=Selettore Bande Pancromatica
+size=Dimensione
+tarea_en_progreso=Lavoro in progresso
+time=Tempo
+width=Larghezza
+yes=Si
+no_statistics_computed=Statistiche non calcolate
+not_defined=Non definito
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_it.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text.properties
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text.properties	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text.properties	(revision 8183)
@@ -0,0 +1,617 @@
+#Translations for language [es]
+#Mon Oct 30 09:38:21 CET 2006
+accept=Aceptar
+apply=Aplicar
+activar=Activar
+addband_error=No se pudo a\u00f1adir las bandas del fichero seleccionado al dataset
+analysisview=Vista de an\u00e1lisis
+ancho_alto=Ancho X Alto
+archivo=Archivo
+bands_panel=Bandas
+bands_number=N\u00famero de bandas
+header_Size=Tama\u00f1o de la cabecera
+file_size_in_bytes=Tama\u00f1o del fichero
+data_type=Tipo de datos
+byte_order=Orden de los bytes
+type_of_interleaving=Tipo de entrelazado
+output_file_too_big=La imagen de salida es demasiado grande.\n Revise los par\u00e1metros.
+output_file_too_big_jpeg2000=Se ha excedido el tama\u00f1o m\u00e1ximo para JPEG2000. \n Revise los par\u00e1metros.
+output_header_format=Formato de la cabecera de salida
+select_image_geometry=Seleccionar la Geometr\u00eda de la imagen
+open_raw_file=Abrir fichero RAW
+brillo=Brillo
+Brightness=Brillo
+brillo_y_contraste=Brillo y Contraste
+de=de
+sharpen=Sharpen
+cancelando=Cancelando
+colores=Ajuste de Colores
+cargar_toc=\u00bfDesea cargar la capa en el TOC?
+center_raster=Centrar la capa raster en la vista
+tfw_load=Cargar georreferenciaci\u00f3n desde fichero tfw
+closeanalysisview=Cerrar vista de analisis
+compress=Compresi\u00f3n
+confirmacion=Confirmaci\u00f3n
+contraste=Contraste
+Contrast=Contraste
+cumulative=Acumulativo
+cumulative_logarithmic=Acumulativo logar\u00edtmico
+elementos=Elementos
+luminosity=Luminosidad
+tolumsa=Balance HSL
+eliminar_extremos=Eliminar extremos
+RemoveEnds=Eliminar extremos
+endinfo=Estadisticas de finalizaci\u00f3n
+error_aplicando_filtro=Error aplicando Filtro
+error_adding_filters=La aplicaci\u00f3n de filtros est\u00e1 \n causando problemas.\n La aplicaci\u00f3n de procesos no tendr\u00e1 efecto\n hasta que se solucione.
+error_render_preview="Error en el renderizado de la previsualizaci\u00f3n."
+error_setview_preview="Error asignando la vista en la previsualizaci\u00f3n."
+error_carga_capa=Error en la carga de la capa.
+error_writing_raster_file=No se puede escribir en la ruta especificada.
+error_georasterwriter=Error en la escritura en GeoRasterWriter.
+error_lectura=No se puede leer en la ruta especificada.
+error_not_suported_extension=No se ha podido obtener el writer. Extensi\u00f3n no soportada
+error_opened_file=El archivo est\u00e1 abierto en alguna vista del proyecto. Cierre la capa antes de sobreescribir.
+error_props_show=La capa est\u00e1 en un estado inconsistente. Es posible que deba esperar a que acabe la operaci\u00f3n en curso.
+error_props_tabs=El panel de propiedades se cerr\u00f3 por falta de pesta\u00f1as.
+error_extensiones_soportadas=Error al obtener la lista de extensiones soportadas. No se puede exportar la capa.
+error_cutting=Se ha producido un error generando el recorte
+error_filtering=Se ha producido un error a\u00f1adiendo los filtros
+error_writer=No se encuentra el writer.
+raster_error_file_exists=El fichero ya existe.\u00bfDesea sobreescribirlo?.
+error_file_not_found=Fichero no encontrado.
+error_file_not_valid=El fichero seleccionado no parece ser valido.
+error_file_not_writable=No es posible crear el fichero de salida.
+error_importando_tabla_color_rmf=El archivo .rmf seleccionado, no contiene tablas de color.
+error_load_layer=No se ha podido cargar la capa en el TOC. Intentelo manualmente.
+error_salvando_rmf=Error escribiendo el fichero rmf
+error_transformacion=Transformaci\u00f3n no valida
+error_transformacion1=No se puede calcular la transformaci\u00f3n inversa de alg\u00fan punto proporcionado
+error_rowtable=Error a\u00f1adiendo fila a la tabla
+error_creando_filtro=Error creando uno de los filtros
+error_lookingfor_view=Vista seleccionada no encontrada.\n No se puede cargar la vista de georreferenciaci\u00f3n.
+error_point_file=El fichero de puntos seleccionado no es v\u00e1lido.
+error_view_not_found=Error: vista no encontrada.
+error_dont_exists_layer=La capa no existe. No es posible mostrar la previsualizaci\u00f3n.
+error_processing=Se ha producido un error en el proceso.\n Este no ha concluido con \u00e9xito.\n (gvSIG.log para m\u00e1s informaci\u00f3n)
+error_roi_not_selected=No hay ROI seleccionada.\n Intente de nuevo la operaci\u00f3n.
+error_rois_table=Error en la tabla de ROIs.
+error_creating_rois=Error creando ROISs.
+escale=Escala
+espectrales=Funciones Espectrales
+interpolando=Interpolando
+salvando_imagen=Salvando imagen
+cancelando_espere=Cancelando. Espere, por favor ...
+radiometricos=Realces radiometricos
+espaciales=Funciones Espaciales
+suavizado=Suavizado
+deteccion_bordes=Detecci\u00f3n bordes
+espere=Por favor, espere
+extension_no_soportada=El formato seleccionado no est\u00e1 soportado.
+file=Archivo
+file_too_big=El raster de entrada es demasiado grande para generar un TIFF con el (> 4GB).\n El resultado de la salida al aplicar el proceso ser\u00e1 comprimido a JPEG2000.
+filtro_de=Filtro de
+formato=Formato
+bmp_file=Archivo BMP
+jpeg_file=Archivo JPEG 
+png_file=Archivo PNG
+tif_file=Archivo TIF
+general_info=Informaci\u00f3n del dataset
+generando_bloque=Generando bloque
+generando_recorte=Generando recorte
+geolocation=Geolocalizaci\u00f3n
+georref=Georreferenciado
+georreferenciacion=Georreferenciaci\u00f3n
+get_tool_focus=Recupera el foco de la herramienta
+green=Verde
+ancho=Ancho
+alto=Alto
+height=Alto
+histogram_error=Error calculando el histograma
+increase=Zoom Cursor
+incremento_recorte=Porcentaje del proceso
+info=Info
+level_slice=Dividir niveles
+leyendo_raster=Leyendo datos raster de entrada. \u00a1Atenci\u00f3n!. Esta operaci\u00f3n puede tardar varios minutos. Por favor, espere ...
+lineal_directo=Lineal directo
+lineas=Lineas
+linf_der=Inf Der
+lsup_izq=Sup Izq
+msg_save_raster=Se va a cancelar la operaci\u00f3n. \u00bfDesea continuar?
+mtspixel=Tama\u00f1o de p\u00edxel
+nbandas=N\u00famero de Bandas
+no=No
+no_driver_escritura=No se puede obtener el driver de escritura. El raster no ha sido salvado.
+onSharpening=Activar pansharpening
+opacidad=Opacidad
+poligonos=Poligonos
+previsualizacion=Previsualizaci\u00f3n
+preview_not_available=La previsualizaci\u00f3n no est\u00e1 disponible. La capa no ha podido clonarse.
+props=Propiedades
+puntos=Puntos
+rasterizando=Rasterizando
+realce=Realce
+realces=Realces
+red=Rojo
+recorte_de_colas=Recorte de colas (%)
+TailTrim=Recorte de colas (%)
+resolution=Resoluci\u00f3n
+salvando_bloque=Salvando bloque
+salvar_raster_geo=Salvar vista a raster georreferenciado
+salvar_rois=Salvar ROIs a un fichero shp
+salvando_raster=Salvar a raster
+saveas=Salvar Como
+scale=Escalar
+seleccionar_capas_raster=Seleccionar capas r\u00e1ster
+seleccionar_fichero=Seleccionar fichero
+select=Seleccionar
+selectBandaRefinado=Seleccionar Banda de Refinado
+si=S\u00ed
+size=Tama\u00f1o
+standard=Est\u00e1ndar
+tarea_en_progreso=Tarea En progreso
+tipo_dato=Tipo de dato
+transparencia=Transparencia
+transp_by_pixel=Transparencia por pixel
+transp_selection=Transparencia por selecci\u00f3n
+time=Tiempo
+width=Ancho
+yes=S\u00ed
+coor_geograficas=Coordenadas geogr\u00e1ficas
+tamPixX=Tama\u00f1o pixel X
+tamPixY=Tama\u00f1o pixel Y
+coor_right=Derecha
+coor_up=Arriba
+coor_left=Izquierda
+coor_down=Abajo
+coor_center=Centro
+metadata=Metadatos
+origin=Origen
+histograma=Histograma
+histograms=Histogramas
+datos_visualizados=Datos visualizados
+vista_datasource=Extensi\u00f3n de la vista
+imagen_completa=Completo
+normal=Normal
+accumulated=Acumulado
+logaritmic=Logar\u00edtmico
+band=Banda
+generando_histograma=Generando histograma, por favor, espere
+calculando_histograma=Calculando histograma
+ocultar_estadisticas=Ocultar estad\u00edsticas
+mostrar_estadisticas=Mostrar estad\u00edsticas
+boton_mostrar=Mostrar todos
+boton_limpiar=Limpiar
+recorte=Recortar capa raster
+coordenadas_pixel=Coordenadas Pixel
+sup_izq=Sub. Izq.
+inf_der=Inf. Der.
+coordenadas_reales=Coordenadas Reales
+fullExtent=Extent completo de la capa raster
+select_tool=Seleccionar desde la vista
+contraer=Contraer
+expandir=Expandir
+resolucion_espacial=Resoluci\u00f3n
+tamanyo_celda=Tama\u00f1o de celda
+ancho_x_alto=Ancho x Alto
+celda=Celda
+vecino_+_proximo=Vecino m\u00e1s pr\u00f3ximo
+bilinear=Bilinear
+distancia_inversa=Distancia Inversa
+bicubico=Bic\u00fabico
+b_splines=B-Spline
+seleccion_bandas=Bandas
+crear_1_capa_por_banda=Crear una capa por banda
+otras_opciones=Opciones
+name=Nombre
+nombre_capas=Nombre de las capas
+nombre_capa=Nombre capa
+cargar_en_toc=Cargar las capas en el TOC
+seleccionar_directorio=Seleccionar un directorio
+coordenadas_recorte=Coordenadas
+guardar_en_disco=Guardar en disco autom\u00e1ticamente
+guardar_predeterminado=Guardar como predeterminado
+calculando_estadisticas=Calculando estad\u00edsticas
+estadisticas_calculadas=Estad\u00edsticas calculadas.
+vista_previa=Vista previa
+aplicar_capa=Aplicar en capa
+aplicar_vista_previa=Aplicar en vista previa
+filtros=Filtros RGB
+solo_visualizacion=Solo en visualizaci\u00f3n
+generar_fichero=Generar fichero
+abrir_memoria=Abrir en memoria
+capa_nueva=Capa nueva
+enabled=Activo
+brightness=Brillo
+contrast=Contraste
+enhanced=Realce
+enhanced_rad=Realces Radiom\u00e9tricos
+rgbtohsl=RGB->HSL
+hsltorgb=HSL->RGB
+rgbtocmyk=RGB->CMYK
+cmyktorgb=CMYK->RGB
+colorbalancecmy=Balance CMY
+colorbalancergb=Balance RGB
+sobel=Sobel
+roberts=Roberts
+prewitt=Prewitt
+freichen=Freichen
+median=Median
+moda=Moda
+pasobajo=Paso bajo
+pasoalto=Paso alto
+gauss=Gauss
+personalizado=Personalizado
+aplicando_filtros=Aplicando filtros
+guardando_capa=Guardando capa
+ruta=Directorio
+cambiar_ruta=Cambiar...
+transparencia=Transparencia
+tablas_color=Tablas de color
+transparencia=Transparencia
+pansharp= Pansharp
+ul=Superior izquierda
+ur=Superior derecha
+lr=Inferior derecha
+ll=Inferior izquierda
+regiones_interes=Regiones de Inter\u00e9s
+rotX=Rotaci\u00f3n en X
+rotY=Rotaci\u00f3n en Y
+ux=X
+uy=Y
+px=Pix X
+py=Pix Y
+rx=Rot X
+ry=Rot Y
+geolocation=Geolocalizaci\u00f3n
+error_transformacion=Error en los par\u00e1metros de transformaci\u00f3n
+salvar_transf=Salvar transformaci\u00f3n actual como predeterminada del raster
+back_transf=Ir a transformaci\u00f3n anterior
+next_transf=Ir a transformaci\u00f3n siguiente
+aplicar_transf=Aplica transformaci\u00f3n introducida en las cajas de texto
+first_transf=Ir a la primera transformaci\u00f3n
+reset_transf=Inicializar con la transformaci\u00f3n en disco
+aviso_write_transform=Se va a sobreescribir la georreferenciaci\u00f3n actual del fichero.\u00bfDesea continuar?
+aviso_salir_salvando=Se han producido cambios en la georreferenciaci\u00f3n de la imagen. \u00bfDesea salvarlos y sobreescribir la georrefenciaci\u00f3n del fichero?
+tabla=Tabla
+rampa=Rampa
+interpolado=Interpolado
+activar_tablas_color=Activar Tablas de color
+tabinterpolated_color=Color
+comprimir_paleta=La paleta se puede comprimir. \u00bfDeseas hacerlo?
+tabla_actual=Tabla actual
+desea_guardar_cambios=\u00bfDesea guardar los cambios?
+desea_borrar_librerias=\u00bfDeseas borrar las librer\u00edas seleccionadas?
+nueva_libreria=Nueva_libreria
+nueva_libreria_title=Nueva librer\u00eda
+duplicar_libreria=Duplicar librer\u00eda
+libreria=Librer\u00eda
+minimo=M\u00ednimo
+maximo=M\u00e1ximo
+minimoRGB=M\u00ednimo RGB
+maximoRGB=M\u00e1ximo RGB
+varianza=Varianza
+media=Media
+ajustar_limites=Ajustar l\u00edmites
+limites=L\u00edmites
+guardar_como_predeterminado=\u00bfRealmente desea guardar la tabla de color actual como tabla predeterminada del fichero?
+nombre=Nombre
+borrar_libreria=Borrar librer\u00eda
+interpolacion=Interpolaci\u00f3n
+restablecer=Restablecer
+tamano_intervalo=Tama\u00f1o de intervalo
+n_intervalos=N\u00famero de intervalos
+confirmar=Confirmar
+addlibrary_supera_limite=El n\u00famero de cortes generados es elevado, puede tardar m\u00e1s tiempo del esperado. \u00bfRealmente desea continuar?
+equidistar=Equidistar
+escala_minima=Escala m\u00ednima
+escala_maxima=Escala m\u00e1xima
+rango_de_escalas=Rango de escalas
+no_mostrar_la_capa_cuando_la_escala_sea=No mostrar la capa cuando la escala sea
+menor_de=Menor de
+mayor_de=Mayor de
+scale_panel=Escala
+no_existe_fichero=No existe el archivo
+el_fichero=El archivo
+esta_formato_desconocido=est\u00e1 en un formato no reconocido.
+no_puede_abrir_fichero=No se puede abrir el archivo
+error_abrir_fichero=Error al abrir el archivo
+informacion_adicional=Informacion adicional
+files=Archivos
+todos_soportados=Todos los soportados
+export_libreria=Exportar librer\u00eda
+valor_general=Valor general
+transparente=Transparente
+activar_uso_nodata=Activar el uso de NoData
+tratar_nodata_transparente=Tratar los valores NoData como transparentes
+nodata=NoData
+import_libreria=Importar librer\u00eda
+overviews_generating=Generando piramide
+incremento_overview=Incremento en la generaci\u00f3n de overviews
+generar_overviews=Generar overviews
+sobreescribir_datos_overview= El proceso de generar overviews puede<BR>sobreescribir el raster dependiendo del<BR>formato.\u00bfDesea continuar?
+sobreescribir_overviews=La imagen ya tiene overviews.<BR>\u00bfDesea sobreescribirlas?
+layer_without_georref=La capa no tiene georreferenciaci\u00f3n.<BR> \u00bfDesea introducirla manualmente?
+num_overviews=N\u00ba overviews
+algorithm=Algoritmo
+overviews=Overviews
+proporcion_overviews=Proporci\u00f3n
+generacion_overviews=Generaci\u00f3n de overviews al cargar el raster
+vecino_cercano=Vecino + cercano
+media=Media
+media_phase=Media Mag/Phase
+cache=Cache
+preference_cache_warning=<html><center><b>ATENCI\u00d3N: Solo tocar esta secci\u00f3n si est\u00e1 seguro de lo que est\u00e1 haciendo</b></center></html>
+tamanyo=Tama\u00f1o
+tamanyo_max_tilecache=Tama\u00f1o m\u00e1ximo tile cache
+paginas_grupo=Paginas x Grupo
+tamanyo_pagina=Tama\u00f1o p\u00e1gina
+bloques_procesos=Bloques procesos
+rutas=Rutas
+temporales=Temporales
+general=General
+num_clases=N\u00ba de clases
+previsualizar_automaticamente_raster=Previsualizar autom\u00e1ticamente al cambiar las propiedades de raster
+pedir_coordenadas_georreferenciacion=Pedir las coordenadas al cargar un raster que no tiene georreferenciaci\u00f3n
+ask_for_projection=Pedir opciones de projecci\u00f3n al cargar un raster con proyecci\u00f3n distinta a la vista
+carga_capas=Carga de capas
+tabla_color=Tabla de color
+loadlayer_aplicar=Al cargar un MDT, aplicarle
+global=Global
+capa=Capa
+nodata_modificado_continuar=El valor NoData predeterminado de la capa raster va a ser modificado. \u00bfDesea continuar?
+transf=Transformaci\u00f3n
+corners=Esquinas
+increase_statistics=Incremento del calculo de estad\u00edsticas
+stats=Estad\u00edsticas
+statistics_generation=Generando estad\u00edsticas
+recalc_stats=Recalcular estad\u00edsticas
+affine_algorithm=Transformaci\u00f3n af\u00edn
+polynomial_algorithm=Transformaci\u00f3n polinomial
+georef_type=Tipo de georreferenciaci\u00f3n
+georef_file=Fichero a georreferenciar
+georef_algorithm=Algoritmo de georreferenciaci\u00f3n
+without_map=Sin cartograf\u00eda de referencia
+with_map=Con cartograf\u00eda de referencia
+layer_not_loaded=No hay cargada una capa valida. Por favor, seleccione una capa raster.
+full_view=Zoom completo
+prev_zoom=Zoom anterior
+select_zoom_area=Zoom por selecci\u00f3n de \u00e1rea
+zoom_menos=Decrementar el nivel de zoom
+zoom_mas=Incrementar el nivel zoom
+Umbral=Umbral
+Compare=Compare
+LadoVentana=Lado de la ventana
+Agudeza=Agudeza
+color_interpretation_continue=Se va a cambiar la interpretaci\u00f3n de color por defecto para su raster. \u00bfDesea continuar?
+regionalpha=Regiones transparentes
+combinacion_no_asignable=No es posible guardar esa combinaci\u00f3n de bandas por defecto.\n Una banda solo puede tener una interpretaci\u00f3n de color.
+end_georef=Finalizar georreferenciaci\u00f3n.
+ask_end_georef=\u00bfDes\u00e9a finalizar la aplicaci\u00f3n de georreferenciaci\u00f3n?
+no_rows=No hay entradas en la tabla de puntos.
+no_rows_selected=No hay entradas seleccionadas en la tabla de puntos.
+table_not_initialize=Tabla no inicializada
+capa_raster=Capa Raster
+process_raster=Procesos Raster
+geo_raster=GeoRaster
+show_number=Mostrar el n\u00famero del punto de control gr\u00e1ficamente
+add_errors_csv=A\u00f1adir los errores al fichero CSV
+center_view=Centrar las vistas al punto seleccionado.
+error_set_view=Error asignando los par\u00e1metros para cargar la vista.
+no_selected_points=No se puede centrar la vista a un punto.\n No hay puntos seleccionados. 
+value_not_valid=Valor de la celda no v\u00e1lido.
+nodatavalue_not_valid=Valor introducido no valido. Se elimina el valor NoData de la capa. 
+georef_loading=Cargando m\u00f3dulo de georreferenciaci\u00f3n
+move_image=Desplazamiento
+add-point=A\u00f1adir punto
+process=Procesar
+save_to_xml=Salvar puntos de control en el fichero de metadatos adjunto al raster
+load_from_xml=Cargar puntos de control del fichero de metadatos adjunto al raster
+save_to_ascii=Salvar puntos de control en fichero de texto CSV
+load_from_ascii=Cargar puntos de control desde un fichero de texto CSV
+eliminar_puntos=Esta operaci\u00f3n eliminar\u00e1 todos los puntos \nque haya actualmente en su tabla.\n\u00bfDesea continuar?
+raster_export=Exportar Raster
+transformaciones_geograficas=Transformaciones geogr\u00e1ficas
+sobreescribir_puntos=\u00bfEsta operaci\u00f3n eliminar\u00e1 los puntos de control\n que pudiera tener almacenados junto a la imagen.\n\u00bfDesea continuar?
+start_save=Puede comenzar la selecci\u00f3n de un \u00e1rea sobre la vista. 
+input_hist=Entrada
+output_hist=Salida
+clip=Recorte
+levels=Niveles
+operation=Operaci\u00f3n
+band=Banda
+drawing_type=Dibujado
+histogram_type=Tipo
+range_wrong=Rango de valores equivocado.\n
+select_rgb=Seleccionar RGB pinchando en la vista
+mascaras=Mascaras
+value=Valor
+inversa=Inversa
+logarithmical=Logar\u00edtmica
+exponential=Exponencial
+rois_needed=<html><b>Aviso:</b> Es necesaria alguna ROI para la<BR> aplicaci\u00f3n de este filtro. Vaya al cuadro<BR> de selecci\u00f3n de \u00e1reas de inter\u00e9s y cree al<BR> menos una</html>.
+adjust_to_rois=Ajustar a la extensi\u00f3n m\u00e1xima de las ROIs de la capa.
+square_root=Ra\u00edz cuadrada
+pow=Cuadrado 
+apply_all=Aplicar la opci\u00f3n a todos los ficheros
+not_load=No cargar la capa
+ignore_raster_proj=Usar la proyecci\u00f3n de la vista en el raster y cargar
+reproject=Reproyectar raster con proyecci\u00f3n de la vista
+change_view_proj=Cambiar la proyecci\u00f3n de la vista a la del raster
+proj_options=Opciones de proyecci\u00f3n
+dif_proj=La proyecci\u00f3n del raster seleccionado no coincide con la<br>de la vista. Seleccione una opci\u00f3n.
+desactivado=Desactivado
+color=Color
+clase=Clase
+valor=Valor
+hasta=Final
+alpha=Alpha
+anadir_filtro=A\u00f1adir Filtro
+eliminar_filtro=Eliminar Filtro
+stats=Estad\u00edsticas
+select_proj=Seleccionar proyecci\u00f3n
+src_proj=Proyecci\u00f3n de origen
+dest_proj=Proyecci\u00f3n de destino
+reprojecting=Reproyectando
+error_reprojecting=Error reproyectando
+dest_file=Fichero de destino
+capa_a_reproyectar=Capa a reproyectar
+toc_reproject=Reproyectar capa
+layer=Capa
+ask_generar_overviews=\u00bfDesea generar las overviews?
+error_create_overviews=No se han podido crear las overviews
+error_write_overviews=No se han podido guardar las overviews
+highpassfilter=Filtro Paso alto
+radio=Radio
+noisefilter=Filtro de Ruido
+grayescaleconversion=Conversi\u00f3n a escala de grises
+outputscale=Escala de salida
+path=Ubicaci\u00f3n
+porarea=Selecci\u00f3n por \u00e1rea
+porroi=Selecci\u00f3n por regi\u00f3n de inter\u00e9s
+vectbbox=Vectorizar la bounding box completa
+vectinside=Nodata en todos los valores exteriores a las regiones
+selectROI=Seleccionar ROI
+vectorization=Vectorizaci\u00f3n
+prev=Anterior
+posterization=Posterizaci\u00f3n
+panel_preview_not_available=Previsualizaci\u00f3n no disponible para este panel
+nograyscale=No ha sido posible a\u00f1adir\n filtro de conversi\u00f3n a escala de grises
+noposterization=No ha sido posible a\u00f1adir\n filtro de posterizaci\u00f3n
+threshold=Umbral
+selectarea=Selecci\u00f3n
+grayconversionscale=Conversi\u00f3n B/W
+vectorization=Vectorizaci\u00f3n
+vector_generation=Generaci\u00f3n de vectores
+clip_raster_again=\u00bfDes\u00e9a realizar el recorte nuevamente?
+filter_raster_again=\u00bfDes\u00e9a aplicar el preproceso nuevamente?
+modefilter=Filtro de moda
+nomedian=No ha sido posible a\u00f1adir\n filtro de mediana
+loadstretch=Cargar intervalos
+stretch=Tramos
+datatype_not_byte=\u00bfDesea un selecci\u00f3n por rango de valores?
+grayscaleconversion=Escala de grises
+path_not_valid=Ruta no v\u00e1lida
+source_too_big=La capa fuente es demasiado grande.\n\u00bfDesea continuar?
+load_parameters=Cargar par\u00e1metros
+save_parameters=Salvar par\u00e1metros
+equalization=Ecualizaci\u00f3n
+memoria_excedida=No hay bastante memoria para esta operaci\u00f3n.\n Pruebe a modificar los par\u00e1metros de la JVM \n o generar una imagen m\u00e1s peque\u00f1a.
+red=Rojo
+hue=Matiz
+blue=Azul
+cyan=Cian
+gray=Grises
+magenta=Magenta
+yellow=Amarillo
+black=Negro
+corner_threshold=Umbral de esquina
+curve_optimization=Optimizaci\u00f3n de curva
+despeckle=Refinado
+left=Izquierda
+majority=Mayor\u00eda
+minority=Minor\u00eda
+optimization_tolerance=Tolerancia de optimizaci\u00f3n
+output_quantization=Cuantizaci\u00f3n de la salida
+policy=Pol\u00edtica
+potracelines=Par\u00e1metros de Potrace
+random=Aleatorio
+right=Derecha
+white=Blanco
+wrong_resolution=Debe definir la resoluci\u00f3n del raster de salida.\n Ancho y alto en p\u00edxeles.
+downloading_image=Descargando imagen desde el servidor.\n Esta operaci\u00f3n puede llevar unos minutos.
+remember_select_size=\u00a1IMPORTANTE!.\nRecuerda asignar el tama\u00f1o de imagen de salida
+tilecache_struct=Estructura de directorios
+res_levels=Niveles de resoluci\u00f3n
+tilesize=Tama\u00f1o de tile
+remove_cache=Borrar cach\u00e9
+path_tilecache=Ruta a los ficheros de la cach\u00e9
+path_not_exists=El directorio no existe
+open_files=El directorio de cach\u00e9 no puede ser eliminado.\n No debe tener ficheros abiertos. Cierre todas las capas.
+remove_directory=\u00bfDesea borrar el directorio de cach\u00e9?
+no_resolution_level=La capa seleccionada no es tileada con niveles de resoluci\u00f3n.\nNo se puede aplicar este zoom.
+max_zoom_reached=M\u00e1ximo nivel de zoom alcanzado
+min_zoom_reached=M\u00ednimo nivel de zoom alcanzado
+there_arent_selected=No hay una capa con niveles de resoluci\u00f3n seleccionada
+goto_resolution_level=Ir al siguiente/anterior nivel de resoluci\u00f3n
+colortables_not_loaded=El cuadro de tablas de color no puede ser abierto
+error_computing_histogram=Error calculando el histograma
+nbandas_file=Bandas en fichero
+tipo_proveedor=Tipo de proveedor
+file_exists_rename=El fichero existe y ser\u00e1 renombrado
+guardar_box_value=Salvar como NoData el valor seleccionado en la caja de texto
+restore=Restaurar
+restore_native_value=Restaurar el valor NoData original del r\u00e1ster
+default_value=Valor por defecto
+set_configuration_value=Asignar el valor NoData por defecto en la configuraci\u00f3n de gvSIG
+delete=Eliminar
+delete_value=Eliminar valor NoData de la imagen
+tratar_nodata_transparente=Tratar valor NoData como transparente
+value_not_valid=Valor no valido para un valor NoData
+round_pixels=Redondear p\u00edxeles
+tiled_layer=\u00bfDeseas usar la cach\u00e9 de tiles con las capas seleccionadas?
+tiled_layer2=\u00bfDeseas cargar las capas de forma normal o cacheando datos en forma de teselas?
+normally=Normal
+tiled=Teseladas
+all_normally=Todas normal
+all_tiled=Todas teseladas
+yes_dont_ask_anymore=Si a todas
+no_dont_ask_anymore=No a todas
+open_window=Ya existe un inspector de p\u00edxeles abierto.\n Cierre la ventana antes de continuar
+info=Informaci\u00f3n
+view=Vista
+layer_list=Lista de capas
+band_values=Valores por banda
+pixel_point=Pixel
+view_point=Vista
+world_point=Mapa
+bands=Bandas
+colors=Colores
+coords=Coordenadas
+lat=Latitud
+long=Longitud
+red=Rojo
+green=Verde
+blue=Azul
+infobypoint=Informaci\u00f3n por punto
+export_view_to_image=Exportar vista a imagen
+resolution_method_selection=Metodo de selecci\u00f3n de resoluci\u00f3n
+reproject_on_the_fly=Reproyectar al vuelo
+colortable_not_active=Las tablas de color est\u00e1n deshabilitadas para esta capa. Estas se eliminar\u00e1n de la capa si no las activa.
+change_datatype=Cambiar tipo de dato
+output_too_big=Tama\u00f1o de fichero de salida muy grande
+some_parameter_is_not_correct=Alg\u00fan par\u00e1metro no es correcto. Revise el dialogo.
+filename_cannot_be_empty=El nombre de fichero no puede estar vacio
+scale_cannot_be_zero=La escala no puede ser cero
+height_cannot_be_zero=La altura no puede ser cero
+width_cannot_be_zero=El ancho no puede ser cero
+cellsize_cannot_be_zero=El tama\u00f1o de celda no puede ser cero
+wc_wrong=Coordenadas del mundo erroneas
+different_projection=La vista y alguna de las capas cargadas tienen proyecciones distintas.\n A la capa resultante se le asignar\u00e1 la proyecci\u00f3n de la vista.
+clip_view=Recortar vista
+overwrite_projection=La proyecci\u00f3n de la capa, en su fichero de metadatos (RMF) ser\u00e1 sobreescrita con la de la vista. \u00bfDesea continuar?
+set_view_projection=Asignar proyecci\u00f3n
+error_saving_rois_rmf=Error salvando las ROI en el fichero de metadatos
+problems_loading_rois=Problemas cargando el fichero de ROI.\n La ejecuci\u00f3n de la aplicaci\u00f3n seguir\u00e1 normalmente.
+remove_roi_file_link=\u00bfQuieres eliminar el enlace al fichero de ROIs? El fichero no se borrar\u00e1
+folder_not_writable=La capa seleccionada est\u00e1 en un directorio sin permiso de escritura. Por favor, seleccione un directorio donde pueda escribir para salvar metadatos.
+folder=Directorio
+folder_not_writable1=Directorio sin permiso de escritura
+view_not_active=La ventana activa no es una vista
+grayscale=Escala de grises
+typeBand=Bandas
+gv_tools=gvSIG Herramientas
+group_tools=Capas raster
+raster_layer_not_active=Esta herramienta necesita una capa raster seleccionada en la vista
+radiometric_enhancedment=Realce radiom\u00e9trico
+reprojection=Reproyecci\u00f3n
+filters=Filtros
+clip_raster=Recortar
+save_as=Exportar
+overviews=Overviews
+layer_datatype=Cambiar tipo de dato
+no_statistics_computed=Estadisticas no calculadas
+not_defined=No definido
+photometric=Fotom\u00e9trico
+interleave=Entrelazado
+compression=Compresi\u00f3n

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_zh.properties
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_zh.properties	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_zh.properties	(revision 8183)
@@ -0,0 +1,38 @@
+#Translations for language [en]
+#Fri Nov 03 13:14:56 CET 2006
+activar=\u6fc0\u6d3b
+brillo=\u4eae\u5ea6
+brillo_y_contraste=\u4eae\u5ea6\u548c\u5bf9\u6bd4\u5ea6
+compress=\u538b\u7f29
+confirmacion=\u786e\u8ba4...
+contraste=\u5bf9\u6bd4\u5ea6
+eliminar_extremos=\u64a4\u9664\u8fb9\u7f18
+endinfo=\u6700\u540e\u7edf\u8ba1
+error_file_exists=\u6587\u4ef6\u5df2\u5b58\u5728\u3002\u8981\u66ff\u6362\u5b83\u5417\uff1f
+error_file_not_writable=\u65e0\u6cd5\u521b\u5efa\u8f93\u51fa\u6863\u6848\u3002
+espere=\u8bf7\u7b49\u5f85
+file=\u6587\u4ef6
+height=\u9ad8\u5ea6
+lineal_directo=\u76f4\u63a5\u7ebf\u65b9\u6cd5
+linf_der=\u53f3\u4e0b\u65b9
+lsup_izq=\u5de6\u4e0a\u65b9
+msg_save_raster=\u64cd\u4f5c\u5c06\u88ab\u53d6\u6d88\u3002\u60a8\u8981\u7ee7\u7eed\u5417?
+mtspixel=\u7c73/\u50cf\u7d20
+no=\u5426
+onSharpening=\u6fc0\u6d3b pansharpening
+previsualizacion=\u9884\u89c8
+props=\u5c5e\u6027
+realce=\u589e\u5f3a
+realces=\u589e\u5f3a
+recorte_colas=\u526a\u5207\u5c3e\u90e8
+resolution=\u89e3\u6790
+salvar_raster=\u53e6\u5b58\u4e3a raster
+scale=\u6bd4\u4f8b
+seleccionar_fichero=\u9009\u62e9\u6587\u4ef6
+select=\u9009\u62e9
+selectBandaRefinado=\u9009\u62e9\u7ec6\u5fae\u6ce2\u6bb5
+size=\u5927\u5c0f
+tarea_en_progreso=\u8fd0\u884c\u4e2d
+time=\u65f6\u95f4
+width=\u5bbd\u5ea6
+yes=\u662f

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin/text_zh.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources-plugin
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main/resources
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src/main
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/src
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/pom.xml
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/pom.xml	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/pom.xml	(revision 8183)
@@ -0,0 +1,217 @@
+<?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.tools.app.basic</artifactId>
+	<packaging>jar</packaging>
+	<name>Tools: Raster tools</name>
+	<description>This package contains basic tools for raster:
+
+    * Raster properties
+    * clipping
+    * histograms
+    * filters</description>
+	<parent>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.raster.tools</artifactId>
+      <version>2.2.62</version>
+    </parent>
+    
+	<dependencies>
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.raster.app.common</artifactId>
+            <scope>compile</scope>
+        </dependency>	
+		<dependency>
+           <groupId>com.sun</groupId>
+           <artifactId>jimi</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.app.mainplugin</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.app.document.table.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.fmap</artifactId>
+            <scope>compile</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.fmap.control</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.utils</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.ui</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.symbology.lib.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.symbology.lib.impl</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.metadata.lib.basic.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.raster.tools.algorithm.saveraster</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.algorithm</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.tools.algorithm.swing.api</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.tools.algorithm.swing.impl</artifactId>
+            <scope>runtime</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.tools.algorithm.layerdatatype</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.andami</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.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.projection.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.projection.cresques.impl</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.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.geoprocess.lib.sextante</artifactId>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.geoprocess.app.mainplugin</artifactId>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.tools.toolbox.algorithm</artifactId>
+			<scope>compile</scope>
+		</dependency>
+	</dependencies>
+	<properties>
+   		<gvsig.package.info.dependencies>required: org.gvsig.raster.tilecache.app -ge 2</gvsig.package.info.dependencies>
+   		<gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/Raster/pool</gvsig.package.info.poolURL>
+   		<gvsig.package.info.categories>Raster</gvsig.package.info.categories>
+   		<gvsig.package.info.state>final</gvsig.package.info.state>
+   		<gvsig.package.info.official>true</gvsig.package.info.official>
+	</properties>
+</project>

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/buildNumber.properties
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/buildNumber.properties	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/buildNumber.properties	(revision 8183)
@@ -0,0 +1,2 @@
+#Thu Sep 28 20:10:43 CEST 2017
+buildNumber=113

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic/buildNumber.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.app.basic
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath
target


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/src/main/java/org/gvsig/raster/tools/algorithm/TestMaskthreholdOutPutLayerReplicate.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/src/main/java/org/gvsig/raster/tools/algorithm/TestMaskthreholdOutPutLayerReplicate.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/src/main/java/org/gvsig/raster/tools/algorithm/TestMaskthreholdOutPutLayerReplicate.java	(revision 8183)
@@ -0,0 +1,144 @@
+package org.gvsig.raster.tools.algorithm;
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public 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.io.File;
+
+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.RasterManager;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+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.exceptions.LoadLayerException;
+import org.gvsig.raster.cache.tile.impl.TileCacheDefaultImplLibrary;
+import org.gvsig.raster.fmap.layers.DefaultFLyrRaster;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.gdal.io.DefaultGdalIOLibrary;
+import org.gvsig.raster.impl.RasterDefaultImplLibrary;
+import org.gvsig.raster.tools.algorithm.base.RasterBaseAlgorithmLibrary;
+import org.gvsig.raster.tools.algorithm.base.process.ProcessException;
+import org.gvsig.raster.tools.algorithm.base.process.RasterProcess;
+import org.gvsig.raster.tools.algorithm.maskthreshold.MaskthresholdAlgorithmLibrary;
+import org.gvsig.raster.tools.algorithm.maskthreshold.MaskthresholdProcess;
+import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
+
+/**
+ * @author gvSIG Team
+ * @version $Id$
+ *
+ */
+@SuppressWarnings("unused")
+public class TestMaskthreholdOutPutLayerReplicate {
+	private static int pos = 5;
+	
+	private static String file1 = "/home/nacho/images/PNOA/PNOA06-08/2006_clip.tif";
+	private static String file2 = "/home/nacho/images/PNOA/PNOA06-08/2006_NDVI.tif";
+    public static DataManager datamanager = DALLocator.getDataManager();
+    public FLyrRaster lyr = null;
+    private RasterManager rManager = RasterLocator.getManager();
+    private int[] drawableBands = { 0, 1, 2 };
+
+    public static void main(String[] args) {
+    	try {
+    		new DefaultLibrariesInitializer().fullInitialize(true);
+    	} catch(Exception e) {
+    		e.printStackTrace();
+    	}
+    	new TileCacheDefaultImplLibrary();
+		new RasterDefaultImplLibrary();
+		new DefaultGdalIOLibrary();
+		new MaskthresholdAlgorithmLibrary().doPostInitialize();
+    	new TestMaskthreholdOutPutLayerReplicate().start();
+    }
+    
+    public void start() {
+        FLyrRaster lyr1 = null;
+        FLyrRaster lyr2 = null;
+        FLyrRaster lyr3 = null;
+		try {
+			lyr1 = createLayerRaster("Input1", new File(file1));
+			lyr2 = createLayerRaster("Input2", new File(file2));
+			lyr3 = createLayerRaster("Input3", new File(file1));
+	        
+			RasterProcess task;
+			try {
+				task = RasterBaseAlgorithmLibrary.getManager().createRasterTask("MaskthresholdProcess");
+			} catch (ProcessException e1) {
+				e1.printStackTrace();
+				return;
+			}
+			
+	        task.addParam(MaskthresholdProcess.RASTER_STORE1, lyr1.getDataStore());
+	        task.addParam(MaskthresholdProcess.RASTER_STORE2, lyr2.getDataStore());
+	        task.addParam(MaskthresholdProcess.RASTER_STORE3, lyr3.getDataStore());
+	        task.addParam(MaskthresholdProcess.PATH, "/tmp/MaskthreholdTest.tif");
+	        task.addParam(MaskthresholdProcess.THRESHOLD, 0);
+	        task.addParam(MaskthresholdProcess.BAND1, 0);
+	        task.addParam(MaskthresholdProcess.BAND2, 0);
+	        task.addParam(MaskthresholdProcess.BAND3, -1); //Las salida ser� de todas las bandas del datastore 3
+	        task.addParam(MaskthresholdProcess.OPERATION, 0);
+	        task.addParam(MaskthresholdProcess.SATISFY_METHOD, 4);
+	        task.execute();
+		} catch (LoadLayerException e) {
+			e.printStackTrace();
+		} catch (ProcessException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+    }
+
+    @SuppressWarnings("deprecation")
+	public FLyrRaster createLayerRaster(String layerName, File file)
+        throws LoadLayerException {
+        ProviderServices provServ =
+            RasterLocator.getManager().getProviderServices();
+        RasterDataParameters storeParameters =
+            provServ.createParameters(file.getName());
+        storeParameters.setURI(file.getPath());
+
+        DataManager dataManager = DALLocator.getDataManager();
+        DataStore dataStore = null;
+        try {
+            dataStore = dataManager.createStore(storeParameters);
+        } catch (ValidateDataParametersException e) {
+            throw new LoadLayerException("Error al cargar la capa.");
+        } catch (InitializeException e) {
+            throw new LoadLayerException("Error al cargar la capa.");
+        } catch (ProviderNotRegisteredException e) {
+            throw new LoadLayerException("Error al cargar la capa.");
+        }
+
+        DefaultFLyrRaster lyr = new DefaultFLyrRaster();
+        lyr.setName(layerName);
+        lyr.setDataStore(dataStore);
+        return lyr;
+    }
+
+}

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/src/main/java/org/gvsig/raster/tools/algorithm/TestMaskthreholdOutPutLayerThreshold.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/src/main/java/org/gvsig/raster/tools/algorithm/TestMaskthreholdOutPutLayerThreshold.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/src/main/java/org/gvsig/raster/tools/algorithm/TestMaskthreholdOutPutLayerThreshold.java	(revision 8183)
@@ -0,0 +1,140 @@
+package org.gvsig.raster.tools.algorithm;
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public 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.io.File;
+
+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.RasterManager;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+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.exceptions.LoadLayerException;
+import org.gvsig.raster.cache.tile.impl.TileCacheDefaultImplLibrary;
+import org.gvsig.raster.fmap.layers.DefaultFLyrRaster;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.gdal.io.DefaultGdalIOLibrary;
+import org.gvsig.raster.impl.RasterDefaultImplLibrary;
+import org.gvsig.raster.tools.algorithm.base.RasterBaseAlgorithmLibrary;
+import org.gvsig.raster.tools.algorithm.base.process.ProcessException;
+import org.gvsig.raster.tools.algorithm.base.process.RasterProcess;
+import org.gvsig.raster.tools.algorithm.maskthreshold.MaskthresholdAlgorithmLibrary;
+import org.gvsig.raster.tools.algorithm.maskthreshold.MaskthresholdProcess;
+import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
+
+/**
+ * Extracts vegetation using NDVI
+ */
+@SuppressWarnings("unused")
+public class TestMaskthreholdOutPutLayerThreshold {
+	private static int pos = 5;
+	
+	private static String file1 = "/home/nacho/images/PNOA/PNOA06-08/2006_clip.tif";
+	private static String file2 = "/home/nacho/images/PNOA/PNOA06-08/2006_NDVI.tif";
+    public static DataManager datamanager = DALLocator.getDataManager();
+    public FLyrRaster lyr = null;
+    private RasterManager rManager = RasterLocator.getManager();
+    private int[] drawableBands = { 0, 1, 2 };
+
+    public static void main(String[] args) {
+    	try {
+    		new DefaultLibrariesInitializer().fullInitialize(true);
+    	} catch(Exception e) {
+    		e.printStackTrace();
+    	}
+    	new TileCacheDefaultImplLibrary();
+		new RasterDefaultImplLibrary();
+		new DefaultGdalIOLibrary();
+		new MaskthresholdAlgorithmLibrary().doPostInitialize();
+    	new TestMaskthreholdOutPutLayerThreshold().start();
+    }
+    
+    public void start() {
+        FLyrRaster lyr1 = null;
+        FLyrRaster lyr2 = null;
+        FLyrRaster lyr3 = null;
+		try {
+			lyr1 = createLayerRaster("Input1", new File(file1));
+			lyr2 = createLayerRaster("Input2", new File(file2));
+			lyr3 = createLayerRaster("Input3", new File(file1));
+	        
+			RasterProcess task;
+			try {
+				task = RasterBaseAlgorithmLibrary.getManager().createRasterTask("MaskthresholdProcess");
+			} catch (ProcessException e1) {
+				e1.printStackTrace();
+				return;
+			}
+			
+	        task.addParam(MaskthresholdProcess.RASTER_STORE1, lyr2.getDataStore());
+	        task.addParam(MaskthresholdProcess.RASTER_STORE3, lyr3.getDataStore());
+	        task.addParam(MaskthresholdProcess.PATH, "/tmp/MaskthreholdTest.tif");
+	        task.addParam(MaskthresholdProcess.THRESHOLD, 0.0);
+	        task.addParam(MaskthresholdProcess.BAND1, 0);
+	        task.addParam(MaskthresholdProcess.BAND3, -1); //Las salida ser� de todas las bandas del datastore 3
+	        task.addParam(MaskthresholdProcess.OPERATION, 1);
+	        task.addParam(MaskthresholdProcess.SATISFY_METHOD, 4);
+	        task.execute();
+		} catch (LoadLayerException e) {
+			e.printStackTrace();
+		} catch (ProcessException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+    }
+
+    @SuppressWarnings("deprecation")
+	public FLyrRaster createLayerRaster(String layerName, File file)
+        throws LoadLayerException {
+        ProviderServices provServ =
+            RasterLocator.getManager().getProviderServices();
+        RasterDataParameters storeParameters =
+            provServ.createParameters(file.getName());
+        storeParameters.setURI(file.getPath());
+
+        DataManager dataManager = DALLocator.getDataManager();
+        DataStore dataStore = null;
+        try {
+            dataStore = dataManager.createStore(storeParameters);
+        } catch (ValidateDataParametersException e) {
+            throw new LoadLayerException("Error al cargar la capa.");
+        } catch (InitializeException e) {
+            throw new LoadLayerException("Error al cargar la capa.");
+        } catch (ProviderNotRegisteredException e) {
+            throw new LoadLayerException("Error al cargar la capa.");
+        }
+
+        DefaultFLyrRaster lyr = new DefaultFLyrRaster();
+        lyr.setName(layerName);
+        lyr.setDataStore(dataStore);
+        return lyr;
+    }
+
+}

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/src/main/java/org/gvsig/raster/tools/algorithm/TestMaskthreholdFixedValue.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/src/main/java/org/gvsig/raster/tools/algorithm/TestMaskthreholdFixedValue.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/src/main/java/org/gvsig/raster/tools/algorithm/TestMaskthreholdFixedValue.java	(revision 8183)
@@ -0,0 +1,140 @@
+package org.gvsig.raster.tools.algorithm;
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public 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.io.File;
+
+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.RasterManager;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+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.exceptions.LoadLayerException;
+import org.gvsig.raster.cache.tile.impl.TileCacheDefaultImplLibrary;
+import org.gvsig.raster.fmap.layers.DefaultFLyrRaster;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.gdal.io.DefaultGdalIOLibrary;
+import org.gvsig.raster.impl.RasterDefaultImplLibrary;
+import org.gvsig.raster.tools.algorithm.base.RasterBaseAlgorithmLibrary;
+import org.gvsig.raster.tools.algorithm.base.process.ProcessException;
+import org.gvsig.raster.tools.algorithm.base.process.RasterProcess;
+import org.gvsig.raster.tools.algorithm.maskthreshold.MaskthresholdAlgorithmLibrary;
+import org.gvsig.raster.tools.algorithm.maskthreshold.MaskthresholdProcess;
+import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
+
+/**
+ * @author gvSIG Team
+ * @version $Id$
+ *
+ */
+@SuppressWarnings("unused")
+public class TestMaskthreholdFixedValue {
+	private static int pos = 5;
+	
+	private static String file1 = "/home/nacho/images/PNOA/PNOA06-08/2006_clip.tif";
+	private static String file2 = "/home/nacho/images/PNOA/PNOA06-08/2006_NDVI.tif";
+    public static DataManager datamanager = DALLocator.getDataManager();
+    public FLyrRaster lyr = null;
+    private RasterManager rManager = RasterLocator.getManager();
+    private int[] drawableBands = { 0, 1, 2 };
+
+    public static void main(String[] args) {
+    	try {
+    		new DefaultLibrariesInitializer().fullInitialize(true);
+    	} catch(Exception e) {
+    		e.printStackTrace();
+    	}
+    	new TileCacheDefaultImplLibrary();
+		new RasterDefaultImplLibrary();
+		new DefaultGdalIOLibrary();
+		new MaskthresholdAlgorithmLibrary().doPostInitialize();
+    	new TestMaskthreholdFixedValue().start();
+    }
+    
+    public void start() {
+        FLyrRaster lyr1 = null;
+        FLyrRaster lyr2 = null;
+		try {
+			lyr1 = createLayerRaster("Input1", new File(file1));
+			lyr2 = createLayerRaster("Input2", new File(file2));
+	        
+			RasterProcess task;
+			try {
+				task = RasterBaseAlgorithmLibrary.getManager().createRasterTask("MaskthresholdProcess");
+			} catch (ProcessException e1) {
+				e1.printStackTrace();
+				return;
+			}
+			
+	        task.addParam(MaskthresholdProcess.RASTER_STORE1, lyr1.getDataStore());
+	        task.addParam(MaskthresholdProcess.RASTER_STORE2, lyr2.getDataStore());
+	        task.addParam(MaskthresholdProcess.PATH, "/tmp/MaskthreholdTest.tif");
+	        task.addParam(MaskthresholdProcess.BAND1, 0);
+	        task.addParam(MaskthresholdProcess.BAND2, 0);
+	        task.addParam(MaskthresholdProcess.FIXED_VALUE, 80.0);
+	        task.addParam(MaskthresholdProcess.OPERATION, 0);
+	        task.addParam(MaskthresholdProcess.SATISFY_METHOD, 1);
+	        task.execute();
+		} catch (LoadLayerException e) {
+			e.printStackTrace();
+		} catch (ProcessException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+    }
+
+    @SuppressWarnings("deprecation")
+	public FLyrRaster createLayerRaster(String layerName, File file)
+        throws LoadLayerException {
+        ProviderServices provServ =
+            RasterLocator.getManager().getProviderServices();
+        RasterDataParameters storeParameters =
+            provServ.createParameters(file.getName());
+        storeParameters.setURI(file.getPath());
+
+        DataManager dataManager = DALLocator.getDataManager();
+        DataStore dataStore = null;
+        try {
+            dataStore = dataManager.createStore(storeParameters);
+        } catch (ValidateDataParametersException e) {
+            throw new LoadLayerException("Error al cargar la capa.");
+        } catch (InitializeException e) {
+            throw new LoadLayerException("Error al cargar la capa.");
+        } catch (ProviderNotRegisteredException e) {
+            throw new LoadLayerException("Error al cargar la capa.");
+        }
+
+        DefaultFLyrRaster lyr = new DefaultFLyrRaster();
+        lyr.setName(layerName);
+        lyr.setDataStore(dataStore);
+        return lyr;
+    }
+
+}

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


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/src/main/java/org/gvsig/raster/tools/algorithm
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/src/main/java/org/gvsig/raster/tools
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/src/main/java/org/gvsig/raster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/src/main/java/org/gvsig
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/src/main/java/org
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/src/main/java
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/src/main
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/src
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/pom.xml
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/pom.xml	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/pom.xml	(revision 8183)
@@ -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.tools.main</artifactId>
+	<packaging>jar</packaging>
+	<name>Raster tools Main</name>
+	<version>2.2.0-SNAPSHOT</version>
+	<description />
+	<parent>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.desktop.plugin</artifactId>
+      <version>2.0.12-SNAPSHOT</version>
+    </parent>
+     <scm>
+        <connection>scm:svn:https://devel.gvsig.org/svn/gvsig-raster/org.gvsig.raster.tools/trunk/org.gvsig.raster.tools/org.gvsig.raster.tools.main</connection>
+        <developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-raster/org.gvsig.raster.tools/trunk/org.gvsig.raster.tools/org.gvsig.raster.tools.main</developerConnection>
+        <url>https://devel.gvsig.org/redmine/projects/gvsig-raster/repository/show/org.gvsig.raster.tools/trunk/org.gvsig.raster.tools/org.gvsig.raster.tools.main</url>
+    </scm>
+    <dependencyManagement>
+		<dependencies>
+	        <dependency>
+				<groupId>org.gvsig</groupId>
+				<artifactId>org.gvsig.raster.tools</artifactId>
+				<version>2.1.0-SNAPSHOT</version>
+				<type>pom</type>
+				<scope>import</scope>
+			</dependency>
+    	</dependencies>
+    </dependencyManagement>
+	<dependencies>
+		<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.app.mainplugin</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.app.document.table.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.fmap</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.lib.impl</artifactId>
+			<scope>compile</scope>
+		</dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.geometry</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal.file</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal</artifactId>
+            <classifier>spi</classifier>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.mapcontext</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.control</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.utils</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.ui</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.symbology.lib.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.symbology.lib.impl</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.projection</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.metadata.lib.basic.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        	<dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.raster.tools.algorithm.maskthreshold</artifactId>
+            </dependency>
+            <dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.raster.gdal.io</artifactId>
+            </dependency>
+            <dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.raster.cache.lib.api</artifactId>
+            </dependency>
+             <dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.raster.cache.lib.impl</artifactId>
+            </dependency>
+            <dependency>
+				<groupId>org.gvsig</groupId>
+				<artifactId>org.gvsig.tools.lib</artifactId>
+            	<scope>compile</scope>
+			</dependency>
+	</dependencies>
+</project>

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/buildNumber.properties
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/buildNumber.properties	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main/buildNumber.properties	(revision 8183)
@@ -0,0 +1,3 @@
+#maven.buildNumber.plugin properties file
+#Mon Jun 25 09:20:23 CEST 2012
+buildNumber=5

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


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.main
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/algorithmTemplate.zip
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/algorithmTemplate.zip
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 8183)
@@ -0,0 +1 @@
+org.gvsig.raster.tools.algorithm.saveraster.SaveRasterAlgorithmLibrary
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/resources/META-INF/services
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/resources/META-INF
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/resources
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig/raster/tools/algorithm/saveraster/ExternalCancellable.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig/raster/tools/algorithm/saveraster/ExternalCancellable.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig/raster/tools/algorithm/saveraster/ExternalCancellable.java	(revision 8183)
@@ -0,0 +1,42 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.algorithm.saveraster;
+
+import org.gvsig.raster.algorithm.gui.IncrementableTask;
+
+
+public class ExternalCancellable implements org.gvsig.fmap.dal.coverage.store.ExternalCancellable {
+	private IncrementableTask task = null;
+	
+	public ExternalCancellable(IncrementableTask task) {
+		this.task = task;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.dataset.io.IExternalCancellable#processFinalize()
+	 */
+	public void processFinalize() {
+		if(task != null)
+			task.processFinalize();
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig/raster/tools/algorithm/saveraster/ExternalCancellable.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig/raster/tools/algorithm/saveraster/SaveRasterAlgorithmLibrary.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig/raster/tools/algorithm/saveraster/SaveRasterAlgorithmLibrary.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig/raster/tools/algorithm/saveraster/SaveRasterAlgorithmLibrary.java	(revision 8183)
@@ -0,0 +1,56 @@
+/*
+ * 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.tools.algorithm.saveraster;
+
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.algorithm.RasterBaseAlgorithmLibrary;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+
+/**
+ * Initialization of SaveRasterAlgorithmLibrary library.
+ * 
+ * @author <a href="mailto:nachobrodin@gmail.com">Nacho Brodin</a>
+ */
+public class SaveRasterAlgorithmLibrary extends AbstractLibrary {
+	public static final String         PROCESS_LABEL   = "SaveRasterProcess";
+	
+    @Override
+    protected void doInitialize() throws LibraryException {
+        // Nothing to do
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+    	//Registers the process and its parameters
+    	RasterBaseAlgorithmLibrary.register(PROCESS_LABEL, SaveRasterProcess.class);
+    	SaveRasterProcess.registerParameters();
+    	
+        Messages.addResourceFamily(
+            "org.gvsig.raster.tools.algorithm.saveraster", 
+            SaveRasterAlgorithmLibrary.class.getClassLoader(), 
+            SaveRasterAlgorithmLibrary.class.getClass().getName());
+        //registerGeoProcess(new SaveRasterAlgorithmLibrary());
+    }
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig/raster/tools/algorithm/saveraster/SaveRasterAlgorithmLibrary.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig/raster/tools/algorithm/saveraster/RasterizeFLayers.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig/raster/tools/algorithm/saveraster/RasterizeFLayers.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig/raster/tools/algorithm/saveraster/RasterizeFLayers.java	(revision 8183)
@@ -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.tools.algorithm.saveraster;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.store.DataServerWriter;
+import org.gvsig.fmap.dal.exception.ReadException;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.impl.DefaultMapContextDrawer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.gui.beans.incrementabletask.IIncrementable;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.algorithm.process.DataProcess;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.tools.task.Cancellable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Sirve datos solicitados por los drivers que salvan a raster. Hereda de
+ * Rasterizer y reescribe el m�todo readData que es el que ser� llamado desde el
+ * driver cada vez que vacie el buffer y necesite m�s datos.
+ *
+ * @version 04/06/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+@SuppressWarnings("deprecation")
+public class RasterizeFLayers implements DataServerWriter, IIncrementable {
+	private static final GeometryManager 	geomManager		= GeometryLocator.getGeometryManager();
+	private Logger                          logger          = LoggerFactory.getLogger(DataProcess.class.toString());
+	
+	private ViewPort						viewPort 		= null;
+	private ViewPort						viewPortBlock	= null;
+	private FLayers							flayers 		= null;
+	private Color							backgroundColor = null;
+	private boolean							firstRead 		= true;
+	private int 							nBlocks 		= 0;
+//	private double 							percentMax 		= 100.0D;
+	protected double 						wcIntervalo 	= 0;
+	protected Dimension 					dimension 		= null;
+	protected int 							blockSize 		= 0;
+	protected double 						wcAlto 			= 0;
+	protected int 							lastBlock 		= 0;
+	protected BufferedImage 				image 			= null;
+	protected int[] 						rasterData 		= null;
+	protected int 							contBlocks 		= 1;
+	protected int							percent 		= 0;
+	protected int							imgHeight 		= 0;
+
+	/**
+	 * Calculo del viewPort
+	 * @param vp
+	 */
+	private void calcViewPort(ViewPort vp) {
+		Rectangle2D ext = null;
+
+		if (viewPortBlock == null)
+			ext = new Rectangle2D.Double(	vp.getExtent().getMinX(),
+											vp.getExtent().getMaxY() - wcIntervalo,
+											vp.getExtent().getWidth(),
+											wcIntervalo
+										);
+		else
+			ext = new Rectangle2D.Double(	viewPortBlock.getExtent().getMinX(),
+											viewPortBlock.getExtent().getMinY() - wcIntervalo,
+											viewPortBlock.getExtent().getWidth(),
+											wcIntervalo
+										);
+
+		viewPortBlock = new ViewPort(vp.getProjection());
+		Envelope env;
+		try {
+			env = geomManager.createEnvelope(ext.getMinX(), ext.getMinY(), ext.getMaxX(), ext.getMaxY(), SUBTYPES.GEOM2D);
+			viewPortBlock.setEnvelope(env);
+		} catch (CreateEnvelopeException e) {
+			logger.debug("Error creating the envelope", null, e);
+		}		
+		viewPortBlock.setImageSize(dimension);
+		viewPortBlock.refreshExtent();
+	}
+
+	/**
+	 * Constructor
+	 * @param flyrs capas
+	 * @param vp viewport
+	 * @param blockSize altura del bloque que se lee de una vez en la imagen de entrada
+	 * @param mapCtrl Mapcontrol
+	 */
+	public RasterizeFLayers(FLayers flyrs, ViewPort vp, int blockSize) {
+		this.blockSize = blockSize;
+		backgroundColor = vp.getBackColor();
+		viewPort = new ViewPort(vp.getProjection());
+		viewPort.setImageSize(vp.getImageSize());
+		/*Rectangle2D ex = vp.getExtent();
+		Envelope env = null;
+		try {
+			env = geomManager.createEnvelope(ex.getMinX(), ex.getMinY(), ex.getMaxX(), ex.getMaxY(), SUBTYPES.GEOM2D);
+			//viewPortBlock = new ViewPort(vp.getProjection());
+			//viewPortBlock.setEnvelope(env);
+		} catch (CreateEnvelopeException e) {
+			logger.debug("Error creating the envelope", null, e);
+		}*/
+		
+
+		// Calculo del viewPort del primer bloque
+		viewPort.setEnvelope(vp.getAdjustedExtent());
+		wcAlto = viewPort.getExtent().getMaxY() - viewPort.getExtent().getMinY();
+		wcIntervalo = (blockSize * wcAlto) / viewPort.getImageHeight();
+		dimension = new Dimension(viewPort.getImageWidth(), blockSize);
+
+		imgHeight = vp.getImageHeight();
+		nBlocks = (vp.getImageHeight() / blockSize);
+
+		// Tama�o de �ltimo bloque en pixeles
+		lastBlock = vp.getImageHeight() - (nBlocks * blockSize);
+
+		calcViewPort(viewPort);
+
+		this.flayers = flyrs;
+	}
+
+	/**
+	 * Compatibilidad con el piloto de raster
+	 * @see readData
+	 */
+	public int[] readARGBData(int sX, int sY, int nBand) throws ProcessInterruptedException, OutOfMemoryError {
+		return readData( sX, sY, nBand);
+	}
+
+	public int[] readData(int sX, int sY, int nBand) throws ProcessInterruptedException, OutOfMemoryError {
+		if (nBand == 0) { // Con nBand==0 se devuelven las 3 bandas
+			nBlocks = (int) Math.ceil(imgHeight / (double) blockSize);
+			image = new BufferedImage(sX, sY, BufferedImage.TYPE_INT_ARGB);
+			Graphics2D g = (Graphics2D) image.getGraphics();
+			g.setColor(backgroundColor);
+			g.fillRect(0, 0, viewPortBlock.getImageWidth(), viewPortBlock.getImageHeight());
+			try {
+				// TODO: FUNCIONALIDAD: Salvar los m�ximos y m�nimos para salvar 16 bits
+
+				// Si es la primera lectura salvamos los valores de m�ximo y m�nimo para la aplicaci�n
+				// de realce si la imagen es de 16 bits.
+				if (firstRead) {
+					for (int i = 0; i < flayers.getLayersCount(); i++)
+						if (flayers.getLayer(i) instanceof FLyrRaster) {
+							FLyrRaster raster = (FLyrRaster) flayers.getLayer(i);
+							if (raster.getDataStore().getDataType()[0] == Buffer.TYPE_SHORT || raster.getDataStore().getDataType()[0] == Buffer.TYPE_USHORT) {
+								//Statistic stats = raster.getSource().getFilterStack().getStats();
+								//stats.history.add(stats.new History(raster.getName(), stats.minBandValue, stats.maxBandValue, stats.secondMinBandValue, stats.secondMaxBandValue));
+							}
+						}
+					firstRead = false;
+				}
+
+				DefaultMapContextDrawer mapContextDrawer = new DefaultMapContextDrawer();
+				mapContextDrawer.setMapContext(flayers.getMapContext());
+				mapContextDrawer.setViewPort(viewPortBlock);
+				mapContextDrawer.draw(flayers, image, g, new Cancellable(){
+					public boolean isCanceled() {
+						return false;
+					}
+
+					public void setCanceled(boolean canceled) {
+					}
+				}, flayers.getMapContext().getScaleView());
+
+				// Si es el �ltimo bloque vaciamos el historial de m�ximos y m�nimos
+				if ((contBlocks + 1) == nBlocks)
+					for (int i = 0; i < flayers.getLayersCount(); i++)
+						if (flayers.getLayer(i) instanceof FLyrRaster) {
+							FLyrRaster raster = (FLyrRaster) flayers.getLayer(i);
+							if (raster.getDataStore().getDataType()[0] == Buffer.TYPE_SHORT || raster.getDataStore().getDataType()[0] == Buffer.TYPE_USHORT) {
+								//raster.getDatasource().getFilterStack().getStats().history.clear();
+								//Statistic stats = raster.getSource().getFilterStack().getStats();
+							}
+						}
+
+			} catch (ReadException e) {
+				logger.debug("Error en el draw de capa", e);
+			}
+			rasterData = image.getRGB(0, 0, sX, sY, rasterData, 0, sX);
+
+			// Calculamos el viewPort del sgte bloque
+
+			if (((contBlocks + 1) * blockSize) <= viewPort.getImageHeight())
+				dimension = new Dimension(sX, sY);
+			else { // Calculo de la altura del �ltimo bloque
+				dimension = new Dimension(sX, (viewPort.getImageHeight() - (contBlocks * blockSize)));
+				wcIntervalo = (lastBlock * wcAlto) / viewPort.getImageHeight();
+			}
+
+			calcViewPort(viewPortBlock);
+
+			percent = ((100 * (contBlocks)) / nBlocks);
+			contBlocks++;
+
+			return rasterData;
+		}
+
+		return null;
+	}
+
+	/**
+	 * Asigna el ancho del bloque
+	 * @param sizeBlock Ancho del bloque en pixeles
+	 */
+	public void setBlockSize(int blockSize) {
+		this.blockSize = blockSize;
+	}
+
+	/**
+	 * No tiene uso en RasterizerLayer
+	 */
+	public byte[][] readByteData(int sizeX, int sizeY) {
+		return null;
+	}
+
+	/**
+	 * No tiene uso en RasterizerLayer
+	 */
+	public double[][] readDoubleData(int sizeX, int sizeY) {
+		return null;
+	}
+
+	/**
+	 * No tiene uso en RasterizerLayer
+	 */
+	public float[][] readFloatData(int sizeX, int sizeY) {
+		return null;
+	}
+
+	/**
+	 * No tiene uso en RasterizerLayer
+	 */
+	public int[][] readIntData(int sizeX, int sizeY) {
+		return null;
+	}
+
+	/**
+	 * No tiene uso en RasterizerLayer
+	 */
+	public short[][] readShortData(int sizeX, int sizeY) {
+		return null;
+	}
+
+	public String getTitle() {
+		return Messages.getText("salvando_raster");
+	}
+
+	public String getLog() {
+		return Messages.getText("salvando_bloque") + " " + Math.min(nBlocks, contBlocks) + " " + Messages.getText("de") + " " + nBlocks;
+	}
+
+	public String getLabel() {
+		return Messages.getText("rasterizando") + "...";
+	}
+
+	public int getPercent() {
+		return percent;
+	}
+
+	public boolean isCancelable() {
+		return true;
+	}
+
+	public boolean isPausable() {
+		return false;
+	}
+
+	public void setAlphaBuffer(Buffer alphaBuffer) {
+	}
+
+	public void setBuffer(Buffer buffer, int nband) {
+	}
+	
+	public Buffer getBuffer() {
+		return null;
+	}
+
+	public void setBand(int nband) {
+	}
+
+	public void dispose() {
+	}
+
+	public Buffer getSource() {
+		return null;
+	}
+
+	public void setPercent(int value) {
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig/raster/tools/algorithm/saveraster/RasterizeFLayers.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig/raster/tools/algorithm/saveraster/SaveRasterProcess.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig/raster/tools/algorithm/saveraster/SaveRasterProcess.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig/raster/tools/algorithm/saveraster/SaveRasterProcess.java	(revision 8183)
@@ -0,0 +1,287 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.algorithm.saveraster;
+
+import java.awt.Dimension;
+import java.awt.geom.AffineTransform;
+import java.io.File;
+import java.io.IOException;
+import java.util.Date;
+
+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.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.process.TaskEventManager;
+import org.gvsig.fmap.dal.coverage.store.DataServerWriter;
+import org.gvsig.fmap.dal.coverage.store.RasterWriter;
+import org.gvsig.fmap.dal.coverage.util.CRSUtils;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.raster.algorithm.process.ProcessException;
+import org.gvsig.raster.algorithm.process.DataProcess;
+
+/**
+ * Thread que se encarga de llamar a los writer para realizar la tarea de
+ * salvado y/p compresi�n
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SaveRasterProcess extends DataProcess {
+	public static String      VIEWPORT          = "ViewPort";
+	public static String      PATH              = "Path";
+	public static String      DIMENSION         = "Dimension";
+	public static String      BLOCKSIZE         = "Blocksize";
+	public static String      FILENAME          = "FileName";
+	public static String      PARAMS            = "WriterParams";
+	public static String      FLYRS             = "FLyrs";
+	public static String      TIME              = "Time";
+	public static String      PROJECTION        = "Projection";
+	
+	private IProjection       projection        = null;
+	private ViewPort          viewPort          = null;
+	private Dimension         dimension         = null;
+	private RasterizeFLayers  rasterizerLayer   = null;
+	private String            fileName          = "";
+	private Params            writerParams      = null;
+	//private CopyDataset       jp2Copy           = null;
+	private boolean           supportImage      = false;
+	private RasterManager     rManager          = RasterLocator.getManager();
+	//private Logger            logger            = LoggerFactory.getLogger(RasterProcess.class.toString());
+	
+	public static void registerParameters() {
+		registerInputParameter(VIEWPORT, ViewPort.class, SaveRasterAlgorithmLibrary.PROCESS_LABEL);
+		registerInputParameter(PATH, String.class, SaveRasterAlgorithmLibrary.PROCESS_LABEL);
+		registerInputParameter(DIMENSION, Dimension.class, SaveRasterAlgorithmLibrary.PROCESS_LABEL);
+		registerInputParameter(FLYRS, FLayers.class, SaveRasterAlgorithmLibrary.PROCESS_LABEL);
+		registerInputParameter(PARAMS, Params.class, SaveRasterAlgorithmLibrary.PROCESS_LABEL);
+		registerOutputParameter(PROJECTION, IProjection.class, SaveRasterAlgorithmLibrary.PROCESS_LABEL);
+		
+		registerOutputParameter(FILENAME, String.class, SaveRasterAlgorithmLibrary.PROCESS_LABEL);
+		registerOutputParameter(TIME, Long.class, SaveRasterAlgorithmLibrary.PROCESS_LABEL);
+	}
+	
+	public void init() {
+		viewPort = getParam(VIEWPORT) != null ? (ViewPort)getParam(VIEWPORT) : null;
+		dimension = getParam(DIMENSION) != null ? (Dimension) getParam(DIMENSION) : null;
+		FLayers flyrs = getParam(FLYRS) != null ? (FLayers) getParam(FLYRS) : null;
+		int blockSize = getIntParam(BLOCKSIZE);
+		rasterizerLayer = new RasterizeFLayers(flyrs, viewPort, blockSize);
+		fileName = getStringParam(FILENAME);
+		writerParams = getParam(PARAMS) != null ? (Params) getParam(PARAMS) : null;
+		projection = getParam(PROJECTION) != null ? (IProjection) getParam(PROJECTION) : null;
+		//supportImage = getBooleanParam("remotelayers") && fileName.endsWith(".jp2");
+	}
+
+	/**
+	 * Procesos de escritura de una porci�n de la vista.
+	 */
+	public void process() throws ProcessInterruptedException, ProcessException {
+		TaskEventManager task = rManager.getRasterTask();
+		
+		//jp2Copy = null;
+		long t2;
+		long t1 = new java.util.Date().getTime();
+		
+		//Creamos el driver
+		Envelope env = viewPort.getAdjustedEnvelope();
+		Extent ex = rManager.getDataStructFactory().createExtent(env.getMinimum(0), env.getMaximum(1), env.getMaximum(0), env.getMinimum(1));
+		Dimension imgSz = viewPort.getImageSize();
+		ViewPortData vpData = rManager.getDataStructFactory().createViewPortData(viewPort.getProjection(), ex, imgSz );
+		vpData.setDPI((int)viewPort.getDPI());
+		AffineTransform at = new AffineTransform(vpData.getExtent().width() / imgSz.width,
+												 0, 0,
+												 -(vpData.getExtent().height() / imgSz.height),
+												 vpData.getExtent().getULX(),
+												 vpData.getExtent().getULY());
+		String oldFileName = fileName;
+		if(supportImage) {
+			fileName = fileName.substring(0, Math.min(fileName.lastIndexOf(File.separator) + 1, fileName.length() - 1));
+			fileName += rManager.getFileUtils().usesOnlyLayerName() + ".tif";
+			writerParams = getWriterParams(fileName);
+		}
+
+		//Ejecutamos el driver con los datos pasados
+		try {
+			write(fileName, at, writerParams, rasterizerLayer);
+
+			if(task.getEvent() != null)
+				task.manageEvent(task.getEvent());
+			
+			/*if(supportImage) {
+				try {
+					insertLineLog(Messages.getText("saving_jp2"));
+					jp2Copy = new CopyDataset(fileName, oldFileName, incrementableTask);
+					jp2Copy.copy();
+					new File(fileName).delete();
+					new File(rManager.getFileUtils().getRMFNameFromFileName(fileName)).delete();
+				} catch (LoadLayerException e) {
+					throw new ProcessException("error_processing", e);
+				} 
+				jp2Copy = null;
+			} */
+			t2 = new Date().getTime();
+			try {
+				saveRasterFinalize(oldFileName, (t2 - t1));
+			} catch(ArrayIndexOutOfBoundsException exc) {
+				//Si la ventana se ha cerrado ya es porque ha sido cancelada por lo que
+				//producir� esta excepci�n. En este caso no se lanza la ventana de informaci�n
+				//de finalizaci�n.
+			}
+
+		} catch(IOException ev) {
+			throw new ProcessException("error_processing", ev);
+		} catch(OutOfMemoryError ev) {
+			throw new ProcessException("memoria_excedida", ev);
+		} finally {
+			if (incrementableTask != null) {
+				incrementableTask.processFinalize();
+				incrementableTask = null;
+			}
+		}
+	}
+	
+	/**
+	 * 
+	 * @param name
+	 * @param at
+	 * @throws IOException
+	 * @throws ProcessException 
+	 * @throws InterruptedException
+	 */
+	private void write(String name, AffineTransform at, Params writerParams, DataServerWriter rasterizerLayer) throws IOException, ProcessInterruptedException, ProcessException {
+		//TODO: Usar el nuevo API basado en NewRasterStoreParameters y DataServerExplorer. Ejemplo en ClippingProcess
+		
+		TaskEventManager task = rManager.getRasterTask();
+		RasterWriter geoRasterWriter = null;
+		try {
+			//TODO: FUNCIONALIDAD: Poner los gerWriter con la proyecci�n de la vista
+			geoRasterWriter = rManager.createWriter(rasterizerLayer, name,
+												3, at, dimension.width,
+												dimension.height, Buffer.TYPE_IMAGE, writerParams, null);
+			CRSUtils crsUtil = RasterLocator.getManager().getCRSUtils();
+			geoRasterWriter.setWkt(crsUtil.convertIProjectionToWkt(projection));
+		} catch (NotSupportedExtensionException e) {
+			throw new ProcessException("extension_no_soportada", e);
+		} catch (RasterDriverException e) {
+			throw new ProcessException("no_driver_escritura", e);
+		}
+		
+		if(task.getEvent() != null)
+			task.manageEvent(task.getEvent());
+		
+		geoRasterWriter.setCancellableRasterDriver(new ExternalCancellable(incrementableTask));
+		geoRasterWriter.dataWrite();
+		geoRasterWriter.writeClose();
+	}
+	
+	/**
+	 * Obtiene los par�metros del driver de escritura. Si el driver no se ha creado a�n se obtienen
+	 * unos par�metros con la inicializaci�n por defecto. Si se ha creado ya y se han modificado se
+	 * devuelven los par�metros con las modificaciones. Si se cambia de driver se devolver� un WriterParams
+	 * como si fuera la primera vez que se abre.
+	 * @param name Nombre del fichero sobre el que se salva.
+	 * @return WriterParams
+	 */
+	private Params getWriterParams(String name) throws ProcessException {
+		RasterWriter writer = null;
+		String ext = rManager.getFileUtils().getExtensionFromFileName(name);
+		try {
+			if(writer == null) //La primera vez que se obtiene el driver
+				writer = rManager.createWriter(name);
+			else {
+				String newType = rManager.getProviderServices().getWriteDriverType(ext);
+				String oldType = writer.getDriverName();
+				if(!newType.equals(oldType))  //Cambio de driver despu�s de haber seleccionado y modificado las propiedades de uno
+					writer = rManager.createWriter(name);
+			}
+
+			if(writer == null)
+				throw new ProcessException("no_driver_escritura");
+
+			return writer.getParams();
+
+		} catch (NotSupportedExtensionException e1) {
+			throw new ProcessException("no_driver_escritura", e1);
+		} catch (RasterDriverException e1) {
+			throw new ProcessException("no_driver_escritura", e1);
+		}
+	}
+
+	/**
+	 * Acciones que se realizan al finalizar de salvar a raster.
+	 * @param fileName Nombre del fichero
+	 * @param milis Tiempo que ha tardado en ejecutarse
+	 */
+	private void saveRasterFinalize(String fileName, long milis) {
+		if (incrementableTask != null)
+			incrementableTask.hideWindow();
+		externalActions.end(new Object[]{fileName, new Long(milis)});
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#getPercent()
+	 */
+	public int getPercent() {
+		if(rasterizerLayer != null)
+			return rasterizerLayer.getPercent();
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#getTitle()
+	 */
+	public String getTitle() {
+		if(rasterizerLayer != null)
+			return rasterizerLayer.getTitle();
+		return null;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.rastertools.RasterProcess#getLog()
+	 */
+	public String getLog() {
+		if(rasterizerLayer != null)
+			return rasterizerLayer.getLog();
+		return null;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#getLabel()
+	 */
+	public String getLabel() {
+		if(rasterizerLayer != null)
+			return rasterizerLayer.getLabel();
+		return null;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig/raster/tools/algorithm/saveraster/SaveRasterProcess.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig/raster/tools/algorithm/saveraster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig/raster/tools/algorithm
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig/raster/tools
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig/raster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org/gvsig
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java/org
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main/java
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src/main
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/src
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/pom.xml
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/pom.xml	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster/pom.xml	(revision 8183)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.gvsig.raster.tools.algorithm.saveraster</artifactId>
+	<packaging>jar</packaging>
+	<name>org.gvsig.raster.tools.algorithm.saveraster</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.tools.algorithm</artifactId>
+		<version>2.2.62</version>
+	</parent>
+    <dependencies>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.algorithm</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<!--Dependencia debido a que este algoritmo rasteriza capas de gvSIG.-->
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.fmap</artifactId>
+            <scope>compile</scope>
+		</dependency>
+	</dependencies>
+</project>

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


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.saveraster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath
target


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/pom.xml
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/pom.xml	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/pom.xml	(revision 8183)
@@ -0,0 +1,121 @@
+<?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.tools.algorithm</artifactId>
+	<packaging>pom</packaging>
+	<name>org.gvsig.raster.tools.algorithm</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.tools</artifactId>
+		<version>2.2.62</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.metadata.lib.basic.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.jproj</artifactId>
+			<classifier>${native_classifier}</classifier>
+			<type>tar.gz</type>
+            <scope>runtime</scope>
+		</dependency>-->
+		<dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.tools.lib</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.i18n</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.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>
+	 <modules>
+	 	<module>org.gvsig.raster.tools.algorithm.swing</module>
+        <module>org.gvsig.raster.tools.algorithm.maskthreshold</module>
+        <module>org.gvsig.raster.tools.algorithm.layerdatatype</module>
+        <module>org.gvsig.raster.tools.algorithm.saveraster</module>
+        <!--<module>org.gvsig.raster.tools.algorithm.clip</module>-->
+    </modules>
+</project>

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/java/org/gvsig/raster/tools/algorithm/clip/ClipAlgorithmLibrary.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/java/org/gvsig/raster/tools/algorithm/clip/ClipAlgorithmLibrary.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/java/org/gvsig/raster/tools/algorithm/clip/ClipAlgorithmLibrary.java	(revision 8183)
@@ -0,0 +1,56 @@
+/*
+ * 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.tools.algorithm.clip;
+
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.algorithm.RasterBaseAlgorithmLibrary;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+
+/**
+ * Initialization of ClipAlgorithmLibrary library.
+ * 
+ * @author <a href="mailto:nachobrodin@gmail.com">Nacho Brodin</a>
+ */
+public class ClipAlgorithmLibrary extends AbstractLibrary {
+	public static final String         PROCESS_LABEL   = "ClipProcess";
+	
+    @Override
+    protected void doInitialize() throws LibraryException {
+        // Nothing to do
+    }
+
+    @Override
+    public void doPostInitialize() throws LibraryException {
+    	//Registers the process and its parameters
+    	RasterBaseAlgorithmLibrary.register(PROCESS_LABEL, ClipProcess.class);
+    	ClipProcess.registerParameters();
+    	
+        Messages.addResourceFamily(
+            "org.gvsig.raster.tools.algorithm.clip", 
+            ClipAlgorithmLibrary.class.getClassLoader(), 
+            ClipAlgorithmLibrary.class.getClass().getName());
+        //registerGeoProcess(new ClipAlgorithmLibrary());
+    }
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/java/org/gvsig/raster/tools/algorithm/clip/ClipAlgorithmLibrary.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/java/org/gvsig/raster/tools/algorithm/clip/ClipException.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/java/org/gvsig/raster/tools/algorithm/clip/ClipException.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/java/org/gvsig/raster/tools/algorithm/clip/ClipException.java	(revision 8183)
@@ -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.raster.tools.algorithm.clip;
+
+import org.gvsig.raster.algorithm.process.ProcessException;
+
+
+/**
+ * This exception is thrown if happen problems processing data with this algorithm.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class ClipException extends ProcessException {
+	private static final long serialVersionUID = -3022090543908771484L;
+	
+	public ClipException(String msg){
+		super(msg);
+	}
+	
+	public ClipException(String msg, Throwable e){
+		super(msg, e);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/java/org/gvsig/raster/tools/algorithm/clip/ClipException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/java/org/gvsig/raster/tools/algorithm/clip/ClipProcess.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/java/org/gvsig/raster/tools/algorithm/clip/ClipProcess.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/java/org/gvsig/raster/tools/algorithm/clip/ClipProcess.java	(revision 8183)
@@ -0,0 +1,523 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.algorithm.clip;
+
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+
+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.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.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+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.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.process.BaseIncrementableTask;
+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.parameter.NewRasterStoreParameters;
+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.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.ProviderNotRegisteredException;
+import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.algorithm.RasterBaseAlgorithmLibrary;
+import org.gvsig.raster.algorithm.process.RasterProcess;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.roi.VectorialROI;
+
+/**
+ * <code>ClippingProcess</code> es un proceso que usa un <code>Thread</code>
+ * para aplicar un recorte a una capa y guardarlo en disco. Muestra una barra
+ * de incremento informativa.
+ *
+ * @version 24/04/2007
+ * @author BorSanZa - Borja S�nchez Zamorano
+ */
+public class ClipProcess extends RasterProcess {
+	public static String                  LAYER             = "Layer";
+	public static String                  PATH              = "Path";
+	public static String                  FILENAME          = "filename";
+	public static String                  TIME              = "Time";
+	
+	public static String                  SUFFIX            = "suffix";
+	public static String                  PX_COORDS         = "pixelcoordinates";
+	public static String                  WORLD_COORDS      = "realcoordinates";
+	public static String                  DRAW_BANDS        = "drawablebands";
+	public static String                  ONE_BY_BAND       = "onelayerperband";
+	public static String                  INTERP_METHOD     = "interpolationmethod";
+	public static String                  AT                = "affinetransform";
+	public static String                  COLOR_INTERP      = "colorInterpretation";
+	public static String                  SELECTED_ROIS     = "selectedrois";
+	public static String                  RESOLUTION        = "resolution";
+	public static String                  DRIVER_PARAMS     = "driverparams";
+	
+	private String                        fileName            = "";
+	private String                        suffix              = ".tif";
+	private FLyrRaster                    rasterSE            = null;
+	private boolean                       oneLayerPerBand     = false;
+	private int[]                         drawableBands       = { 0, 1, 2 };
+	private double[]                      pValues             = null;
+	private int                           interpolationMethod = Buffer.INTERPOLATION_Undefined;
+	private Params                        params              = null;
+	private ColorInterpretation           colorInterp         = null;
+	private ArrayList<VectorialROI>       selectedRois        = null;
+	private AffineTransform               affineTransform     = null;
+	private double[]                      wcValues            = null;
+	private RasterManager                 rManager            = RasterLocator.getManager();
+	private BaseIncrementableTask         processIncrement    = null; 
+	
+	/**
+	 * Variables de la resoluci�n de salida
+	 */
+	private int                           resolutionWidth     = 0;
+	private int                           resolutionHeight    = 0;
+	
+	private Buffer                        buffer              = null;
+	
+	/**
+	 * Par�metros obligatorios al proceso:
+	 * <UL>
+	 * <LI>filename: Nombre del fichero de salida</LI>
+	 * <LI>datawriter: Escritor de datos</LI>
+	 * <LI>viewname: Nombre de la vista sobre la que se carga la capa al acabar el proceso</LI>
+	 * <LI>pixelcoordinates: Coordenadas pixel del recorte (ulx, uly, lrx, lry)</LI>
+	 * <LI>layer: Capa de entrada para el recorte</LI>
+	 * <LI>drawablebands: Bandas de entrada</LI>
+	 * <LI>onelayerperband: booleano que informa de si escribimos una banda por fichero de salida o todas en un fichero</LI>
+	 * <LI>interpolationmethod: M�todo de interpolaci�n.</LI>
+	 * <LI>affinetransform: Transformaci�n que informa al dataset de salida de su referencia geografica</LI>
+	 * <LI>resolution: Ancho y alto de la capa de salida</LI>
+	 * </UL> 
+	 */
+	@SuppressWarnings("unchecked")
+	public void init() {
+		fileName = getStringParam(FILENAME);
+		suffix = getStringParam(SUFFIX);
+		pValues = getDoubleArrayParam(PX_COORDS);
+		wcValues = getDoubleArrayParam(WORLD_COORDS);
+		rasterSE = getParam(LAYER) != null ? (FLyrRaster) getParam(LAYER) : null;
+		drawableBands = getIntArrayParam(DRAW_BANDS);
+		oneLayerPerBand = getBooleanParam(ONE_BY_BAND);
+		interpolationMethod = getIntParam(INTERP_METHOD);
+		affineTransform = (AffineTransform)getParam(AT);
+		colorInterp = (ColorInterpretation)getParam(COLOR_INTERP);
+		selectedRois = (ArrayList<VectorialROI>)getParam(SELECTED_ROIS);
+		if(getIntArrayParam(RESOLUTION) != null) {
+			resolutionWidth = getIntArrayParam(RESOLUTION)[0];
+			resolutionHeight = getIntArrayParam(RESOLUTION)[1];
+		}
+		params = (Params) getParam(DRIVER_PARAMS);
+	}
+	
+	public static void registerParameters() {
+		LAYER = RasterBaseAlgorithmLibrary.registerInputParameter(LAYER, FLyrRaster.class);
+		SUFFIX = RasterBaseAlgorithmLibrary.registerInputParameter(SUFFIX, String.class);
+		PX_COORDS = RasterBaseAlgorithmLibrary.registerInputParameter(PX_COORDS, double[].class);
+		WORLD_COORDS = RasterBaseAlgorithmLibrary.registerInputParameter(WORLD_COORDS, double[].class);
+		DRAW_BANDS = RasterBaseAlgorithmLibrary.registerInputParameter(DRAW_BANDS, int[].class);
+		ONE_BY_BAND = RasterBaseAlgorithmLibrary.registerInputParameter(ONE_BY_BAND, Boolean.class);
+		INTERP_METHOD = RasterBaseAlgorithmLibrary.registerInputParameter(INTERP_METHOD, Integer.class);
+		AT = RasterBaseAlgorithmLibrary.registerInputParameter(AT, AffineTransform.class);
+		COLOR_INTERP = RasterBaseAlgorithmLibrary.registerInputParameter(COLOR_INTERP, ColorInterpretation.class);
+		SELECTED_ROIS = RasterBaseAlgorithmLibrary.registerInputParameter(SELECTED_ROIS, ArrayList.class);
+		RESOLUTION = RasterBaseAlgorithmLibrary.registerInputParameter(RESOLUTION, int[].class);
+		DRIVER_PARAMS = RasterBaseAlgorithmLibrary.registerOutputParameter(DRIVER_PARAMS, Params.class);
+		
+		PATH = RasterBaseAlgorithmLibrary.registerInputParameter(PATH, String.class);
+		FILENAME = RasterBaseAlgorithmLibrary.registerOutputParameter(FILENAME, String.class);
+		TIME = RasterBaseAlgorithmLibrary.registerOutputParameter(TIME, Long.class);
+	}
+
+	/**
+	 * Salva la tabla de color al fichero rmf.
+	 * @param fName
+	 * @throws ClipException 
+	 * @throws IOException
+	 */
+	private void saveToRmf(String fileName) throws ClipException {
+		RasterDataStore rds = null;
+		int limitNumberOfRequests = 20;
+		while (rds == null && limitNumberOfRequests > 0) {
+			try {
+				rds = rasterSE.getDataStore();
+			} catch (IndexOutOfBoundsException e) {
+				//En ocasiones, sobre todo con servicios remotos al pedir un datasource da una excepci�n de este tipo
+				//se supone que es porque hay un refresco en el mismo momento de la petici�n por lo que como es m�s lento de
+				//gestionar pilla a la capa sin datasources asociados ya que est� reasignandolo. Si volvemos a pedirlo debe
+				//haberlo cargado ya.
+				try {
+					Thread.sleep(200);
+				} catch (InterruptedException e1) {
+				}
+			}
+			limitNumberOfRequests--;
+		}
+		
+		if (rds == null) {
+			//RasterToolsUtil.messageBoxError("error_load_layer", this, new Exception("Error writing RMF. limitNumberOfRequests=" + limitNumberOfRequests));
+			return;
+		}
+
+		// Guardamos en el RMF el valor NoData
+		if(rasterSE.getNoDataValue() != null) {
+			NoData nodata = (NoData)rasterSE.getNoDataValue();
+			nodata.setFileName(fileName);
+			nodata.save();
+		}
+
+		// Guardamos en el RMF la tabla de color
+		ColorTable colorTable = rasterSE.getRender().getColorTable();
+		try {
+			rManager.getProviderServices().saveObjectToRmfFile(fileName, ColorTable.class, colorTable);
+		} catch (RmfSerializerException e) {
+			throw new ClipException("error_salvando_rmf", e);
+		}
+	}
+
+	/**
+	 * Tarea de recorte
+	 * @throws ClipException 
+	 */
+	@SuppressWarnings("deprecation")
+	public void process() throws ProcessInterruptedException, ClipException {
+		RasterDataStore dstoreCopy = null;
+		RasterUtils util = RasterLocator.getManager().getRasterUtils();
+		
+		try {
+			long t2;
+			long t1 = new java.util.Date().getTime();
+
+			try {
+				Thread.sleep(1000);
+			} catch (InterruptedException e1) {
+				e1.printStackTrace();
+			}
+			
+			insertLineLog(Messages.getText("leyendo_raster"));
+			
+			dstoreCopy = rasterSE.getDataStore().newDataStore();
+			RasterQuery query = rManager.createQuery();
+			query.setDrawableBands(drawableBands);
+
+			if(dstoreCopy.getParameters() instanceof RemoteStoreParameters &&
+				!((RemoteStoreParameters)dstoreCopy.getParameters()).isSizeFixed()) {
+				insertLineLog(Messages.getText("downloading_image"));
+				((RemoteStoreParameters)dstoreCopy.getParameters()).setWidth(resolutionWidth);
+				((RemoteStoreParameters)dstoreCopy.getParameters()).setHeight(resolutionHeight);
+				Extent bbox = RasterLocator.getManager().getDataStructFactory().createExtent(wcValues[0], wcValues[1], wcValues[2], wcValues[3]);
+				query.setAreaOfInterest(bbox, resolutionWidth, resolutionHeight);
+				try {
+					buffer = dstoreCopy.query(query);
+				} catch (InvalidSetViewException e) {
+					throw new ClipException("No se ha podido asignar la vista al inicial el proceso de recorte.", e);
+				}
+			} else {
+				if(interpolationMethod != Buffer.INTERPOLATION_Undefined) {
+					try {
+						if(pValues != null) {
+							if (util.isBufferTooBig(new double[] { pValues[0], pValues[3], pValues[2], pValues[1] }, drawableBands.length))
+								query.setReadOnly(true);
+							query.setAreaOfInterest((int)pValues[0], (int)pValues[1], (int)Math.abs(pValues[2] - pValues[0]) + 1, (int)Math.abs(pValues[3] - pValues[1]) + 1);
+						} else if(wcValues != null) {
+							query.setReadOnly(true);
+							query.setAreaOfInterest(wcValues[0], wcValues[1], Math.abs(wcValues[0] - wcValues[2]), Math.abs(wcValues[1] - wcValues[3]));
+						}
+						buffer = dstoreCopy.query(query);
+					} catch (InvalidSetViewException e) {
+						throw new ClipException("No se ha podido asignar la vista al inicial el proceso de recorte.", e);
+					}
+
+					insertLineLog(Messages.getText("interpolando"));
+					
+					Buffer bufTmp = buffer;
+					processIncrement = bufTmp.getIncrementableTask(Buffer.INCREMENTABLE_INTERPOLATION);
+					buffer = bufTmp.getAdjustedWindow(resolutionWidth, resolutionHeight, interpolationMethod);
+					if(bufTmp != buffer)
+						bufTmp.dispose();
+				} else {
+					try {
+						if (util.isBufferTooBig(new double[] { 0, 0, resolutionWidth, resolutionHeight }, drawableBands.length))
+							query.setReadOnly(true);
+						if(pValues != null) 
+							query.setAreaOfInterest((int)pValues[0], (int)pValues[3], (int)Math.abs(pValues[2] - pValues[0]) + 1, (int)Math.abs(pValues[1] - pValues[3]) + 1, resolutionWidth, resolutionHeight);
+						else if(wcValues != null) {
+							Extent bbox = RasterLocator.getManager().getDataStructFactory().createExtent(wcValues[0], wcValues[1], wcValues[2], wcValues[3]);
+							query.setAreaOfInterest(bbox, resolutionWidth, resolutionHeight);
+						}
+						buffer = dstoreCopy.query(query);
+					} catch (InvalidSetViewException e) {
+						throw new ClipException("No se ha podido asignar la vista al inicial el proceso de recorte.", e);
+					}
+				}
+			}
+			
+			//TODO: FUNCIONALIDAD: Poner los getWriter con la proyecci�n del fichero fuente
+
+			if ((selectedRois != null) && (!query.isReadOnly())){
+				if (selectedRois.size() > 0){
+					int despX = 0;
+					int despY = 0;
+					if (pValues != null){
+						despX = (int)pValues[0];
+						despY = (int)pValues[1];
+					} else if (wcValues != null){
+						despX = (int)dstoreCopy.worldToRaster(new Point2D.Double(wcValues[0], wcValues[1])).getX();
+						despY = (int)dstoreCopy.worldToRaster(new Point2D.Double(wcValues[0], wcValues[1])).getY();
+					}
+					drawOnlyROIs(buffer, selectedRois, despX, despY);
+				}
+			}
+			
+			
+			insertLineLog(Messages.getText("salvando_imagen"));
+			
+			DataManager manager = DALLocator.getDataManager();
+			String provider = "Gdal Store";
+			DataServerExplorerParameters eparams = manager.createServerExplorerParameters("FilesystemExplorer");
+			
+			String finalFileName = "";
+			NewRasterStoreParameters sparams = null;
+			processIncrement = RasterLocator.getManager().createDataServerWriter();
+			if (oneLayerPerBand) {
+				long[] milis = new long[drawableBands.length];
+				String[] fileNames = new String[drawableBands.length];
+				for (int i = 0; i < drawableBands.length; i++) {
+					fileNames[i] = fileName + "_B" + drawableBands[i] + suffix;
+					
+					int index = fileNames[i].lastIndexOf(File.separator);
+					if(index < 0)
+						index = fileNames[i].length();
+					String path = fileNames[i].substring(0, index);
+					String file = fileNames[i].substring(index + 1, fileNames[i].length());
+					
+					eparams.setDynValue("initialpath", path);
+					DataServerExplorer serverExplorer = manager.openServerExplorer(eparams.getExplorerName(), eparams);
+
+					sparams = (NewRasterStoreParameters)serverExplorer.getAddParameters(provider);
+					sparams.setDataServer((DataServerWriter)processIncrement);
+					sparams.setDestination(path, file);
+					sparams.setBuffer(buffer);
+					sparams.setColorInterpretation(new String[]{ColorInterpretation.GRAY_BAND});
+					sparams.setWktProjection(dstoreCopy.getWktProjection());
+					sparams.setBand(i);
+					sparams.setAffineTransform(affineTransform);
+					sparams.setDriverParams(params);
+					
+					serverExplorer.add(provider, sparams, true);
+					
+					saveToRmf(fileNames[i]);
+					t2 = new java.util.Date().getTime();
+					milis[i] = (t2 - t1);
+					t1 = new java.util.Date().getTime();
+				}
+				if (incrementableTask != null) {
+					incrementableTask.processFinalize();
+					incrementableTask = null;
+				}
+				for (int i = 0; i < drawableBands.length; i++) {
+					if (externalActions != null)
+						externalActions.end(new Object[] { fileName + "_B" + drawableBands[i] + suffix, new Long(milis[i]) });
+				}
+			} else {
+				File f = new File(fileName);
+				if (f.exists()) {
+					f.delete();
+				}
+				f = null;
+				
+				if(suffix != null)
+					finalFileName = fileName.endsWith(suffix) ? fileName : fileName + suffix;
+				else
+					finalFileName = fileName;
+				
+				int index = finalFileName.lastIndexOf(File.separator);
+				if(index < 0)
+					index = finalFileName.length();
+				String path = finalFileName.substring(0, index);
+				String file = finalFileName.substring(index + 1, finalFileName.length());
+				
+				eparams.setDynValue("initialpath", path);
+				DataServerExplorer serverExplorer = manager.openServerExplorer(eparams.getExplorerName(), eparams);
+
+				try {
+					provider = rManager.createWriter(finalFileName).getProviderName();
+				} catch (NotSupportedExtensionException e1) {
+					throw new ClipException(Messages.getText("no_driver_escritura"));
+				} catch (RasterDriverException e1) {
+					throw new ClipException(Messages.getText("no_driver_escritura"));
+				}
+				
+				sparams = (NewRasterStoreParameters)serverExplorer.getAddParameters(provider);
+				sparams.setDataServer((DataServerWriter)processIncrement);
+				sparams.setDestination(path, file);
+				sparams.setBuffer(buffer);
+				if(colorInterp != null)
+					sparams.setColorInterpretation(colorInterp.getValues());
+				sparams.setWktProjection(dstoreCopy.getWktProjection());
+				sparams.setAffineTransform(affineTransform);
+				sparams.setDriverParams(params);
+				sparams.setBand(-1);
+				
+				serverExplorer.add(provider, sparams, true);
+				
+				saveToRmf(finalFileName);
+				
+				
+				t2 = new java.util.Date().getTime();
+				if (incrementableTask != null) {
+					incrementableTask.processFinalize();
+					incrementableTask = null;
+				}
+				//Damos tiempo a parar el Thread del incrementable para que no se cuelgue la ventana
+				//El tiempo es como m�nimo el de un bucle del run de la tarea incrementable
+				try {
+					Thread.sleep(600);
+				} catch (InterruptedException e) {
+					throw new ProcessInterruptedException(e);
+				}
+				if (externalActions != null)
+					externalActions.end(new Object[]{fileName, new Long((t2 - t1))});
+			}
+
+		} catch (RasterDriverException e) {
+			throw new ClipException(Messages.getText("error_writer"));
+		} catch (ValidateDataParametersException e) {
+			throw new ClipException(Messages.getText("error_georasterwriter"));
+		} catch (ProviderNotRegisteredException e) {
+			throw new ClipException(Messages.getText("error_georasterwriter"));
+		} catch (InitializeException e) {
+			throw new ClipException(Messages.getText("error_georasterwriter"));
+		} catch (DataException e) {
+			throw new ClipException(Messages.getText("error_georasterwriter"));
+		} catch (Exception e) {
+			e.printStackTrace();
+		} finally {
+			if (dstoreCopy != null)
+				try {
+					dstoreCopy.close();
+				} catch (CloseException e) {
+					throw new ClipException(Messages.getText("error_writer"));
+				}
+			buffer = null;
+		}
+	}
+	
+	
+	/**
+	 * Acciones para poner a NoData los pixels que est�n fuera de las
+	 * regiones de inter�s seleccionadas.
+	 * @param buffer
+	 */
+	private void drawOnlyROIs(Buffer buffer, ArrayList<VectorialROI> rois, int despX, int despY){
+		for (int i = 0 ; i < buffer.getWidth() ; i++){
+			for (int j = 0 ; j < buffer.getHeight() ; j++){
+				boolean  inside = false;
+				for (int k = 0 ; k < rois.size() ; k++){
+					VectorialROI roi = (VectorialROI)rois.get(k);
+					//TODO: Hacer la comprobacion por coordenadas del mundo en lugar de coordenadas pixel.
+					if (roi.isInGrid(i + despX, j + despY)){
+						inside = true;
+					}
+				}
+				if (!inside){
+					for (int l = 0 ; l < buffer.getBandCount() ; l++){
+						if (buffer.getDataType() == Buffer.TYPE_BYTE){
+							buffer.setElem(j, i, l, 
+									buffer.getNoDataValue().isDefined() ? buffer.getNoDataValue().getValue().byteValue() : RasterLibrary.defaultByteNoDataValue);
+						} else if (buffer.getDataType() == Buffer.TYPE_SHORT){
+							buffer.setElem(j, i, l, 
+									buffer.getNoDataValue().isDefined() ? buffer.getNoDataValue().getValue().shortValue() : RasterLibrary.defaultShortNoDataValue);
+						} else if (buffer.getDataType() == Buffer.TYPE_INT){
+							buffer.setElem(j, i, l, 
+									buffer.getNoDataValue().isDefined() ? buffer.getNoDataValue().getValue().intValue() : RasterLibrary.defaultIntegerNoDataValue);
+						} else if (buffer.getDataType() == Buffer.TYPE_FLOAT){
+							buffer.setElem(j, i, l, 
+									buffer.getNoDataValue().isDefined() ? buffer.getNoDataValue().getValue().floatValue() : RasterLibrary.defaultFloatNoDataValue);
+						} else if (buffer.getDataType() == Buffer.TYPE_DOUBLE){
+							buffer.setElem(j, i, l, 
+									buffer.getNoDataValue().isDefined() ? buffer.getNoDataValue().getValue().doubleValue() : RasterLibrary.defaultDoubleNoDataValue);
+						}
+					}
+				}
+			}
+		}
+	}
+	
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#getPercent()
+	 */
+	public int getPercent() {
+		return (processIncrement != null) ? processIncrement.getPercent() : 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.incrementabletask.IIncrementable#getTitle()
+	 */
+	public String getTitle() {
+		return Messages.getText("incremento_recorte");
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see java.lang.Object#finalize()
+	 */
+	protected void finalize() throws Throwable {
+		fileName            = null;
+		suffix              = null;
+		rasterSE            = null;
+		drawableBands       = null;
+		pValues             = null;
+		params              = null;
+		colorInterp         = null;
+		affineTransform     = null;
+		wcValues            = null;
+		buffer              = null;
+		processIncrement    = null;
+		if(selectedRois != null) {
+			selectedRois.clear();
+			selectedRois = null;
+		}
+		super.finalize();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/java/org/gvsig/raster/tools/algorithm/clip/ClipProcess.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/java/org/gvsig/raster/tools/algorithm/clip
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/java/org/gvsig/raster/tools/algorithm
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/java/org/gvsig/raster/tools
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/java/org/gvsig/raster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/java/org/gvsig
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/java/org
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/java
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 8183)
@@ -0,0 +1 @@
+org.gvsig.raster.tools.algorithm.saveraster.ClipAlgorithmLibrary
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/resources/META-INF/services
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/resources/META-INF
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main/resources
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src/main
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/src
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/pom.xml
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/pom.xml	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip/pom.xml	(revision 8183)
@@ -0,0 +1,30 @@
+<?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.tools.algorithm.clip</artifactId>
+	<packaging>jar</packaging>
+	<name>org.gvsig.raster.tools.algorithm.clip</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.tools.algorithm</artifactId>
+		<version>2.2.0-SNAPSHOT</version>
+	</parent>
+    <dependencies>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.algorithm</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<!--Dependencia debido a que este algoritmo rasteriza capas de gvSIG.-->
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.fmap</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.mapcontext</artifactId>
+            <scope>compile</scope>
+		</dependency>
+	</dependencies>
+</project>

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


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.clip
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestPrintPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestPrintPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestPrintPanel.java	(revision 8183)
@@ -0,0 +1,47 @@
+/**
+ * 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.tools.algorithm.swing.impl.saveraster;
+
+
+import javax.swing.JFrame;
+
+public class TestPrintPanel {
+	private int                          w        = 300;
+	private int                          h        = 200;
+	private JFrame                       frame    = new JFrame();
+	private PrintSelectionPanel          desc     = null;
+
+	public TestPrintPanel() {
+		desc = new PrintSelectionPanel();
+		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 TestPrintPanel();
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestPrintPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestSelectFilePanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestSelectFilePanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestSelectFilePanel.java	(revision 8183)
@@ -0,0 +1,47 @@
+/**
+ * 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.tools.algorithm.swing.impl.saveraster;
+
+
+import javax.swing.JFrame;
+
+public class TestSelectFilePanel {
+	private int                          w        = 300;
+	private int                          h        = 200;
+	private JFrame                       frame    = new JFrame();
+	private OutputSelectionPanel              desc     = null;
+
+	public TestSelectFilePanel() {
+		desc = new OutputSelectionPanel();
+		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 TestSelectFilePanel();
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestSelectFilePanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestCoordinatesSelectionPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestCoordinatesSelectionPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestCoordinatesSelectionPanel.java	(revision 8183)
@@ -0,0 +1,47 @@
+/**
+ * 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.tools.algorithm.swing.impl.saveraster;
+
+
+import javax.swing.JFrame;
+
+public class TestCoordinatesSelectionPanel {
+	private int                          w        = 300;
+	private int                          h        = 200;
+	private JFrame                       frame    = new JFrame();
+	private CoordinatesSelectionPanel    desc     = null;
+
+	public TestCoordinatesSelectionPanel() {
+		desc = new CoordinatesSelectionPanel();
+		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 TestCoordinatesSelectionPanel();
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestCoordinatesSelectionPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestPixelPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestPixelPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestPixelPanel.java	(revision 8183)
@@ -0,0 +1,47 @@
+/**
+ * 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.tools.algorithm.swing.impl.saveraster;
+
+
+import javax.swing.JFrame;
+
+public class TestPixelPanel {
+	private int                          w        = 300;
+	private int                          h        = 200;
+	private JFrame                       frame    = new JFrame();
+	private PixelSelectionPanel          desc     = null;
+
+	public TestPixelPanel() {
+		desc = new PixelSelectionPanel();
+		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 TestPixelPanel();
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestPixelPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestMainPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestMainPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestMainPanel.java	(revision 8183)
@@ -0,0 +1,47 @@
+/**
+ * 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.tools.algorithm.swing.impl.saveraster;
+
+
+import javax.swing.JFrame;
+
+public class TestMainPanel {
+	private int                          w        = 300;
+	private int                          h        = 550;
+	private JFrame                       frame    = new JFrame();
+	private SaveRasterMainPanel                    desc     = null;
+
+	public TestMainPanel() {
+		desc = new SaveRasterMainPanel();
+		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 TestMainPanel();
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestMainPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestPrintAndPxPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestPrintAndPxPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestPrintAndPxPanel.java	(revision 8183)
@@ -0,0 +1,47 @@
+/**
+ * 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.tools.algorithm.swing.impl.saveraster;
+
+
+import javax.swing.JFrame;
+
+public class TestPrintAndPxPanel {
+	private int                               w        = 300;
+	private int                               h        = 400;
+	private JFrame                            frame    = new JFrame();
+	private PrintAndPxSelectionPanel          desc     = null;
+
+	public TestPrintAndPxPanel() {
+		desc = new PrintAndPxSelectionPanel();
+		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 TestPrintAndPxPanel();
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/TestPrintAndPxPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestComboTextPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestComboTextPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestComboTextPanel.java	(revision 8183)
@@ -0,0 +1,26 @@
+package org.gvsig.raster.tools.algorithm.swing.impl;
+
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.tools.algorithm.swing.impl.bean.combotext.ComboTextImpl;
+
+public class TestComboTextPanel {
+	private int                              w        = 400;
+	private int                              h        = 130;
+	private JFrame                           frame    = new JFrame();
+	private ComboTextImpl                    ui       = null;
+
+	public TestComboTextPanel() {
+		ui = new ComboTextImpl(new String[]{"uno", "dos"}, true, true);
+		frame.getContentPane().add(ui);
+		frame.setSize(w, h);
+		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+		frame.setVisible(true);
+	}
+
+	public static void main(String[] args) {
+		new TestComboTextPanel();
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestComboTextPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestLayerDatatypePanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestLayerDatatypePanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestLayerDatatypePanel.java	(revision 8183)
@@ -0,0 +1,28 @@
+package org.gvsig.raster.tools.algorithm.swing.impl;
+
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.tools.algorithm.swing.impl.layerdatatype.LayerDatatypePanelImpl;
+import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
+
+public class TestLayerDatatypePanel {
+	private int                              w        = 400;
+	private int                              h        = 410;
+	private JFrame                           frame    = new JFrame();
+	private LayerDatatypePanelImpl           ui       = null;
+
+	public TestLayerDatatypePanel() {
+		new DefaultLibrariesInitializer().fullInitialize(true);
+		ui = new LayerDatatypePanelImpl(null, "BYTE", "Este es el nombre de la capa");
+		frame.getContentPane().add(ui);
+		frame.setSize(w, h);
+		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+		frame.setVisible(true);
+	}
+
+	public static void main(String[] args) {
+		new TestLayerDatatypePanel();
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestLayerDatatypePanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestMaskThresholdPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestMaskThresholdPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestMaskThresholdPanel.java	(revision 8183)
@@ -0,0 +1,26 @@
+package org.gvsig.raster.tools.algorithm.swing.impl;
+
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.tools.algorithm.swing.impl.maskthreshold.MaskThresholdPanelImpl;
+
+public class TestMaskThresholdPanel {
+	private int                              w        = 400;
+	private int                              h        = 410;
+	private JFrame                           frame    = new JFrame();
+	private MaskThresholdPanelImpl           ui       = null;
+
+	public TestMaskThresholdPanel() {
+		ui = new MaskThresholdPanelImpl();
+		frame.getContentPane().add(ui);
+		frame.setSize(w, h);
+		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+		frame.setVisible(true);
+	}
+
+	public static void main(String[] args) {
+		new TestMaskThresholdPanel();
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestMaskThresholdPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestOperationMaskThresholdPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestOperationMaskThresholdPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestOperationMaskThresholdPanel.java	(revision 8183)
@@ -0,0 +1,26 @@
+package org.gvsig.raster.tools.algorithm.swing.impl;
+
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.tools.algorithm.swing.impl.maskthreshold.OperationMaskThresholdImpl;
+
+public class TestOperationMaskThresholdPanel {
+	private int                              w        = 400;
+	private int                              h        = 230;
+	private JFrame                           frame    = new JFrame();
+	private OperationMaskThresholdImpl                    ui       = null;
+
+	public TestOperationMaskThresholdPanel() {
+		ui = new OperationMaskThresholdImpl();
+		frame.getContentPane().add(ui);
+		frame.setSize(w, h);
+		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+		frame.setVisible(true);
+	}
+
+	public static void main(String[] args) {
+		new TestOperationMaskThresholdPanel();
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestOperationMaskThresholdPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestOutputMaskThresholdPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestOutputMaskThresholdPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestOutputMaskThresholdPanel.java	(revision 8183)
@@ -0,0 +1,26 @@
+package org.gvsig.raster.tools.algorithm.swing.impl;
+
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.tools.algorithm.swing.impl.maskthreshold.OutputMaskThresholdImpl;
+
+public class TestOutputMaskThresholdPanel {
+	private int                              w        = 400;
+	private int                              h        = 230;
+	private JFrame                           frame    = new JFrame();
+	private OutputMaskThresholdImpl          ui       = null;
+
+	public TestOutputMaskThresholdPanel() {
+		ui = new OutputMaskThresholdImpl();
+		frame.getContentPane().add(ui);
+		frame.setSize(w, h);
+		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+		frame.setVisible(true);
+	}
+
+	public static void main(String[] args) {
+		new TestOutputMaskThresholdPanel();
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestOutputMaskThresholdPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestInputLayerPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestInputLayerPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestInputLayerPanel.java	(revision 8183)
@@ -0,0 +1,28 @@
+package org.gvsig.raster.tools.algorithm.swing.impl;
+
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.tools.algorithm.swing.impl.bean.inputlayer.InputLayerImpl;
+
+public class TestInputLayerPanel {
+	private int                              w        = 400;
+	private int                              h        = 130;
+	private JFrame                           frame    = new JFrame();
+	private InputLayerImpl                   ui       = null;
+
+	public TestInputLayerPanel() {
+		ui = new InputLayerImpl(null, true, false);
+		ui.getBandsSelectorCombo().addItem("uno");
+		ui.getBandsSelectorCombo().addItem("dos");
+		frame.getContentPane().add(ui);
+		frame.setSize(w, h);
+		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+		frame.setVisible(true);
+	}
+
+	public static void main(String[] args) {
+		new TestInputLayerPanel();
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl/TestInputLayerPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing/impl
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm/swing
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools/algorithm
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster/tools
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig/raster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org/gvsig
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java/org
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test/java
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/test
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org/gvsig/raster/tools/algorithm/swing/impl/i18n/text/text.properties
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org/gvsig/raster/tools/algorithm/swing/impl/i18n/text/text.properties	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org/gvsig/raster/tools/algorithm/swing/impl/i18n/text/text.properties	(revision 8183)
@@ -0,0 +1,22 @@
+origen=Origen
+dest_proj=CRS de destino
+src_proj=CRS de origen
+interpolation=Interpolaci�n
+yes=Si
+no=No
+sizex=Ancho
+sizey=Alto
+cellsize=Tama�o de celda
+output_options=Opciones
+value=Valor
+layer=Capa
+operation=Operaci�n
+input=Entrada
+layers=Capas
+bands=Bandas
+output=Salida
+all=Todas
+entrada=Entrada
+salida=Salida
+adjust_dec2int=Ajustar Decimales
+adjust_big2small=Ajustar Enteros
\ No newline at end of file

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org/gvsig/raster/tools/algorithm/swing/impl/i18n/text/text_en.properties
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org/gvsig/raster/tools/algorithm/swing/impl/i18n/text/text_en.properties	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org/gvsig/raster/tools/algorithm/swing/impl/i18n/text/text_en.properties	(revision 8183)
@@ -0,0 +1,22 @@
+origen=Source
+dest_proj=CRS of destination
+src_proj=CRS source
+interpolation=Interpolation
+yes=Yes
+no=No
+sizex=Width
+sizey=Height
+cellsize=Cell size
+output_options=Options
+value=Value
+layer=Layer
+operation=Operation
+input=Input
+layers=Layers
+bands=Bands
+output=Output
+all=All
+entrada=Input
+salida=Output
+adjust_dec2int=Adjust decimal
+adjust_big2small=Adjust integer
\ No newline at end of file

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


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org/gvsig/raster/tools/algorithm/swing/impl/i18n/text
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org/gvsig/raster/tools/algorithm/swing/impl/i18n/text.properties
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org/gvsig/raster/tools/algorithm/swing/impl/i18n/text.properties	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org/gvsig/raster/tools/algorithm/swing/impl/i18n/text.properties	(revision 8183)
@@ -0,0 +1,39 @@
+origen=Origen
+dest_proj=CRS de destino
+src_proj=CRS de origen
+interpolation=Interpolaci�n
+yes=Si
+no=No
+sizex=Ancho
+sizey=Alto
+cellsize=Tama�o de celda
+output_options=Opciones
+value=Valor
+layer=Capa
+operation=Operaci�n
+input=Entrada
+layers=Capas
+bands=Bandas
+output=Salida
+all=Todas
+entrada=Entrada
+salida=Salida
+adjust_dec2int=Decimal a entero
+adjust_big2small=Mayor a menor
+datatype=Tipo de dato
+layer=Capa
+width=Ancho
+height=Alto
+cellsize=Tama�o pixel
+pixel_selection=Selecci�n por p�xeles
+coordenadas_reales=Coordenadas reales
+scale=Escala
+width_cms=Ancho (cms)
+height_cms=Alto (cms)
+resolution=Resoluci�n
+width_result=Ancho resultado
+height_result=Alto resultado
+result_size=Tama�o del resultado (raw)
+file=Fichero
+print_selection=Selecci�n para impresi�n
+

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

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org/gvsig/raster/tools/algorithm/swing/impl/i18n/text_en.properties
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org/gvsig/raster/tools/algorithm/swing/impl/i18n/text_en.properties	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org/gvsig/raster/tools/algorithm/swing/impl/i18n/text_en.properties	(revision 8183)
@@ -0,0 +1,38 @@
+origen=Source
+dest_proj=CRS of destination
+src_proj=CRS source
+interpolation=Interpolation
+yes=Yes
+no=No
+sizex=Width
+sizey=Height
+cellsize=Cell size
+output_options=Options
+value=Value
+layer=Layer
+operation=Operation
+input=Input
+layers=Layers
+bands=Bands
+output=Output
+all=All
+entrada=Input
+salida=Output
+adjust_dec2int=Decimal to integer
+adjust_big2small=Major to minor
+datatype=Datatype
+layer=Layer
+width=Width
+height=Height
+cellsize=Cell size
+pixel_selection=Selection by pixel
+coordenadas_reales=World coordinates
+scale=Scale
+width_cms=Width (cms)
+height_cms=Height (cms)
+resolution=Resolution
+width_result=Width result
+height_result=Height result
+result_size=Size of the output (raw)
+file=File
+print_selection=Selection to print

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


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org/gvsig/raster/tools/algorithm/swing/impl/i18n
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org/gvsig/raster/tools/algorithm/swing/impl
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org/gvsig/raster/tools/algorithm/swing
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org/gvsig/raster/tools/algorithm
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org/gvsig/raster/tools
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org/gvsig/raster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org/gvsig
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/org
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 8183)
@@ -0,0 +1 @@
+org.gvsig.raster.tools.algorithm.swing.impl.AlgorithmSwingImplLibrary
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/META-INF/services
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources/META-INF
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/resources
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/util/InputFieldPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/util/InputFieldPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/util/InputFieldPanel.java	(revision 8183)
@@ -0,0 +1,100 @@
+package org.gvsig.raster.tools.algorithm.swing.impl.util;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.text.DecimalFormat;
+
+import javax.swing.JFormattedTextField;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class InputFieldPanel extends JPanel implements PropertyChangeListener {
+	private static final long      serialVersionUID    = 1L;
+	public static int              DOUBLE              = 0;
+	public static int              INT                 = 1;
+	
+	private JFormattedTextField    box;
+	private PropertyChangeListener listener            = null;
+	private JLabel                 label               = null;
+	private int                    type                = -1;
+	
+	public InputFieldPanel(String txt, int type) {
+		this.type = type;
+		if(type == DOUBLE) {
+			box = new JFormattedTextField(new DecimalFormat("########.########"));
+			box.setValue(0.0);
+		}
+		
+		if(type == INT) {
+			box = new JFormattedTextField(new DecimalFormat("########"));
+			box.setValue(0);
+		}
+		
+		box.addPropertyChangeListener("value", this);
+		setLayout(new GridBagLayout());
+		GridBagConstraints gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.insets = new Insets(0, 0, 0, 0);
+		getLabel().setText(txt + " ");
+		add(getLabel(), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.weightx = 1.0;
+		add(box, gridBagConstraints);
+	}
+	
+	public JLabel getLabel() {
+		if(label == null)
+			label = new JLabel();
+		return label;
+	}
+	
+	public void setText(String txt) {
+		getLabel().setText(txt + " ");
+	}
+	
+	public String getValue() {
+		if(type == DOUBLE) {
+			double n = ((Number) box.getValue()).doubleValue();
+			return Double.toString(n);
+		}
+		if(type == INT) {
+			int n = ((Number) box.getValue()).intValue();
+			return Integer.toString(n);
+		}
+		return null;
+	}
+	
+	public void setValue(String value) {
+		if(type == DOUBLE) {
+			box.setValue(new Double(value));
+		}
+		if(type == INT) {
+			box.setValue(new Integer(value));
+		}
+	}
+
+	public void setListener(PropertyChangeListener listener) {
+		this.listener = listener;
+	}
+	
+	public void propertyChange(PropertyChangeEvent evt) {
+		if(listener != null)
+			listener.propertyChange(evt);
+	}
+	
+	public void setEnable(boolean enabled) {
+		box.setEnabled(enabled);
+		getLabel().setEnabled(enabled);
+	}
+	
+	public JFormattedTextField getTextField() {
+		return box;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/util/InputFieldPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/util
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/DefaultAlgorithmSwingManager.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/DefaultAlgorithmSwingManager.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/DefaultAlgorithmSwingManager.java	(revision 8183)
@@ -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.tools.algorithm.swing.impl;
+
+import org.gvsig.raster.algorithm.BasicAPISwingPanel;
+import org.gvsig.raster.tools.algorithm.swing.AlgorithmSwingManager;
+import org.gvsig.raster.tools.algorithm.swing.impl.layerdatatype.LayerDatatypePanelImpl;
+import org.gvsig.raster.tools.algorithm.swing.impl.maskthreshold.MaskThresholdPanelImpl;
+import org.gvsig.raster.tools.algorithm.swing.impl.saveraster.SaveRasterMainPanel;
+import org.gvsig.raster.tools.algorithm.swing.maskthreshold.MaskThresholdPanel;
+import org.gvsig.raster.tools.algorithm.swing.saveraster.SaveRasterPanel;
+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 DefaultAlgorithmSwingManager implements AlgorithmSwingManager {
+	private static final Logger  logger = LoggerFactory.getLogger(DefaultAlgorithmSwingManager.class);
+    private I18nManager i18nmanager = null;
+
+    public DefaultAlgorithmSwingManager() {
+        this.i18nmanager = ToolsLocator.getI18nManager();       
+    }
+
+    public String getTranslation(String key) {
+        return this.i18nmanager.getTranslation(key);
+    }
+    
+	/**
+	 * 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 MaskThresholdPanel createMaskThresholdPanel() {
+		return new MaskThresholdPanelImpl();
+	}
+
+	public BasicAPISwingPanel createLayerDatatypePanel(Object inputStore, String inputDatatype, String layerName) {
+		return new LayerDatatypePanelImpl(inputStore, inputDatatype, layerName);
+	}
+	
+	public SaveRasterPanel createSaveRasterPanel() {
+    	return new SaveRasterMainPanel();
+    }
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/DefaultAlgorithmSwingManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/PrintAndPxSelectionPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/PrintAndPxSelectionPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/PrintAndPxSelectionPanel.java	(revision 8183)
@@ -0,0 +1,111 @@
+package org.gvsig.raster.tools.algorithm.swing.impl.saveraster;
+
+import java.awt.Color;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.gvsig.i18n.Messages;
+
+/**
+ * Panel to select coordinates of the output layer
+ *  
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class PrintAndPxSelectionPanel extends JPanel implements ActionListener {
+	private static final long       serialVersionUID      = 1L;
+	private PixelSelectionPanel     pixelSelectionPanel   = null;
+	private PrintSelectionPanel     printSelectionPanel   = null;
+	private JLabel                  sizeImage             = null;
+	
+	public PrintAndPxSelectionPanel() {
+		init();
+	}
+	
+	private void init() {
+		ButtonGroup group = new ButtonGroup();
+		group.add(getPixelSelectionPanel().getRadioPxSelection());
+		group.add(getPrintSelectionPanel().getRadioPrintSelection());
+		getPixelSelectionPanel().setEnable(true);
+		getPrintSelectionPanel().setEnable(false);
+		
+		setLayout(new GridBagLayout());
+		
+		GridBagConstraints gbc = new GridBagConstraints();
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.insets = new Insets(4, 4, 4, 4);
+		gbc.weightx = 1;
+		gbc.weighty = 0;
+		
+		gbc.gridy = 0;
+		add(getPixelSelectionPanel(), gbc);
+		
+		gbc.gridy = 1;
+		add(getPrintSelectionPanel(), gbc);
+		
+		gbc.gridy = 2;
+		add(getSizeImage(), gbc);
+		
+		/*gbc.fill = GridBagConstraints.BOTH;
+		gbc.weightx = 1;
+		gbc.weighty = 1;
+		gbc.gridy = 3;
+		add(new JPanel(), gbc);*/
+	}
+
+	public PixelSelectionPanel getPixelSelectionPanel() {
+		if(pixelSelectionPanel == null) {
+			pixelSelectionPanel = new PixelSelectionPanel();
+			pixelSelectionPanel.getRadioPxSelection().addActionListener(this);
+		}
+		return pixelSelectionPanel;
+	}
+
+	public PrintSelectionPanel getPrintSelectionPanel() {
+		if(printSelectionPanel == null) {
+			printSelectionPanel = new PrintSelectionPanel();
+			printSelectionPanel.getRadioPrintSelection().addActionListener(this);
+		}
+		return printSelectionPanel;
+	}
+
+	public JLabel getSizeImage() {
+		if(sizeImage == null) {
+			sizeImage = new JLabel(Messages.getText("result_size") + ": 0 MB");
+			sizeImage.setForeground(Color.red);
+		}
+		return sizeImage;
+	}
+	
+	public void setSize(double size) {
+		getSizeImage().setText(Messages.getText("result_size") + ": " + size + " MB");
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if(e.getSource() == getPixelSelectionPanel().getRadioPxSelection()) {
+			if(getPixelSelectionPanel().getRadioPxSelection().isEnabled()) {
+				getPixelSelectionPanel().setEnable(true);
+				getPrintSelectionPanel().setEnable(false);
+			} else {
+				getPixelSelectionPanel().setEnable(false);
+				getPrintSelectionPanel().setEnable(true);
+			}
+		}
+		
+		if(e.getSource() == getPrintSelectionPanel().getRadioPrintSelection()) {
+			if(getPrintSelectionPanel().getRadioPrintSelection().isEnabled()) {
+				getPixelSelectionPanel().setEnable(false);
+				getPrintSelectionPanel().setEnable(true);
+			} else {
+				getPixelSelectionPanel().setEnable(true);
+				getPrintSelectionPanel().setEnable(false);
+			}
+		}
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/PrintAndPxSelectionPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/CoordinatesSelectionPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/CoordinatesSelectionPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/CoordinatesSelectionPanel.java	(revision 8183)
@@ -0,0 +1,43 @@
+package org.gvsig.raster.tools.algorithm.swing.impl.saveraster;
+
+import java.awt.BorderLayout;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.gvsig.gui.beans.coordinatespanel.CoordinatesPanel;
+import org.gvsig.i18n.Messages;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+
+/**
+ * Panel to select coordinates of the output layer
+ *  
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class CoordinatesSelectionPanel extends JPanel {
+	private static final long  serialVersionUID   = 2294445086139039312L;
+	private CoordinatesPanel   coordinatesPanel   = null;
+    private I18nManager i18n = ToolsLocator.getI18nManager();
+    private JLabel lCoordTag = new JLabel();
+
+	/**
+	 * Constructor. Crea los paneles y a�adel el objeto CoordinatesPanel.
+	 */
+	public CoordinatesSelectionPanel() {
+		BorderLayout layout = new BorderLayout(2,2);
+		this.setLayout(layout);		
+		setBorder(javax.swing.BorderFactory.createTitledBorder(i18n.getTranslation("coordenadas_reales")));
+		coordinatesPanel = new CoordinatesPanel(6);
+		this.add(lCoordTag,BorderLayout.NORTH);
+		this.add(coordinatesPanel,BorderLayout.SOUTH);
+	}
+
+	/**
+	 * Obtiene el panel con las coordenadas de la selecci�n en la vista
+	 * @return
+	 */
+	public CoordinatesPanel getCoordinatesPanel() {
+		return coordinatesPanel;
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/CoordinatesSelectionPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/PrintSelectionPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/PrintSelectionPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/PrintSelectionPanel.java	(revision 8183)
@@ -0,0 +1,180 @@
+package org.gvsig.raster.tools.algorithm.swing.impl.saveraster;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.BorderFactory;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.tools.algorithm.swing.impl.util.InputFieldPanel;
+
+/**
+ * Panel to select print parameters of the output layer
+ *  
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class PrintSelectionPanel extends JPanel {
+	private static final long   serialVersionUID     = 1L;
+	private InputFieldPanel     scale                = null;
+	private InputFieldPanel     width                = null;
+	private InputFieldPanel     height               = null;
+	private JRadioButton        radioPrintSelection  = null;
+	private JComboBox           dpi                  = null;
+	private JLabel              labelWidth           = null;
+	private JLabel              labelHeight          = null;
+	private JLabel              resolution           = null;
+	private int                 w                    = 0;
+	private int                 h                    = 0;
+	
+	public PrintSelectionPanel() {
+		init();
+	}
+	
+	private void init() {
+		setLayout(new GridBagLayout());
+		setBorder(BorderFactory.createTitledBorder(""));
+		
+		GridBagConstraints gbc = new GridBagConstraints();
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.insets = new Insets(2, 2, 4, 2);
+		gbc.weightx = 1;
+		gbc.weighty = 0;
+		gbc.gridwidth = 2;
+		
+		gbc.gridx = 0;
+		gbc.gridy = 0;
+		add(getRadioPrintSelection(), gbc);
+		
+		gbc.gridwidth = 1;
+		
+		gbc.gridx = 0;
+		gbc.gridy = 1;
+		add(getWidthInput(), gbc);
+		
+		gbc.gridx = 1;
+		gbc.gridy = 1;
+		add(new JPanel(), gbc);
+		
+		//...................
+		
+		gbc.gridx = 0;
+		gbc.gridy = 2;
+		add(getHeightInput(), gbc);
+		
+		gbc.gridx = 1;
+		gbc.gridy = 2;
+		add(getScale(), gbc);
+		
+		//...................
+		
+		gbc.gridx = 0;
+		gbc.gridy = 3;
+		resolution = new JLabel(Messages.getText("resolution") + " (dpi)");
+		add(resolution, gbc);
+		
+		gbc.gridx = 1;
+		gbc.gridy = 3;
+		add(getComboDPI(), gbc);
+		
+		//...................
+		
+		gbc.gridwidth = 2;
+		
+		gbc.gridx = 0;
+		gbc.gridy = 4;
+		add(getLabelWidth(), gbc);
+		
+		gbc.gridx = 0;
+		gbc.gridy = 5;
+		add(getLabelHeight(), gbc);
+		
+		/*gbc.fill = GridBagConstraints.BOTH;
+		gbc.weightx = 1;
+		gbc.weighty = 1;
+		gbc.gridx = 0;
+		gbc.gridy = 6;
+		add(new JPanel(), gbc);*/
+	}
+	
+	public JComboBox getComboDPI() {
+		if(dpi == null) {
+			dpi = new JComboBox();
+			dpi.addItem("72");
+			dpi.addItem("96");
+			dpi.addItem("160");
+			dpi.addItem("300");
+			dpi.addItem("600");
+			dpi.addItem("2540");
+			dpi.addItem("4000");
+		}
+		return dpi;
+	}
+	
+	public InputFieldPanel getScale() {
+		if(scale == null)
+			scale = new InputFieldPanel(Messages.getText("scale") + " 1:", InputFieldPanel.INT);
+		return scale;
+	}
+
+	public InputFieldPanel getWidthInput() {
+		if(width == null)
+			width = new InputFieldPanel(Messages.getText("width_cms"), InputFieldPanel.INT);
+		return width;
+	}
+
+	public InputFieldPanel getHeightInput() {
+		if(height == null)
+			height = new InputFieldPanel(Messages.getText("height_cms"), InputFieldPanel.INT);
+		return height;
+	}
+
+	public JRadioButton getRadioPrintSelection() {
+		if(radioPrintSelection == null)
+			radioPrintSelection = new JRadioButton(Messages.getText("print_selection"));
+		return radioPrintSelection;
+	}
+	
+	public void setSizePxResult(int w, int h) {
+		this.w = w;
+		this.h = h;
+		labelWidth.setText(Messages.getText("width_result") + ": " + w + " px");
+		labelHeight.setText(Messages.getText("height_result") + ": " + h + " px");
+	}
+	
+	public int getWidthPx() {
+		return w;
+	}
+	
+	public int getHeightPx() {
+		return h;
+	}
+	
+	public JLabel getLabelWidth() {
+		if(labelWidth == null) {
+			labelWidth = new JLabel(Messages.getText("width_result") + ": 0 px");
+		}
+		return labelWidth;
+	}
+	
+	public JLabel getLabelHeight() {
+		if(labelHeight == null) {
+			labelHeight = new JLabel(Messages.getText("height_result") + ": 0 px");
+		}
+		return labelHeight;
+	}
+	
+	public void setEnable(boolean enabled) {
+		getScale().setEnable(enabled);
+		getWidthInput().setEnable(enabled);
+		getHeightInput().setEnable(enabled);
+		getComboDPI().setEnabled(enabled);
+		getLabelHeight().setEnabled(enabled);
+		getLabelWidth().setEnabled(enabled);
+		resolution.setEnabled(enabled);
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/PrintSelectionPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/SaveRasterMainPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/SaveRasterMainPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/SaveRasterMainPanel.java	(revision 8183)
@@ -0,0 +1,298 @@
+package org.gvsig.raster.tools.algorithm.swing.impl.saveraster;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionListener;
+import java.beans.PropertyChangeListener;
+
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.gvsig.gui.beans.datainput.DataInputContainer;
+import org.gvsig.gui.beans.datainput.DataInputContainerListener;
+import org.gvsig.raster.tools.algorithm.swing.impl.util.InputFieldPanel;
+import org.gvsig.raster.tools.algorithm.swing.saveraster.SaveRasterPanel;
+
+/**
+ * Panel to select width, height or pixel size of the output layer
+ *  
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SaveRasterMainPanel extends JPanel implements SaveRasterPanel {
+	private static final long            serialVersionUID   = 1L;
+	private CoordinatesSelectionPanel    coordinatesPanel   = null;
+	private PrintAndPxSelectionPanel     methodPanel        = null;
+	private OutputSelectionPanel         outputPanel        = null;
+	
+	public SaveRasterMainPanel() {
+		init();
+	}
+	
+	private void init() {
+		setLayout(new GridBagLayout());
+		
+		GridBagConstraints gbc = new GridBagConstraints();
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.insets = new Insets(4, 4, 4, 4);
+		gbc.weightx = 1;
+		gbc.weighty = 0;
+		
+		gbc.gridy = 0;
+		add(getWCCoordsPanel(), gbc);
+		
+		gbc.gridy = 1;
+		add(getMethodPanel(), gbc);
+		
+		gbc.gridy = 2;
+		add(getMethodPanel(), gbc);
+		
+		gbc.gridy = 3;
+		add(getOutputPanel(), gbc);
+		
+		gbc.fill = GridBagConstraints.BOTH;
+		gbc.weighty = 1;
+		gbc.gridy = 4;
+		add(new JPanel(), gbc);
+	}
+
+	public CoordinatesSelectionPanel getWCCoordsPanel() {
+		if(coordinatesPanel == null)
+			coordinatesPanel = new CoordinatesSelectionPanel();
+		return coordinatesPanel;
+	}
+
+	public PrintAndPxSelectionPanel getMethodPanel() {
+		if(methodPanel == null)
+			methodPanel = new PrintAndPxSelectionPanel();
+		return methodPanel;
+	}
+
+	public OutputSelectionPanel getOutputPanel() {
+		if(outputPanel == null)
+			outputPanel = new OutputSelectionPanel();
+		return outputPanel;
+	}
+	
+	//API
+	
+	public void addValueChangedListener(DataInputContainerListener listener) {
+		getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer11().addValueChangedListener(listener);
+		getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer21().addValueChangedListener(listener);
+		getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer12().addValueChangedListener(listener);
+		getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer22().addValueChangedListener(listener);
+	}
+	
+	public void addPropertiesChangeListener(PropertyChangeListener listener) {
+		getMethodPanel().getPixelSelectionPanel().getWidthInput().setListener(listener);
+		getMethodPanel().getPixelSelectionPanel().getHeightInput().setListener(listener);
+		getMethodPanel().getPixelSelectionPanel().getCellsize().setListener(listener);
+		getMethodPanel().getPrintSelectionPanel().getWidthInput().setListener(listener);
+		getMethodPanel().getPrintSelectionPanel().getHeightInput().setListener(listener);
+		getMethodPanel().getPrintSelectionPanel().getScale().setListener(listener);
+	}
+	
+	public void addActionListener(ActionListener listener) {
+		getMethodPanel().getPixelSelectionPanel().getRadioPxSelection().addActionListener(listener);
+		getMethodPanel().getPrintSelectionPanel().getRadioPrintSelection().addActionListener(listener);
+		getMethodPanel().getPrintSelectionPanel().getComboDPI().addActionListener(listener);
+		getOutputPanel().getBSelect().addActionListener(listener);
+		getOutputPanel().getBProperties().addActionListener(listener);
+	}
+	
+	public boolean isPixelMethodSelected() {
+		return getMethodPanel().getPixelSelectionPanel().getRadioPxSelection().isSelected();
+	}
+	
+	public JComponent getComponent() {
+		return this;
+	}
+	
+	public int getComponentID(Object obj) {
+		if(obj == getMethodPanel().getPixelSelectionPanel().getWidthInput().getTextField())
+			return WIDTH_COMPONENT;
+		if(obj == getMethodPanel().getPixelSelectionPanel().getHeightInput().getTextField())
+			return HEIGHT_COMPONENT;
+		if(obj == getMethodPanel().getPixelSelectionPanel().getCellsize().getTextField())
+			return CELLSIZE_COMPONENT;
+		if(obj == getMethodPanel().getPrintSelectionPanel().getWidthInput().getTextField())
+			return WCMS_COMPONENT;
+		if(obj == getMethodPanel().getPrintSelectionPanel().getHeightInput().getTextField())
+			return HCMS_COMPONENT;
+		if(obj == getMethodPanel().getPrintSelectionPanel().getScale().getTextField())
+			return SCALE_COMPONENT;
+		if(obj == getMethodPanel().getPrintSelectionPanel().getComboDPI())
+			return RESOLUTION_COMPONENT;
+		if(obj == getOutputPanel().getBSelect())
+			return FILESEL_COMPONENT;
+		if(obj == getOutputPanel().getBProperties())
+			return PROPS_COMPONENT;
+		if(obj == getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer11().getDataInputField())
+			return ULX_COMPONENT;
+		if(obj == getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer12().getDataInputField())
+			return ULY_COMPONENT;
+		if(obj == getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer21().getDataInputField())
+			return LRX_COMPONENT;
+		if(obj == getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer22().getDataInputField())
+			return LRY_COMPONENT;
+		if(obj == getMethodPanel().getPixelSelectionPanel().getRadioPxSelection())
+			return PIXEL_SELECTOR;
+		if(obj == getMethodPanel().getPrintSelectionPanel().getRadioPrintSelection())
+			return PRINT_SELECTOR;
+		return -1;
+	}
+	
+	public void setSizeMB(double mb) {
+		getMethodPanel().setSize(mb);
+	}
+	
+	public String getCellSize() {
+		return getMethodPanel().getPixelSelectionPanel().getCellsize().getValue();
+	}
+	
+	public void setCellSize(String value) {
+		getMethodPanel().getPixelSelectionPanel().getCellsize().setValue(value);
+	}
+	
+	public String getWidthPxValue() {
+		return getMethodPanel().getPixelSelectionPanel().getWidthInput().getValue();
+	}
+	
+	public String getHeightPxValue() {
+		return getMethodPanel().getPixelSelectionPanel().getHeightInput().getValue();
+	}
+	
+	public int getWidthPxPrint() {
+		return getMethodPanel().getPrintSelectionPanel().getWidthPx();
+	}
+	
+	public int getHeightPxPrint() {
+		return getMethodPanel().getPrintSelectionPanel().getHeightPx();
+	}
+	
+	public void setWidthPxValue(String value) {
+		getMethodPanel().getPixelSelectionPanel().getWidthInput().setValue(value);
+	}
+	
+	public void setHeightPxValue(String value) {
+		getMethodPanel().getPixelSelectionPanel().getHeightInput().setValue(value);
+	}
+
+	public JButton getBProperties() {
+		return getOutputPanel().getBProperties();
+	}
+
+	public String getValueLRX() {
+		return getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer21().getValue();
+	}
+
+	public String getValueLRY() {
+		return getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer22().getValue();
+	}
+
+	public String getValueULX() {
+		return getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer11().getValue();
+	}
+
+	public String getValueULY() {
+		return getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer12().getValue();
+	}
+
+	public void setValueLRX(String value) {
+		getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer21().setValue(value);
+	}
+
+	public void setValueLRY(String value) {
+		getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer22().setValue(value);
+	}
+
+	public void setValueULX(String value) {
+		getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer11().setValue(value);
+	}
+
+	public void setValueULY(String value) {
+		getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer12().setValue(value);
+	}
+	
+	public JLabel getLFileName() {
+		return getOutputPanel().getLabelText();
+	}
+	
+	public JButton getBSelect() {
+		return getOutputPanel().getBSelect();
+	}
+	
+	public void setValueXCms(String value) {
+		getMethodPanel().getPrintSelectionPanel().getWidthInput().setValue(value);
+	}
+	
+	public void setValueYCms(String value) {
+		getMethodPanel().getPrintSelectionPanel().getHeightInput().setValue(value);
+	}
+	
+	public String getValueXCms() {
+		return getMethodPanel().getPrintSelectionPanel().getWidthInput().getValue();
+	}
+	
+	public String getValueYCms() {
+		return getMethodPanel().getPrintSelectionPanel().getHeightInput().getValue();
+	}
+
+	public JComboBox getCbResolution() {
+		return getMethodPanel().getPrintSelectionPanel().getComboDPI();
+	}
+
+	public String getScaleValue() {
+		return getMethodPanel().getPrintSelectionPanel().getScale().getValue();
+	}
+
+	public void setScaleValue(String value) {
+		getMethodPanel().getPrintSelectionPanel().getScale().setValue(value);
+	}
+	
+	public String getResolutionValue() {
+		return (String)getMethodPanel().getPrintSelectionPanel().getComboDPI().getSelectedItem();
+	}
+	
+	public void setSizePxPrintResult(int w, int h) {
+		getMethodPanel().getPrintSelectionPanel().setSizePxResult(w, h);
+	}
+	
+	public void validateFields() {
+		validateField(getMethodPanel().getPixelSelectionPanel().getWidthInput());
+		validateField(getMethodPanel().getPixelSelectionPanel().getHeightInput());
+		validateField(getMethodPanel().getPixelSelectionPanel().getCellsize());
+		validateField(getMethodPanel().getPrintSelectionPanel().getWidthInput());
+		validateField(getMethodPanel().getPrintSelectionPanel().getHeightInput());
+		validateField(getMethodPanel().getPrintSelectionPanel().getScale());
+		validateField(getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer11());
+		validateField(getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer21());
+		validateField(getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer12());
+		validateField(getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer22());
+	}
+	
+	private void validateField(InputFieldPanel field) {
+		String value = field.getValue();
+		if(value == null || value.equals(""))
+			field.setValue("0");
+		try {
+			Double.parseDouble(value);
+		} catch (NumberFormatException e) {
+			field.setValue("0");
+		}
+	}
+	
+	private void validateField(DataInputContainer field) {
+		String value = field.getValue();
+		if(value == null || value.equals(""))
+			field.setValue("0");
+		try {
+			Double.parseDouble(value);
+		} catch (NumberFormatException e) {
+			field.setValue("0");
+		}
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/SaveRasterMainPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/OutputSelectionPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/OutputSelectionPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/OutputSelectionPanel.java	(revision 8183)
@@ -0,0 +1,164 @@
+package org.gvsig.raster.tools.algorithm.swing.impl.saveraster;
+
+import java.awt.FlowLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import com.toedter.components.JTitlePanel;
+
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.i18n.Messages;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+
+/**
+ * Panel to select output parameters of the output layer
+ *  
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class OutputSelectionPanel extends JPanel {
+	private static final long serialVersionUID = 1L;
+	private JPanel pFileName = null;
+	private JPanel pButtons = null;
+	private JLabel lFileTag = new JLabel();
+	private JLabel lFileName = new JLabel();
+	private JButton bSelect = null;
+	private JButton bProperties = null;
+    private I18nManager i18n = ToolsLocator.getI18nManager();;
+
+	/**
+	 * This is the default constructor
+	 */
+	public OutputSelectionPanel() {
+		super();
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 * 
+	 * @return void
+	 */
+    private void initialize() {
+        this.setLayout(new GridBagLayout());
+        setBorder(javax.swing.BorderFactory.createTitledBorder(i18n
+                .getTranslation("file")));
+        
+        GridBagConstraints gbc = new GridBagConstraints();
+        gbc.fill = GridBagConstraints.HORIZONTAL;
+        gbc.insets = new Insets(2, 2, 2, 2);
+        gbc.weightx = 1;
+        gbc.weighty = 0;
+        gbc.gridwidth = 2;
+        add(getPanelLabel(), gbc);
+
+        gbc.gridx = 0;
+        gbc.gridy = 1;
+        gbc.gridwidth = 1;
+        add(getBSelect(), gbc);
+
+        gbc.gridx = 1;
+        gbc.gridy = 1;
+        add(getBProperties(), gbc);
+    }
+
+	/**
+	 * This method initializes jPanel	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+    private JPanel getPanelLabel() {
+        if (pFileName == null) {
+            FlowLayout flowLayout1 = new FlowLayout();
+            flowLayout1.setAlignment(java.awt.FlowLayout.LEFT);
+            flowLayout1.setHgap(5);
+            flowLayout1.setVgap(5);
+            lFileTag.setText(i18n.getTranslation("name") + ":");
+            lFileName.setText("-");
+            pFileName = new JPanel();
+            pFileName.setLayout(flowLayout1);
+            pFileName.setPreferredSize(new java.awt.Dimension(347, 20));
+            pFileName.add(lFileTag, null);
+            pFileName.add(lFileName, null);
+        }
+        return pFileName;
+    }
+
+	/**
+	 * This method initializes jPanel1	
+	 * 	
+	 * @return javax.swing.JPanel	
+	 */
+	public JPanel getPanelButtons() {
+		if (pButtons == null) {
+			FlowLayout flowLayout = new FlowLayout();
+			flowLayout.setAlignment(java.awt.FlowLayout.RIGHT);
+			flowLayout.setHgap(2);
+			flowLayout.setVgap(2);
+			pButtons = new JPanel();
+			pButtons.setLayout(flowLayout);
+			pButtons.setPreferredSize(new java.awt.Dimension(347,20));
+			pButtons.add(getBSelect(), null);
+			pButtons.add(getBProperties(), null);
+		}
+		return pButtons;
+	}
+
+	/**
+	 * This method initializes jButton	
+	 * 	
+	 * @return javax.swing.JButton	
+	 */
+	public JButton getBSelect() {
+		if (bSelect == null) {
+			bSelect = new JButton();
+			bSelect.setPreferredSize(new java.awt.Dimension(135,20));
+			bSelect.setText(i18n.getTranslation("select"));
+		}
+		return bSelect;
+	}
+
+	/**
+	 * This method initializes jButton1	
+	 * 	
+	 * @return javax.swing.JButton	
+	 */
+	public JButton getBProperties() {
+		if (bProperties == null) {
+			bProperties = new JButton();
+			bProperties.setPreferredSize(new java.awt.Dimension(135,20));
+			bProperties.setText(i18n.getTranslation(("props")));
+		}
+		return bProperties;
+	}
+
+	/**
+	 * Asigna el valor del texto de la etiqueta
+	 * @param text cadena con el texto
+	 */
+	public void setLabelText(String text){
+		lFileName.setText(text);
+	}
+	
+	/**
+	 * Obtiene el valor del texto de la etiqueta
+	 * @return text cadena con el texto
+	 */
+	public JLabel getLabelText(){
+		return lFileName;
+	}
+	
+	/**
+	 * Asigna el valor del texto de la etiqueta
+	 * @param text cadena con el texto
+	 */
+	public void setTag(String tag){
+		lFileTag.setText(tag);
+	}
+}
+

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/OutputSelectionPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/PixelSelectionPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/PixelSelectionPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/PixelSelectionPanel.java	(revision 8183)
@@ -0,0 +1,104 @@
+package org.gvsig.raster.tools.algorithm.swing.impl.saveraster;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.BorderFactory;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.tools.algorithm.swing.impl.util.InputFieldPanel;
+
+/**
+ * Panel to select width, height or pixel size of the output layer
+ *  
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class PixelSelectionPanel extends JPanel {
+	private static final long   serialVersionUID  = 1L;
+	private InputFieldPanel     cellsize          = null;
+	private InputFieldPanel     width             = null;
+	private InputFieldPanel     height            = null;
+	private JRadioButton        radioPxSelection  = null;
+	
+	public PixelSelectionPanel() {
+		init();
+	}
+	
+	private void init() {
+		setLayout(new GridBagLayout());
+		setBorder(BorderFactory.createTitledBorder(""));
+		
+		GridBagConstraints gbc = new GridBagConstraints();
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.insets = new Insets(2, 2, 4, 2);
+		gbc.weightx = 1;
+		gbc.weighty = 0;
+		gbc.gridwidth = 2;
+		
+		gbc.gridx = 0;
+		gbc.gridy = 0;
+		add(getRadioPxSelection(), gbc);
+		
+		gbc.gridwidth = 1;
+		
+		gbc.gridx = 0;
+		gbc.gridy = 1;
+		add(getWidthInput(), gbc);
+		
+		gbc.gridx = 1;
+		gbc.gridy = 1;
+		add(new JPanel(), gbc);
+		
+		gbc.gridx = 0;
+		gbc.gridy = 2;
+		add(getHeightInput(), gbc);
+		
+		gbc.gridx = 1;
+		gbc.gridy = 2;
+		add(getCellsize(), gbc);
+		
+		/*gbc.fill = GridBagConstraints.BOTH;
+		gbc.gridwidth = 2;
+		gbc.weightx = 1;
+		gbc.weighty = 1;
+		gbc.gridx = 0;
+		gbc.gridy = 3;
+		add(new JPanel(), gbc);*/
+	}
+
+	public InputFieldPanel getCellsize() {
+		if(cellsize == null)
+			cellsize = new InputFieldPanel(Messages.getText("cellsize"), InputFieldPanel.DOUBLE);
+		return cellsize;
+	}
+
+	public InputFieldPanel getWidthInput() {
+		if(width == null)
+			width = new InputFieldPanel(Messages.getText("width"), InputFieldPanel.INT);
+		return width;
+	}
+
+	public InputFieldPanel getHeightInput() {
+		if(height == null)
+			height = new InputFieldPanel(Messages.getText("height"), InputFieldPanel.INT);
+		return height;
+	}
+
+	public JRadioButton getRadioPxSelection() {
+		if(radioPxSelection == null) {
+			radioPxSelection = new JRadioButton(Messages.getText("pixel_selection"));
+			radioPxSelection.setSelected(true);
+		}
+		return radioPxSelection;
+	}
+	
+	public void setEnable(boolean enabled) {
+		getCellsize().setEnable(enabled);
+		getWidthInput().setEnable(enabled);
+		getHeightInput().setEnable(enabled);
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster/PixelSelectionPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/saveraster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/AlgorithmSwingImplLibrary.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/AlgorithmSwingImplLibrary.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/AlgorithmSwingImplLibrary.java	(revision 8183)
@@ -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.tools.algorithm.swing.impl;
+
+import java.util.Locale;
+
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.tools.algorithm.swing.AlgorithmSwingLibrary;
+import org.gvsig.raster.tools.algorithm.swing.AlgorithmSwingLocator;
+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 AlgorithmSwingImplLibrary extends AbstractLibrary {
+
+	public AlgorithmSwingImplLibrary() {
+		super();
+	}
+	
+	@Override
+	public void doRegistration() {
+	    this.registerAs(AlgorithmSwingLibrary.class, Library.TYPE.IMPL);
+	}
+	
+    @Override
+    protected void doInitialize() throws LibraryException {
+    	AlgorithmSwingLocator
+            .registerSwingManager(DefaultAlgorithmSwingManager.class);
+        
+        
+        if (!Messages.hasLocales()) {
+            Messages.addLocale(Locale.getDefault());
+        }
+        
+        Messages.addResourceFamily("org.gvsig.raster.tools.algorithm.swing.impl.i18n.text",
+            AlgorithmSwingImplLibrary.class.getClassLoader(),
+            AlgorithmSwingImplLibrary.class.getClass().getName()); 
+        
+        registerIcons();
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+    }
+    
+    private void registerIcons() {
+		//IconThemeHelper.registerIcon(null, "icon-jdbc", this);
+    }
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/AlgorithmSwingImplLibrary.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/bean/combotext/ComboTextImpl.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/bean/combotext/ComboTextImpl.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/bean/combotext/ComboTextImpl.java	(revision 8183)
@@ -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.tools.algorithm.swing.impl.bean.combotext;
+
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import org.gvsig.raster.swing.listener.PanelChangeEvent;
+import org.gvsig.raster.swing.listener.PanelChangeListener;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ComboTextImpl extends JPanel implements ActionListener {
+	private static final long   serialVersionUID    = 1L;
+	private JComboBox           combo               = null;
+	private JTextField          jtext               = null;
+	private JLabel              label               = null;
+	private String              boxLabel            = null;
+	private boolean             borderEnabled       = false;
+	private boolean             labelsEnabled       = false;
+	private PanelChangeListener listener            = null;
+	
+	public ComboTextImpl(String[] labels, boolean border, boolean labelEnabled) {
+		if(labels != null) {
+			label = new JLabel(labels[0]);
+			boxLabel = labels[1];
+		}
+		this.borderEnabled = border;
+		this.labelsEnabled = labelEnabled;
+		init();
+	}
+	
+	private void init() {
+		this.setLayout(new GridBagLayout());
+		if(borderEnabled)
+			setBorder(BorderFactory.createTitledBorder(boxLabel));
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		
+		int x = 0;
+		
+		if(labelsEnabled) {
+			gridBagConstraints1.fill = java.awt.GridBagConstraints.NONE;
+			gridBagConstraints1.gridx = x;
+			this.add(label, gridBagConstraints1);
+			x++;
+		}
+		
+		gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		gridBagConstraints1.weightx = 1;
+
+		gridBagConstraints1.gridx = x;
+		this.add(getCombo(), gridBagConstraints1);
+		x++;
+		
+		gridBagConstraints1.fill = java.awt.GridBagConstraints.NONE;
+		gridBagConstraints1.weightx = 0;
+		gridBagConstraints1.insets = new java.awt.Insets(0, 2, 0, 0);
+
+		gridBagConstraints1.gridx = x;
+		this.add(getTextField(), gridBagConstraints1);	
+	}
+	
+	public JComboBox getCombo() {
+		if(combo == null) {
+			combo = new JComboBox();
+			combo.addActionListener(this);
+		}
+		return combo;
+	}
+
+	public JTextField getTextField() {
+		if(jtext == null) {
+			jtext = new JTextField();
+			jtext.addActionListener(this);
+			jtext.setEditable(true);
+			jtext.setPreferredSize(new Dimension(60, 24));
+			jtext.setSize(new Dimension(60, 24));
+			jtext.setMinimumSize(new Dimension(60, 24));
+			jtext.setMaximumSize(new Dimension(60, 24));
+		}
+		return jtext;
+	}
+	
+	public void addPanelChangeEvent(PanelChangeListener listener) {
+		this.listener = listener;
+	}
+
+	public void setEnabled(boolean enable) {
+		getTextField().setEnabled(enable);
+		getCombo().setEnabled(enable);
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if(listener != null)
+			listener.panelHasChanged(new PanelChangeEvent(e));
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/bean/combotext/ComboTextImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/bean/combotext
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/bean/inputlayer/InputLayerImpl.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/bean/inputlayer/InputLayerImpl.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/bean/inputlayer/InputLayerImpl.java	(revision 8183)
@@ -0,0 +1,150 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.algorithm.swing.impl.bean.inputlayer;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.swing.listener.PanelChangeEvent;
+import org.gvsig.raster.swing.listener.PanelChangeListener;
+import org.gvsig.raster.tools.algorithm.swing.bean.LayerComboElement;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class InputLayerImpl extends JPanel implements ActionListener {
+	private static final long   serialVersionUID    = 1L;
+	private JComboBox           inputLayerCombo     = null;
+	private JComboBox           bandsSelectorCombo  = null;
+	private JLabel              layerLabel          = null;
+	private JLabel              bandsLabel          = null;
+	private String              boxLabel            = null;
+	private boolean             borderEnabled       = false;
+	private boolean             labelsEnabled       = false;
+	private PanelChangeListener listener            = null;
+	
+	public InputLayerImpl(String[] labels, boolean border, boolean labelEnabled) {
+		if(labels != null) {
+			layerLabel = new JLabel(labels[0]);
+			bandsLabel = new JLabel(labels[1]);
+			boxLabel = labels[2];
+		} else {
+			boxLabel = Messages.getText("input");
+		}
+		this.borderEnabled = border;
+		this.labelsEnabled = labelEnabled;
+		init();
+	}
+	
+	private void init() {
+		this.setLayout(new GridBagLayout());
+		if(borderEnabled)
+			setBorder(BorderFactory.createTitledBorder(boxLabel));
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		gridBagConstraints1.weightx = 1;
+		gridBagConstraints1.insets = new java.awt.Insets(0, 2, 0, 0);
+
+		if(labelsEnabled) {
+			gridBagConstraints1.gridx = 0;
+			gridBagConstraints1.gridy = 0;
+			this.add(getLayerLabel(), gridBagConstraints1);
+		}
+
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 1;
+		this.add(getInputLayerCombo(), gridBagConstraints1);
+
+		gridBagConstraints1.fill = java.awt.GridBagConstraints.NONE;
+		gridBagConstraints1.weightx = 0;
+
+		if(labelsEnabled) {
+			gridBagConstraints1.gridx = 1;
+			gridBagConstraints1.gridy = 0;
+			this.add(getBandsLabel(), gridBagConstraints1);	
+		}
+		
+		gridBagConstraints1.gridx = 1;
+		gridBagConstraints1.gridy = 1;
+		this.add(getBandsSelectorCombo(), gridBagConstraints1);	
+	}
+	
+	public JComboBox getInputLayerCombo() {
+		if(inputLayerCombo == null) {
+			inputLayerCombo = new JComboBox();
+			inputLayerCombo.addActionListener(this);
+		}
+		return inputLayerCombo;
+	}
+
+	public JComboBox getBandsSelectorCombo() {
+		if(bandsSelectorCombo == null) {
+			bandsSelectorCombo = new JComboBox();
+			bandsSelectorCombo.addActionListener(this);
+		}
+		return bandsSelectorCombo;
+	}
+
+	public JLabel getLayerLabel() {
+		if(layerLabel == null)
+			layerLabel = new JLabel(Messages.getText("layers"));
+		return layerLabel;
+	}
+
+	public JLabel getBandsLabel() {
+		if(bandsLabel == null)
+			bandsLabel = new JLabel(Messages.getText("bands"));
+		return bandsLabel;
+	}
+	
+	public void setEnabled(boolean enable) {
+		getBandsSelectorCombo().setEnabled(enable);
+		getInputLayerCombo().setEnabled(enable);
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if(listener != null)
+			listener.panelHasChanged(new PanelChangeEvent(e));
+		if(e.getSource() == getInputLayerCombo()) {
+			if(getInputLayerCombo().getSelectedItem() instanceof LayerComboElement) {
+				int nElements = ((LayerComboElement)getInputLayerCombo().getSelectedItem()).getNumOfElements();
+				getBandsSelectorCombo().removeAllItems();
+				getBandsSelectorCombo().addItem(Messages.getText("all"));
+				for (int i = 0; i < nElements; i++) {
+					getBandsSelectorCombo().addItem(i);
+				}
+			}
+		}
+	}
+	
+	public void addPanelChangeEvent(PanelChangeListener listener) {
+		this.listener = listener;
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/bean/inputlayer/InputLayerImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/bean/inputlayer
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/bean
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/layerdatatype/LayerDatatypePanelImpl.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/layerdatatype/LayerDatatypePanelImpl.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/layerdatatype/LayerDatatypePanelImpl.java	(revision 8183)
@@ -0,0 +1,230 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.algorithm.swing.impl.layerdatatype;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.io.File;
+import java.util.EventListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.algorithm.BasicAPISwingPanel;
+import org.gvsig.raster.algorithm.process.ProcessException;
+import org.gvsig.raster.algorithm.process.DataProcess;
+import org.gvsig.raster.swing.RasterSwingLocator;
+import org.gvsig.raster.swing.newlayer.CreateNewLayerPanel;
+import org.gvsig.raster.tools.algorithm.layerdatatype.LayerDatatypeProcess;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class LayerDatatypePanelImpl extends JPanel implements BasicAPISwingPanel {
+	private static final long               serialVersionUID     = 1L;
+	private JComboBox                       comboOutput          = null;
+	private JComboBox                       comboDec2Int         = null;
+	private JComboBox                       comboBig2Small       = null;
+	private String                          inputDatatype        = null;
+	private String                          layerName            = null;
+	private CreateNewLayerPanel             newLayerPanel        = null;
+	private Object                          inputStore           = null;
+	
+	public LayerDatatypePanelImpl(Object inputStore, String inputDatatype, String layerName) {
+		this.inputStore = inputStore;
+		this.layerName = layerName;
+		this.inputDatatype = inputDatatype;
+		init();
+	}
+	
+	private void init() {
+		setLayout(new GridBagLayout());
+		
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		gridBagConstraints1.weightx = 1;
+		gridBagConstraints1.insets = new java.awt.Insets(0, 0, 2, 0);
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 0;
+		add(getLayerPanel(), gridBagConstraints1);
+		
+		gridBagConstraints1.gridy = 1;
+		add(getInputsPanel(), gridBagConstraints1);
+		
+		gridBagConstraints1.insets = new java.awt.Insets(0, 2, 0, 2);
+		gridBagConstraints1.gridy = 2;
+		add((JComponent)getCreateNewLayerPanel(), gridBagConstraints1);
+		
+		gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
+		gridBagConstraints1.weighty = 1;
+		gridBagConstraints1.gridy = 3;
+		add(new JPanel(), gridBagConstraints1);
+	}
+	
+	private JPanel getLayerPanel() {
+		JPanel p = new JPanel();
+		p.setBorder(BorderFactory.createTitledBorder(Messages.getText("layer")));
+		p.setLayout(new GridBagLayout());
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		gridBagConstraints1.weightx = 1;
+		gridBagConstraints1.insets = new java.awt.Insets(0, 0, 2, 0);
+		
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 0;
+		p.add(new JLabel(layerName), gridBagConstraints1);
+		
+		return p;
+	}
+	
+	private JPanel getInputsPanel() {
+		JPanel p = new JPanel();
+		p.setBorder(BorderFactory.createTitledBorder(Messages.getText("datatype")));
+		p.setLayout(new GridBagLayout());
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		gridBagConstraints1.weightx = 1;
+		gridBagConstraints1.insets = new java.awt.Insets(0, 0, 2, 0);
+		
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 0;
+		p.add(new JLabel(Messages.getText("entrada")), gridBagConstraints1);
+		
+		gridBagConstraints1.gridx = 1;
+		gridBagConstraints1.gridy = 0;
+		p.add(new JLabel(inputDatatype), gridBagConstraints1);
+		
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 1;
+		p.add(new JLabel(Messages.getText("salida")), gridBagConstraints1);
+		
+		gridBagConstraints1.gridx = 1;
+		gridBagConstraints1.gridy = 1;
+		p.add(getComboOutput(), gridBagConstraints1);
+		
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 2;
+		p.add(new JLabel(Messages.getText("adjust_dec2int")), gridBagConstraints1);
+		
+		gridBagConstraints1.gridx = 1;
+		gridBagConstraints1.gridy = 2;
+		p.add(getComboDec2Int(), gridBagConstraints1);
+		
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 3;
+		p.add(new JLabel(Messages.getText("adjust_big2small")), gridBagConstraints1);
+		
+		gridBagConstraints1.gridx = 1;
+		gridBagConstraints1.gridy = 3;
+		p.add(getComboBig2Small(), gridBagConstraints1);
+		
+		return p;
+	}
+	
+	public JComponent getComponent() {
+		return this;
+	}
+
+	public DataProcess getResult() throws ProcessException {
+		DataProcess task = new LayerDatatypeProcess();
+		task.addParam(LayerDatatypeProcess.RASTER_STORE1, inputStore);
+		String filename = newLayerPanel.getDirectorySelected() + File.separator + newLayerPanel.getFileSelected();
+		if(!filename.endsWith(".tif"))
+			filename += ".tif";
+        task.addParam(LayerDatatypeProcess.PATH, filename);
+        task.addParam(LayerDatatypeProcess.DATATYPE, getDatatypeFromCombo());
+        task.addParam(LayerDatatypeProcess.ADJUST_DEC2INT, getComboDec2Int().getSelectedIndex());
+        task.addParam(LayerDatatypeProcess.ADJUST_BIG2SMALL, getComboBig2Small().getSelectedIndex());
+		return task;
+	}
+
+	public JComboBox getComboOutput() {
+		if(comboOutput == null) {
+			comboOutput = new JComboBox();
+			comboOutput.addItem("BYTE");
+			comboOutput.addItem("SHORT");
+			comboOutput.addItem("INT");
+			comboOutput.addItem("FLOAT");
+			comboOutput.addItem("DOUBLE");
+		}
+		return comboOutput;
+	}
+	
+	private int getDatatypeFromCombo() {
+		String item = (String)getComboOutput().getSelectedItem();
+		if(item.equals("BYTE"))
+			return Buffer.TYPE_BYTE;
+		if(item.equals("SHORT"))
+			return Buffer.TYPE_SHORT;
+		if(item.equals("INT"))
+			return Buffer.TYPE_INT;
+		if(item.equals("FLOAT"))
+			return Buffer.TYPE_FLOAT;
+		if(item.equals("DOUBLE"))
+			return Buffer.TYPE_DOUBLE;
+		return -1;
+	}
+
+	public JComboBox getComboDec2Int() {
+		if(comboDec2Int == null) {
+			comboDec2Int = new JComboBox();
+			for (int i = 0; i < LayerDatatypeProcess.DEC2INT_OPTIONS.length; i++) {
+				comboDec2Int.addItem(LayerDatatypeProcess.DEC2INT_OPTIONS[i]);
+			}
+		}
+		return comboDec2Int;
+	}
+
+	public JComboBox getComboBig2Small() {
+		if(comboBig2Small == null) {
+			comboBig2Small = new JComboBox();
+			for (int i = 0; i < LayerDatatypeProcess.BIG2SMALL_OPTIONS.length; i++) {
+				comboBig2Small.addItem(LayerDatatypeProcess.BIG2SMALL_OPTIONS[i]);
+			}
+		}
+		return comboBig2Small;
+	}
+	
+	public CreateNewLayerPanel getCreateNewLayerPanel() {
+		if(newLayerPanel == null) {
+			newLayerPanel = RasterSwingLocator.getSwingManager().createNewLayerPanel();
+			//newLayerPanel = new CreateNewLayerPanelImpl(new FileNameManagementImpl());
+		}
+		return newLayerPanel;
+	}
+
+	public void initialize() {
+		
+	}
+
+	public int getComponentIDByObject(Object obj) {
+		return -1;
+	}
+
+	public void addListener(EventListener listener) {
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/layerdatatype/LayerDatatypePanelImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/layerdatatype
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/maskthreshold/MaskThresholdDataImpl.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/maskthreshold/MaskThresholdDataImpl.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/maskthreshold/MaskThresholdDataImpl.java	(revision 8183)
@@ -0,0 +1,114 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.algorithm.swing.impl.maskthreshold;
+
+import org.gvsig.raster.tools.algorithm.swing.maskthreshold.MaskThresholdData;
+
+/**
+ * Data model for the mask threshold user interface
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class MaskThresholdDataImpl implements MaskThresholdData {
+	private MaskThresholdPanelImpl panel = null;
+	
+	public MaskThresholdDataImpl(MaskThresholdPanelImpl panel) {
+		this.panel = panel;
+	}
+	
+	public Object getInputLayer() {
+		Object obj = panel.getLayerSelection().getInputLayerCombo()
+			.getSelectedItem();
+		if(obj == null)
+			return panel.getLayerSelection().getInputLayerCombo().getItemAt(0);
+		else
+			return obj;
+	}
+	
+	public Object getOperationLayer() {
+		Object obj = panel.getOperationMaskThresholdPanel().getLayerSelection()
+			.getInputLayerCombo().getSelectedItem();
+		if(obj == null)
+			return panel.getOperationMaskThresholdPanel().getLayerSelection()
+				.getInputLayerCombo().getItemAt(0);
+		else
+			return obj;
+	}
+	
+	public Object getOutputInputLayer() {
+		Object obj = panel.getOutputMaskThresholdPanel().getLayerSelection()
+			.getInputLayerCombo().getSelectedItem();
+		if(obj == null)
+			return panel.getOutputMaskThresholdPanel().getLayerSelection()
+				.getInputLayerCombo().getItemAt(0);
+		else
+			return obj;
+	}
+	
+	public int getBandInputLayer() {
+		return panel.getLayerSelection().getBandsSelectorCombo()
+			.getSelectedIndex() - 1;
+	}
+	
+	public int getOperation() {
+		return panel.getOperationMaskThresholdPanel().getComboText()
+			.getCombo().getSelectedIndex();
+	}
+	
+	public int getOperationMethod() {
+		return panel.getOperationMaskThresholdPanel().getLayerRadio()
+			.isSelected() ? 1 : 0;
+	}
+	
+	public double getThresholdValue() {
+		try {
+		return new Double(panel.getOperationMaskThresholdPanel().getComboText()
+			.getTextField().getText());
+		} catch (NumberFormatException e) {
+			return 0;
+		}
+	}
+	
+	public int getBandOperationLayer() {
+		return panel.getOperationMaskThresholdPanel().getLayerSelection()
+			.getBandsSelectorCombo().getSelectedIndex() - 1;
+	}
+	
+	public int getBandOutputLayer() {
+		return panel.getOutputMaskThresholdPanel().getLayerSelection()
+			.getBandsSelectorCombo().getSelectedIndex() - 1;
+	}
+	
+    public int getMethodOutput() {
+    	return panel.getOutputMaskThresholdPanel().getMethodOutput()
+    		.getCombo().getSelectedIndex();
+    }
+	
+	public double getFixedValue() {
+		try {
+			return new Double(panel.getOutputMaskThresholdPanel().getMethodOutput()
+					.getTextField().getText());
+		} catch (NumberFormatException e) {
+			return 0;
+		}
+	}
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/maskthreshold/MaskThresholdDataImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/maskthreshold/MaskThresholdPanelImpl.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/maskthreshold/MaskThresholdPanelImpl.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/maskthreshold/MaskThresholdPanelImpl.java	(revision 8183)
@@ -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.tools.algorithm.swing.impl.maskthreshold;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+
+import org.gvsig.raster.swing.listener.PanelChangeListener;
+import org.gvsig.raster.tools.algorithm.swing.impl.bean.inputlayer.InputLayerImpl;
+import org.gvsig.raster.tools.algorithm.swing.maskthreshold.MaskThresholdData;
+import org.gvsig.raster.tools.algorithm.swing.maskthreshold.MaskThresholdPanel;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class MaskThresholdPanelImpl extends JPanel implements MaskThresholdPanel {
+	private static final long               serialVersionUID     = 1L;
+	private InputLayerImpl                  inputLayerPanel      = null;
+	private OperationMaskThresholdImpl      operationPanel       = null;
+	private OutputMaskThresholdImpl         outputPanel          = null;
+	private MaskThresholdDataImpl           data                 = null;
+	
+	public MaskThresholdPanelImpl() {
+		init();
+	}
+	
+	private void init() {
+		this.setLayout(new GridBagLayout());
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		gridBagConstraints1.weightx = 1;
+		gridBagConstraints1.insets = new java.awt.Insets(0, 0, 0, 0);
+		
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 0;
+		this.add(getLayerSelection(), gridBagConstraints1);
+		
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 1;
+		this.add(getOperationMaskThresholdPanel(), gridBagConstraints1);
+		
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 2;
+		this.add(getOutputMaskThresholdPanel(), gridBagConstraints1);
+		
+		gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
+		gridBagConstraints1.weightx = 1;
+		gridBagConstraints1.weighty = 1;
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 3;
+		this.add(new JPanel(), gridBagConstraints1);
+	}
+	
+	public JComponent getComponent() {
+		return this;
+	}
+
+	public OperationMaskThresholdImpl getOperationMaskThresholdPanel() {
+		if(operationPanel == null)
+			operationPanel = new OperationMaskThresholdImpl();
+		return operationPanel;
+	}
+
+	public OutputMaskThresholdImpl getOutputMaskThresholdPanel() {
+		if(outputPanel == null) 
+			outputPanel = new OutputMaskThresholdImpl();
+		return outputPanel;
+	}
+
+	public InputLayerImpl getLayerSelection() {
+		if(inputLayerPanel == null) {
+			inputLayerPanel = new InputLayerImpl(null, true, true);
+			inputLayerPanel.setEnabled(true);
+		}
+		return inputLayerPanel;
+	}
+
+	public MaskThresholdData getOutput() {
+		if(data == null)
+			data = new MaskThresholdDataImpl(this);
+		return data;
+	}
+
+	public JComboBox getComboBox(int component) {
+		if(component == LAYERS_INPUT_COMBO)
+			return getLayerSelection().getInputLayerCombo();
+		if(component == BANDS_INPUT_COMBO)
+			return getLayerSelection().getBandsSelectorCombo();
+		if(component == LAYERS_OPERAT_COMBO)
+			return getOperationMaskThresholdPanel().getLayerSelection().getInputLayerCombo();
+		if(component == BANDS_OPERAT_COMBO)
+			return getOperationMaskThresholdPanel().getLayerSelection().getBandsSelectorCombo();
+		if(component == LAYERS_OUTPUT_COMBO)
+			return getOutputMaskThresholdPanel().getLayerSelection().getInputLayerCombo();
+		if(component == BANDS_OUTPUT_COMBO)
+			return getOutputMaskThresholdPanel().getLayerSelection().getInputLayerCombo();
+		if(component == METHOD_OUTPUT_COMBO)
+			return getOutputMaskThresholdPanel().getMethodOutput().getCombo();
+		if(component == OPERATION_OUTPUT_COMBO)
+			return getOperationMaskThresholdPanel().getComboText().getCombo();
+		return null;
+	}
+
+	public void addPanelChangeEvent(PanelChangeListener listener) {
+		getLayerSelection().addPanelChangeEvent(listener);
+		getOperationMaskThresholdPanel().addPanelChangeEvent(listener);
+		getOutputMaskThresholdPanel().addPanelChangeEvent(listener);
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/maskthreshold/MaskThresholdPanelImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/maskthreshold/OperationMaskThresholdImpl.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/maskthreshold/OperationMaskThresholdImpl.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/maskthreshold/OperationMaskThresholdImpl.java	(revision 8183)
@@ -0,0 +1,149 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.algorithm.swing.impl.maskthreshold;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.swing.listener.PanelChangeEvent;
+import org.gvsig.raster.swing.listener.PanelChangeListener;
+import org.gvsig.raster.tools.algorithm.swing.impl.bean.combotext.ComboTextImpl;
+import org.gvsig.raster.tools.algorithm.swing.impl.bean.inputlayer.InputLayerImpl;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class OperationMaskThresholdImpl extends JPanel implements ActionListener {
+	private static final long   serialVersionUID    = 1L;
+	private JRadioButton        valueRadio          = null;
+	private JRadioButton        layerRadio          = null;
+	private InputLayerImpl      layerSelection      = null;
+	private ComboTextImpl       comboText           = null;
+	private PanelChangeListener listener            = null;
+	
+	public OperationMaskThresholdImpl() {
+		init();
+	}
+	
+	private void init() {
+		ButtonGroup  group = new ButtonGroup();
+		group.add(getValueRadio());
+		group.add(getLayerRadio());
+		
+		this.setLayout(new GridBagLayout());
+		setBorder(BorderFactory.createTitledBorder(Messages.getText("operation")));
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		gridBagConstraints1.weightx = 1;
+		gridBagConstraints1.insets = new java.awt.Insets(0, 0, 0, 0);
+		gridBagConstraints1.gridwidth = 2;
+		
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 0;
+		this.add(getValueRadio(), gridBagConstraints1);
+		
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 1;
+		this.add(getLayerRadio(), gridBagConstraints1);
+		
+		gridBagConstraints1.gridwidth = 1;
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 2;
+		this.add(getComboText(), gridBagConstraints1);
+		
+		gridBagConstraints1.gridwidth = 2;
+		gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		gridBagConstraints1.weightx = 1;
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 3;
+		this.add(getLayerSelection(), gridBagConstraints1);
+		
+		gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
+		gridBagConstraints1.weightx = 1;
+		gridBagConstraints1.weighty = 1;
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 4;
+		this.add(new JPanel(), gridBagConstraints1);
+	}
+
+	public JRadioButton getValueRadio() {
+		if(valueRadio == null) {
+			valueRadio = new JRadioButton(Messages.getText("value"));
+			valueRadio.setSelected(true);
+			valueRadio.addActionListener(this);
+		}
+		return valueRadio;
+	}
+
+	public JRadioButton getLayerRadio() {
+		if(layerRadio == null) {
+			layerRadio = new JRadioButton(Messages.getText("layer"));
+			layerRadio.addActionListener(this);
+		}
+		return layerRadio;
+	}
+
+	public InputLayerImpl getLayerSelection() {
+		if(layerSelection == null) {
+			layerSelection = new InputLayerImpl(null, false, true);
+			layerSelection.setEnabled(false);
+		}
+		return layerSelection;
+	}
+	
+	public ComboTextImpl getComboText() {
+		if(comboText == null) {
+			comboText = new ComboTextImpl(null, false, false);
+			comboText.getTextField().setEnabled(true);
+		}
+		return comboText;
+	}
+	
+	public void addPanelChangeEvent(PanelChangeListener listener) {
+		this.listener = listener;
+		getLayerSelection().addPanelChangeEvent(listener);
+		getComboText().addPanelChangeEvent(listener);
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if(listener != null)
+			listener.panelHasChanged(new PanelChangeEvent(e));
+		
+		if(e.getSource() == getValueRadio()) {
+			getLayerSelection().setEnabled(false);
+			getComboText().getTextField().setEnabled(true);
+		} 
+		if(e.getSource() == getLayerRadio()) {
+			getLayerSelection().setEnabled(true);
+			getComboText().getTextField().setEnabled(false);
+		} 
+	}
+	
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/maskthreshold/OperationMaskThresholdImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/maskthreshold/OutputMaskThresholdImpl.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/maskthreshold/OutputMaskThresholdImpl.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/maskthreshold/OutputMaskThresholdImpl.java	(revision 8183)
@@ -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.tools.algorithm.swing.impl.maskthreshold;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.JPanel;
+
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.swing.listener.PanelChangeListener;
+import org.gvsig.raster.tools.algorithm.swing.impl.bean.combotext.ComboTextImpl;
+import org.gvsig.raster.tools.algorithm.swing.impl.bean.inputlayer.InputLayerImpl;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class OutputMaskThresholdImpl extends JPanel implements ActionListener {
+	private static final long   serialVersionUID    = 1L;
+	private ComboTextImpl       satisfyCombo        = null;
+	private InputLayerImpl      layerSelection      = null;
+	
+	public OutputMaskThresholdImpl() {
+		init();
+	}
+	
+	private void init() {	
+		this.setLayout(new GridBagLayout());
+		setBorder(BorderFactory.createTitledBorder(Messages.getText("output")));
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		gridBagConstraints1.weightx = 1;
+		gridBagConstraints1.insets = new java.awt.Insets(0, 0, 4, 0);
+		
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 0;
+		this.add(getMethodOutput(), gridBagConstraints1);
+		
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 1;
+		this.add(getLayerSelection(), gridBagConstraints1);
+		
+		gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
+		gridBagConstraints1.weightx = 1;
+		gridBagConstraints1.weighty = 1;
+		gridBagConstraints1.gridx = 0;
+		gridBagConstraints1.gridy = 2;
+		this.add(new JPanel(), gridBagConstraints1);
+	}
+
+	public ComboTextImpl getMethodOutput() {
+		if(satisfyCombo == null){
+			satisfyCombo = new ComboTextImpl(
+					new String[]{Messages.getText("method_output"), ""}, false, true);
+			satisfyCombo.getTextField().setEnabled(false);
+			satisfyCombo.getCombo().addActionListener(this);
+		}
+		return satisfyCombo;
+	}
+
+	public InputLayerImpl getLayerSelection() {
+		if(layerSelection == null) {
+			layerSelection = new InputLayerImpl(null, false, true);
+			layerSelection.setEnabled(false);
+		}
+		return layerSelection;
+	}
+	
+	public void addPanelChangeEvent(PanelChangeListener listener) {
+		getLayerSelection().addPanelChangeEvent(listener);
+		getMethodOutput().addPanelChangeEvent(listener);
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if(e.getSource() == getMethodOutput().getCombo()) {
+			if(getMethodOutput().getCombo().getSelectedIndex() == 0 ||
+				getMethodOutput().getCombo().getSelectedIndex() == 1) {
+				getMethodOutput().getTextField().setEnabled(true);
+				getLayerSelection().setEnabled(false);
+			} else {
+				getMethodOutput().getTextField().setEnabled(false);
+				getLayerSelection().setEnabled(true);
+			}
+		}
+	}
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/maskthreshold/OutputMaskThresholdImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl/maskthreshold
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing/impl
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm/swing
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools/algorithm
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster/tools
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig/raster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org/gvsig
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java/org
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main/java
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src/main
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/src
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/pom.xml
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/pom.xml	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl/pom.xml	(revision 8183)
@@ -0,0 +1,39 @@
+<?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.tools.algorithm.swing.impl</artifactId>
+	<packaging>jar</packaging>
+	<name>org.gvsig.raster.tools.algorithm.swing.impl</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.tools.algorithm.swing</artifactId>
+		<version>2.2.62</version>
+	</parent>
+	<dependencies>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.tools.algorithm.layerdatatype</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.tools.algorithm.swing.api</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.swing.api</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.swing.impl</artifactId>
+            <scope>runtime</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.app.mainplugin</artifactId>
+            <scope>compile</scope>
+		</dependency>
+	</dependencies>
+</project>

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


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.impl
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath
target


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/AlgorithmSwingLocator.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/AlgorithmSwingLocator.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/AlgorithmSwingLocator.java	(revision 8183)
@@ -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.tools.algorithm.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 AlgorithmSwingLocator extends BaseLocator {
+
+    /**
+     * Validation swing manager name.
+     */
+    public static final String SWING_MANAGER_NAME =
+        "Raster.algorithm.swing.manager";
+
+    /**
+     * Validation swing manager description.
+     */
+    public static final String SWING_MANAGER_DESCRIPTION =
+        "Raster Algorithm UIManager";
+
+    private static final String LOCATOR_NAME = "Raster.algorithm.swing.locator";
+
+    /**
+     * Unique instance.
+     */
+    private static final AlgorithmSwingLocator INSTANCE =
+        new AlgorithmSwingLocator();
+
+    /**
+     * Return the singleton instance.
+     * 
+     * @return the singleton instance
+     */
+    public static AlgorithmSwingLocator 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 AlgorithmSwingManager> clazz) {
+        getInstance().register(SWING_MANAGER_NAME, SWING_MANAGER_DESCRIPTION,
+            clazz);
+    }
+
+    /**
+     * Gets the instance of the {@link ScriptingUIManager} registered.
+     * 
+     * @return {@link ScriptingUIManager}
+     */
+    public static AlgorithmSwingManager getSwingManager() {
+        return (AlgorithmSwingManager) getInstance()
+            .get(SWING_MANAGER_NAME);
+    }
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/AlgorithmSwingLocator.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/AlgorithmSwingLibrary.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/AlgorithmSwingLibrary.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/AlgorithmSwingLibrary.java	(revision 8183)
@@ -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.tools.algorithm.swing;
+
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.tools.locator.ReferenceNotRegisteredException;
+
+/**
+ * Library for Swing API initialization and configuration.
+ * 
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class AlgorithmSwingLibrary extends AbstractLibrary {
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+        // Do nothing
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        // Validate there is any implementation registered.
+        AlgorithmSwingManager manager =
+        	AlgorithmSwingLocator.getSwingManager();
+        if (manager == null) {
+            throw new ReferenceNotRegisteredException(
+            		AlgorithmSwingLocator.SWING_MANAGER_NAME,
+            		AlgorithmSwingLocator.getInstance());
+        }
+    }
+
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/AlgorithmSwingLibrary.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/bean/LayerComboElement.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/bean/LayerComboElement.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/bean/LayerComboElement.java	(revision 8183)
@@ -0,0 +1,30 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2011-2012 Prodevelop S.L
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.algorithm.swing.bean;
+
+/**
+ * Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface LayerComboElement {
+	public String toString();
+	
+	public int getNumOfElements();
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/bean/LayerComboElement.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/bean
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/maskthreshold/MaskThresholdData.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/maskthreshold/MaskThresholdData.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/maskthreshold/MaskThresholdData.java	(revision 8183)
@@ -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.tools.algorithm.swing.maskthreshold;
+
+/**
+ * Data model for the mask threshold user interface
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface MaskThresholdData {
+	
+	public Object getInputLayer();
+	
+	public int getBandInputLayer();
+	
+	public int getOperation();
+	
+	public int getOperationMethod();
+	
+	public double getThresholdValue();
+	
+	public Object getOperationLayer();
+	
+	public int getBandOperationLayer();
+	
+	public Object getOutputInputLayer();
+	
+	public int getBandOutputLayer();
+	
+    public int getMethodOutput();
+	
+	public double getFixedValue();
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/maskthreshold/MaskThresholdData.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/maskthreshold/MaskThresholdPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/maskthreshold/MaskThresholdPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/maskthreshold/MaskThresholdPanel.java	(revision 8183)
@@ -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.tools.algorithm.swing.maskthreshold;
+
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+
+import org.gvsig.raster.swing.listener.PanelChangeListener;
+
+/**
+ * API for the mask threshold user interface
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface MaskThresholdPanel {
+	public static final int           LAYERS_INPUT_COMBO       = 0;
+	public static final int           BANDS_INPUT_COMBO        = 1;
+	public static final int           LAYERS_OPERAT_COMBO      = 2;
+	public static final int           BANDS_OPERAT_COMBO       = 3;
+	public static final int           LAYERS_OUTPUT_COMBO      = 4;
+	public static final int           BANDS_OUTPUT_COMBO       = 5;
+	public static final int           METHOD_OUTPUT_COMBO      = 6;
+	public static final int           OPERATION_OUTPUT_COMBO   = 7;
+	
+	public MaskThresholdData getOutput();
+	
+	public JComboBox getComboBox(int component);
+	
+	public JComponent getComponent();
+	
+	/**
+	 * Events when any component receives changes
+	 * @param listener
+	 */
+	public void addPanelChangeEvent(PanelChangeListener listener);
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/maskthreshold/MaskThresholdPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/maskthreshold
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/AlgorithmSwingManager.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/AlgorithmSwingManager.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/AlgorithmSwingManager.java	(revision 8183)
@@ -0,0 +1,64 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.tools.algorithm.swing;
+
+import org.gvsig.raster.algorithm.BasicAPISwingPanel;
+import org.gvsig.raster.swing.RasterWindowManager;
+import org.gvsig.raster.tools.algorithm.swing.maskthreshold.MaskThresholdPanel;
+import org.gvsig.raster.tools.algorithm.swing.saveraster.SaveRasterPanel;
+
+
+/**
+ * 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 AlgorithmSwingManager {
+
+    /**
+     * 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);
+
+    /**
+     * Creates the panel for the MaskThreshold task
+     * @return
+     */
+    public MaskThresholdPanel createMaskThresholdPanel();
+    
+    public BasicAPISwingPanel createLayerDatatypePanel(Object inputStore, String inputDatatype, String layerName);
+
+    /**
+     * Creates the panel for the tool save raster
+     * @return
+     */
+    public SaveRasterPanel createSaveRasterPanel();
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/AlgorithmSwingManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/reproject
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/saveraster/SaveRasterPanel.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/saveraster/SaveRasterPanel.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/saveraster/SaveRasterPanel.java	(revision 8183)
@@ -0,0 +1,127 @@
+package org.gvsig.raster.tools.algorithm.swing.saveraster;
+
+import java.awt.event.ActionListener;
+import java.beans.PropertyChangeListener;
+
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+
+import org.gvsig.gui.beans.datainput.DataInputContainerListener;
+
+public interface SaveRasterPanel {
+	public static int   WIDTH_COMPONENT      = 0;
+	public static int   HEIGHT_COMPONENT     = 1;
+	public static int   CELLSIZE_COMPONENT   = 2;
+	public static int   WCMS_COMPONENT       = 3;
+	public static int   HCMS_COMPONENT       = 4;
+	public static int   SCALE_COMPONENT      = 5;
+	public static int   RESOLUTION_COMPONENT = 6;
+	public static int   FILESEL_COMPONENT    = 7;
+	public static int   PROPS_COMPONENT      = 8;
+	public static int   ULX_COMPONENT        = 9;
+	public static int   ULY_COMPONENT        = 10;
+	public static int   LRX_COMPONENT        = 11;
+	public static int   LRY_COMPONENT        = 12;
+	public static int   PIXEL_SELECTOR       = 13;
+	public static int   PRINT_SELECTOR       = 14;
+	
+	public JComponent getComponent();
+	
+	public void setValueLRX(String value);
+	
+	public void setValueLRY(String value);
+	
+	public void setValueULX(String value);
+	
+	public void setValueULY(String value);
+	
+	public String getValueLRX();
+	
+	public String getValueLRY();
+	
+	public String getValueULX();
+	
+	public String getValueULY();
+	
+	public String getScaleValue();
+	
+	public void setScaleValue(String value);
+	
+	public JButton getBProperties();
+	
+	public JComboBox getCbResolution();
+	
+	public JLabel getLFileName();
+	
+	public JButton getBSelect();
+	
+	public void setValueXCms(String value);
+	
+	public void setValueYCms(String value);
+	
+	public String getValueXCms();
+	
+	public String getValueYCms();
+	
+	public String getResolutionValue();
+	
+	public String getCellSize();
+	
+	public void setCellSize(String value);
+	
+	public String getWidthPxValue();
+	
+	public String getHeightPxValue();
+	
+	public int getWidthPxPrint();
+	
+	public int getHeightPxPrint();
+	
+	public void setWidthPxValue(String value);
+	
+	public void setHeightPxValue(String value);
+	
+	public void setSizePxPrintResult(int w, int h);
+	
+	public void setSizeMB(double mb);
+	
+	/**
+	 * Returns the ID of a component
+	 * @param obj
+	 * @return
+	 */
+	public int getComponentID(Object obj);
+	
+	/**
+	 * Returns true if the pixel method is selected and false
+	 * if is the print method
+	 * @return
+	 */
+	public boolean isPixelMethodSelected();
+
+	/**
+	 * Checks the input fields and if the value is not 
+	 * valid sets these to zero 
+	 */
+	public void validateFields();
+	
+	/**
+	 * Listeners for the coordinates boxes
+	 * @param listener
+	 */
+	public void addValueChangedListener(DataInputContainerListener listener);
+	
+	/**
+	 * Listener for input text boxes
+	 * @param listener
+	 */
+	public void addPropertiesChangeListener(PropertyChangeListener listener);
+	
+	/**
+	 * Adds listeners for the buttons
+	 * @param listener
+	 */
+	public void addActionListener(ActionListener listener);
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/saveraster/SaveRasterPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing/saveraster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm/swing
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools/algorithm
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster/tools
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig/raster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org/gvsig
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java/org
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/java
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 8183)
@@ -0,0 +1 @@
+org.gvsig.raster.tools.algorithm.swing.AlgorithmSwingLibrary
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/resources/META-INF/services
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/resources/META-INF
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main/resources
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/main
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/test/java/org/gvsig/raster/tools/algorithm/swing
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/test/java/org/gvsig/raster/tools/algorithm
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/test/java/org/gvsig/raster/tools
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/test/java/org/gvsig/raster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/test/java/org/gvsig
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/test/java/org
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/test/java
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src/test
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/src
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/pom.xml
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/pom.xml	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api/pom.xml	(revision 8183)
@@ -0,0 +1,39 @@
+<?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.tools.algorithm.swing.api</artifactId>
+	<packaging>jar</packaging>
+	<name>org.gvsig.raster.tools.algorithm.swing.api</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.tools.algorithm.swing</artifactId>
+		<version>2.2.62</version>
+	</parent>
+	<dependencies>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.algorithm</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.raster.swing.api</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.swing.impl</artifactId>
+            <scope>runtime</scope>
+		</dependency>
+	</dependencies>
+</project>

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


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/org.gvsig.raster.tools.algorithm.swing.api
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath
target


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/pom.xml
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/pom.xml	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing/pom.xml	(revision 8183)
@@ -0,0 +1,38 @@
+<?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.tools.algorithm.swing</artifactId>
+	<packaging>pom</packaging>
+	<name>org.gvsig.raster.tools.algorithm.swing</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.tools.algorithm</artifactId>
+		<version>2.2.62</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>
+	 <modules>
+        <module>org.gvsig.raster.tools.algorithm.swing.api</module>
+        <module>org.gvsig.raster.tools.algorithm.swing.impl</module>
+    </modules>
+</project>

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


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.swing
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/test/org/gvsig/raster/tools/algorithm/layerdatatype
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/test/org/gvsig/raster/tools/algorithm
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/test/org/gvsig/raster/tools
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/test/org/gvsig/raster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/test/org/gvsig
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/test/org
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/test
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/java/org/gvsig/raster/tools/algorithm/layerdatatype/LayerDatatypeAlgorithmLibrary.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/java/org/gvsig/raster/tools/algorithm/layerdatatype/LayerDatatypeAlgorithmLibrary.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/java/org/gvsig/raster/tools/algorithm/layerdatatype/LayerDatatypeAlgorithmLibrary.java	(revision 8183)
@@ -0,0 +1,56 @@
+/*
+ * 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.tools.algorithm.layerdatatype;
+
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.algorithm.RasterBaseAlgorithmLibrary;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+
+/**
+ * Initialization of MaskthresholdAlgorithmLibrary library.
+ * 
+ * @author <a href="mailto:nachobrodin@gmail.com">Nacho Brodin</a>
+ */
+public class LayerDatatypeAlgorithmLibrary extends AbstractLibrary {
+	public static final String         PROCESS_LABEL   = "LayerDatatypeProcess";
+	
+    @Override
+    protected void doInitialize() throws LibraryException {
+        // Nothing to do
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+    	//Registers the process and its parameters
+    	RasterBaseAlgorithmLibrary.register(PROCESS_LABEL, LayerDatatypeProcess.class);
+    	LayerDatatypeProcess.registerParameters();
+    	
+        Messages.addResourceFamily(
+            "org.gvsig.raster.tools.algorithm.maskthreshold", 
+            LayerDatatypeAlgorithmLibrary.class.getClassLoader(), 
+            LayerDatatypeAlgorithmLibrary.class.getClass().getName());
+        //registerGeoProcess(new RasterReprojectAlgorithmLibrary());
+    }
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/java/org/gvsig/raster/tools/algorithm/layerdatatype/LayerDatatypeAlgorithmLibrary.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/java/org/gvsig/raster/tools/algorithm/layerdatatype/LayerDatatypeException.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/java/org/gvsig/raster/tools/algorithm/layerdatatype/LayerDatatypeException.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/java/org/gvsig/raster/tools/algorithm/layerdatatype/LayerDatatypeException.java	(revision 8183)
@@ -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.raster.tools.algorithm.layerdatatype;
+
+import org.gvsig.raster.algorithm.process.ProcessException;
+
+
+/**
+ * This exception is thrown if happen problems processing data with this algorithm.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class LayerDatatypeException extends ProcessException {
+	private static final long serialVersionUID = -3022090543908771484L;
+	
+	public LayerDatatypeException(String msg){
+		super(msg);
+	}
+	
+	public LayerDatatypeException(String msg, Throwable e){
+		super(msg, e);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/java/org/gvsig/raster/tools/algorithm/layerdatatype/LayerDatatypeException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/java/org/gvsig/raster/tools/algorithm/layerdatatype/LayerDatatypeProcess.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/java/org/gvsig/raster/tools/algorithm/layerdatatype/LayerDatatypeProcess.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/java/org/gvsig/raster/tools/algorithm/layerdatatype/LayerDatatypeProcess.java	(revision 8183)
@@ -0,0 +1,304 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.algorithm.layerdatatype;
+
+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.NoData;
+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.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.algorithm.process.DataProcess;
+import org.gvsig.tools.locator.LocatorException;
+
+/**
+ * Process to change a <code>RasterDataStore</code> of data type
+ *
+ * 10/12/2007
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class LayerDatatypeProcess extends DataProcess {
+	public static String      RASTER_STORE1     = "RasterStore1";
+	public static String      PATH              = "Path";
+	public static String      FILENAME          = "FileName";
+	public static String      DATATYPE          = "Datatype";
+	public static String      ADJUST_DEC2INT    = "AdjustDec2Int";
+	public static String      ADJUST_BIG2SMALL  = "AdjustBig2Small";
+	
+	public static String[]    DEC2INT_OPTIONS   = new String[]{"Trunk", "Round", "Ceil", "Floor"};
+	public static String[]    BIG2SMALL_OPTIONS = new String[]{"Trunk", "Maxvalue", "NoData"};
+	
+	private RasterDataStore   store             = null;
+	private String            filename          = null;
+	private int               datatype          = 0;
+	private int               dec2int           = 0;
+	private int               big2smal          = 0;
+	private NoData            byteNoData        = null;
+	private NoData            shortNoData       = null;
+	private NoData            intNoData         = null;
+	private NoData            floatNoData       = null;
+	
+	public static void registerParameters() {
+		registerInputParameter(RASTER_STORE1, RasterDataStore.class, LayerDatatypeAlgorithmLibrary.PROCESS_LABEL);
+		registerInputParameter(PATH, String.class, LayerDatatypeAlgorithmLibrary.PROCESS_LABEL);
+		registerInputParameter(DATATYPE, Integer.class, LayerDatatypeAlgorithmLibrary.PROCESS_LABEL);
+		registerInputParameter(ADJUST_DEC2INT, Integer.class, LayerDatatypeAlgorithmLibrary.PROCESS_LABEL);
+		registerInputParameter(ADJUST_BIG2SMALL, Integer.class, LayerDatatypeAlgorithmLibrary.PROCESS_LABEL);
+		
+		registerOutputParameter(FILENAME, String.class, LayerDatatypeAlgorithmLibrary.PROCESS_LABEL);
+	}
+	
+	public void init() {
+		store = getParam(RASTER_STORE1) != null ? (RasterDataStore)getParam(RASTER_STORE1) : null;
+		filename = getStringParam(PATH);
+		datatype = (Integer)getParam(DATATYPE);
+		dec2int = (Integer)getParam(ADJUST_DEC2INT);
+		big2smal = (Integer)getParam(ADJUST_BIG2SMALL);
+		byteNoData = RasterLocator.getManager().getDataStructFactory().createDefaultNoData(
+				store.getBandCount(), Buffer.TYPE_BYTE);
+		shortNoData = RasterLocator.getManager().getDataStructFactory().createDefaultNoData(
+				store.getBandCount(), Buffer.TYPE_SHORT);
+		intNoData = RasterLocator.getManager().getDataStructFactory().createDefaultNoData(
+				store.getBandCount(), Buffer.TYPE_INT);
+		floatNoData = RasterLocator.getManager().getDataStructFactory().createDefaultNoData(
+				store.getBandCount(), Buffer.TYPE_FLOAT);
+	}
+
+	public void process() throws ProcessInterruptedException {
+		insertLineLog(Messages.getText("layer_datatype"));
+		try {
+			store = store.newNotTiledDataStore();
+			if (store == null)
+				throw new LayerDatatypeException("intput_not_valid");
+			
+			int inDataType = store.getDataType()[0];
+			BufferParam param = RasterLocator.getManager().getBufferFactory().createBufferParams(
+					(int)store.getWidth(), 
+					(int)store.getHeight(), 
+					store.getBandCount(), 
+					datatype, 
+					true);
+			Buffer buf = RasterLocator.getManager().getBufferFactory().createBuffer(param);
+			
+			RasterQuery query = RasterLocator.getManager().createQuery();
+			query.setAllDrawableBands();
+			query.setAreaOfInterest();
+			Buffer sourceBuffer = null;
+			try {
+				sourceBuffer = store.query(query);
+			} catch (QueryException e) {
+				throw new LayerDatatypeException("");
+			}
+			double v = 0;
+			
+			
+			switch (inDataType) {
+			case Buffer.TYPE_BYTE:
+				for (int row = 0; row < buf.getHeight(); row++) {
+					for (int col = 0; col < buf.getWidth(); col++) {
+						for (int iBand = 0; iBand < buf.getBandCount(); iBand++) {
+							writePixelFromByte(row, col, iBand, sourceBuffer.getElemByte(row, col, iBand), buf);
+						}
+					}
+					updatePercent(row, buf.getHeight());
+				}
+				break;
+			case Buffer.TYPE_SHORT:
+				for (int row = 0; row < buf.getHeight(); row++) {
+					for (int col = 0; col < buf.getWidth(); col++) {
+						for (int iBand = 0; iBand < buf.getBandCount(); iBand++) {
+							writePixelFromShort(row, col, iBand, sourceBuffer.getElemShort(row, col, iBand), buf);
+						}
+					}
+					updatePercent(row, buf.getHeight());
+				}
+				break;
+			case Buffer.TYPE_INT:
+				for (int row = 0; row < buf.getHeight(); row++) {
+					for (int col = 0; col < buf.getWidth(); col++) {
+						for (int iBand = 0; iBand < buf.getBandCount(); iBand++) {
+							writePixelFromInt(row, col, iBand, sourceBuffer.getElemInt(row, col, iBand), buf);
+						}
+					}
+					updatePercent(row, buf.getHeight());
+				}
+				break;
+			case Buffer.TYPE_FLOAT:
+				for (int row = 0; row < buf.getHeight(); row++) {
+					for (int col = 0; col < buf.getWidth(); col++) {
+						for (int iBand = 0; iBand < buf.getBandCount(); iBand++) {
+							v = getDecimalValue(sourceBuffer.getElemFloat(row, col, iBand), inDataType);
+							writePixelFromDouble(row, col, iBand, v, buf);
+						}
+					}
+					updatePercent(row, buf.getHeight());
+				}
+				break;
+			case Buffer.TYPE_DOUBLE:
+				for (int row = 0; row < buf.getHeight(); row++) {
+					for (int col = 0; col < buf.getWidth(); col++) {
+						for (int iBand = 0; iBand < buf.getBandCount(); iBand++) {
+							v = getDecimalValue(sourceBuffer.getElemDouble(row, col, iBand), inDataType);
+							writePixelFromDouble(row, col, iBand, v, buf);
+						}
+					}
+					updatePercent(row, buf.getHeight());
+				}
+				break;
+			}
+			
+            super.exportRaster(filename, buf, sourceBuffer.getStore().getCellSize(), sourceBuffer
+                .getStore().getExtent().getULX(), sourceBuffer.getStore().getExtent().getULY(),
+                store.getProjection());
+			
+			addOutputValue(FILENAME, filename);
+		} catch (LayerDatatypeException e) {
+			if (incrementableTask != null)
+				incrementableTask.processFinalize();
+			messageBoxError("error_changing_the_datatype", this, e);
+		} catch (LocatorException e) {
+			if (incrementableTask != null)
+				incrementableTask.processFinalize();
+			messageBoxError("error_creating_buffer", this, e);
+		} catch (BufferCreationException e) {
+			if (incrementableTask != null)
+				incrementableTask.processFinalize();
+			messageBoxError("error_creating_buffer", this, e);
+		} 
+	}
+	
+	public double getDecimalValue(double value, int inDataType) {
+		if(inDataType == Buffer.TYPE_FLOAT || inDataType == Buffer.TYPE_DOUBLE) {
+			switch (dec2int) {
+			case 0:return (double)((long)value);
+			case 1:return Math.round(value);
+			case 2:return Math.ceil(value);
+			case 3:return Math.floor(value);
+			}
+		} 
+		return value;
+	}
+	
+	private void writePixelFromByte(int row, int col, int band, byte value, Buffer dst) {
+		switch (dst.getDataType()) {
+		case Buffer.TYPE_BYTE: dst.setElem(row, col, band, value);break;
+		case Buffer.TYPE_SHORT: dst.setElem(row, col, band, (short)value);break;
+		case Buffer.TYPE_INT: dst.setElem(row, col, band, (int)value);break;
+		case Buffer.TYPE_FLOAT: dst.setElem(row, col, band, (float)value);break;
+		case Buffer.TYPE_DOUBLE: dst.setElem(row, col, band, (double)value);break;
+		}
+	}
+	
+	private void writePixelFromShort(int row, int col, int band, short value, Buffer dst) {
+		switch (dst.getDataType()) {
+		case Buffer.TYPE_BYTE: 
+			dst.setElem(row, col, band, (byte)value);
+			if(value > Byte.MAX_VALUE) {
+				switch (big2smal) {
+				case 1:dst.setElem(row, col, band, Byte.MAX_VALUE);break;
+				case 2:dst.setElem(row, col, band, (Byte)byteNoData.getValue());break;
+				}
+			} 
+			break;
+		case Buffer.TYPE_SHORT: dst.setElem(row, col, band, value);break;
+		case Buffer.TYPE_INT: dst.setElem(row, col, band, (int)value);break;
+		case Buffer.TYPE_FLOAT: dst.setElem(row, col, band, (float)value);break;
+		case Buffer.TYPE_DOUBLE: dst.setElem(row, col, band, (double)value);break;
+		}
+	}
+	
+	private void writePixelFromInt(int row, int col, int band, int value, Buffer dst) {
+		switch (dst.getDataType()) {
+		case Buffer.TYPE_BYTE: 
+			dst.setElem(row, col, band, (byte)value);
+			if(value > Byte.MAX_VALUE) {
+				switch (big2smal) {
+				case 1:dst.setElem(row, col, band, Byte.MAX_VALUE);break;
+				case 2:dst.setElem(row, col, band, (Byte)byteNoData.getValue());break;
+				}
+			}
+			break;
+		case Buffer.TYPE_SHORT:
+			dst.setElem(row, col, band, (short)value);
+			if(value > Short.MAX_VALUE) {
+				switch (big2smal) {
+				case 1:dst.setElem(row, col, band, Short.MAX_VALUE);break;
+				case 2:dst.setElem(row, col, band, (Short)shortNoData.getValue());break;
+				}
+			}
+			break;
+		case Buffer.TYPE_INT: dst.setElem(row, col, band, (int)value);break;
+		case Buffer.TYPE_FLOAT: dst.setElem(row, col, band, (float)value);break;
+		case Buffer.TYPE_DOUBLE: dst.setElem(row, col, band, (double)value);break;
+		}
+	}
+	
+	private void writePixelFromDouble(int row, int col, int band, double value, Buffer dst) {
+		switch (dst.getDataType()) {
+		case Buffer.TYPE_BYTE: 
+			dst.setElem(row, col, band, (byte)value);
+			if(value > Byte.MAX_VALUE) {
+				switch (big2smal) {
+				case 1:dst.setElem(row, col, band, Byte.MAX_VALUE);break;
+				case 2:dst.setElem(row, col, band, (Byte)byteNoData.getValue());break;
+				}
+			}
+			break;
+		case Buffer.TYPE_SHORT:
+			dst.setElem(row, col, band, (short)value);
+			if(value > Short.MAX_VALUE) {
+				switch (big2smal) {
+				case 1:dst.setElem(row, col, band, Short.MAX_VALUE);break;
+				case 2:dst.setElem(row, col, band, (Short)shortNoData.getValue());break;
+				}
+			}
+			break;
+		case Buffer.TYPE_INT:
+			dst.setElem(row, col, band, (int)value);
+			if(value > Integer.MAX_VALUE) {
+				switch (big2smal) {
+				case 1:dst.setElem(row, col, band, Integer.MAX_VALUE);break;
+				case 2:dst.setElem(row, col, band, (Integer)intNoData.getValue());break;
+				}
+			}
+			break;
+		case Buffer.TYPE_FLOAT:
+			dst.setElem(row, col, band, (float)value);
+			if(value > Float.MAX_VALUE) {
+				switch (big2smal) {
+				case 1:dst.setElem(row, col, band, Float.MAX_VALUE);break;
+				case 2:dst.setElem(row, col, band, (Float)floatNoData.getValue());break;
+				}
+			}
+			break;
+		case Buffer.TYPE_DOUBLE: dst.setElem(row, col, band, (double)value);break;
+		}
+	}
+	
+	public String getTitle() {
+		return Messages.getText("layer_datatype");
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/java/org/gvsig/raster/tools/algorithm/layerdatatype/LayerDatatypeProcess.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/java/org/gvsig/raster/tools/algorithm/layerdatatype
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/java/org/gvsig/raster/tools/algorithm
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/java/org/gvsig/raster/tools
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/java/org/gvsig/raster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/java/org/gvsig
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/java/org
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/java
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 8183)
@@ -0,0 +1 @@
+org.gvsig.raster.tools.algorithm.layerdatatype.LayerDatatypeAlgorithmLibrary

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/resources/META-INF/services
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/resources/META-INF
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/resources/image/datatype-icon.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/resources/image/datatype-icon.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/resources/image
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/resources
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/pom.xml
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/pom.xml	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/pom.xml	(revision 8183)
@@ -0,0 +1,19 @@
+<?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.tools.algorithm.layerdatatype</artifactId>
+	<packaging>jar</packaging>
+	<name>org.gvsig.raster.tools.algorithm.layerdatatype</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.tools.algorithm</artifactId>
+		<version>2.2.62</version>
+	</parent>
+    <dependencies>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.algorithm</artifactId>
+            <scope>compile</scope>
+		</dependency>
+	</dependencies>
+</project>

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


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath
target



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/test/org/gvsig/raster/tools/algorithm/maskthreshold
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/test/org/gvsig/raster/tools/algorithm
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/test/org/gvsig/raster/tools
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/test/org/gvsig/raster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/test/org/gvsig
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/test/org
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/test/java/org/gvsig/raster/tools/algorithm/maskthreshold
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/test/java/org/gvsig/raster/tools/algorithm
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/test/java/org/gvsig/raster/tools
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/test/java/org/gvsig/raster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/test/java/org/gvsig
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/test/java/org
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/test/java
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/test
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/java/org/gvsig/raster/tools/algorithm/maskthreshold/MaskthresholdAlgorithmLibrary.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/java/org/gvsig/raster/tools/algorithm/maskthreshold/MaskthresholdAlgorithmLibrary.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/java/org/gvsig/raster/tools/algorithm/maskthreshold/MaskthresholdAlgorithmLibrary.java	(revision 8183)
@@ -0,0 +1,56 @@
+/*
+ * 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.tools.algorithm.maskthreshold;
+
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.algorithm.RasterBaseAlgorithmLibrary;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+
+/**
+ * Initialization of MaskthresholdAlgorithmLibrary library.
+ * 
+ * @author <a href="mailto:nachobrodin@gmail.com">Nacho Brodin</a>
+ */
+public class MaskthresholdAlgorithmLibrary extends AbstractLibrary {
+	public static final String         PROCESS_LABEL   = "MaskthresholdProcess";
+	
+    @Override
+    protected void doInitialize() throws LibraryException {
+        // Nothing to do
+    }
+
+    @Override
+    public void doPostInitialize() throws LibraryException {
+    	//Registers the process and its parameters
+    	RasterBaseAlgorithmLibrary.register(PROCESS_LABEL, MaskthresholdProcess.class);
+    	MaskthresholdProcess.registerParameters();
+    	
+        Messages.addResourceFamily(
+            "org.gvsig.raster.tools.algorithm.maskthreshold", 
+            MaskthresholdAlgorithmLibrary.class.getClassLoader(), 
+            MaskthresholdAlgorithmLibrary.class.getClass().getName());
+        //registerGeoProcess(new RasterReprojectAlgorithmLibrary());
+    }
+}

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/java/org/gvsig/raster/tools/algorithm/maskthreshold/MaskthresholdAlgorithmLibrary.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/java/org/gvsig/raster/tools/algorithm/maskthreshold/MaskthresholdException.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/java/org/gvsig/raster/tools/algorithm/maskthreshold/MaskthresholdException.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/java/org/gvsig/raster/tools/algorithm/maskthreshold/MaskthresholdException.java	(revision 8183)
@@ -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.tools.algorithm.maskthreshold;
+
+
+/**
+ * This exception is thrown if happen problems processing data with this algorithm.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class MaskthresholdException extends Exception {
+	private static final long serialVersionUID = -3022090543908771484L;
+	
+	public MaskthresholdException(String msg){
+		super(msg);
+	}
+	
+	public MaskthresholdException(String msg, Throwable e){
+		super(msg, e);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/java/org/gvsig/raster/tools/algorithm/maskthreshold/MaskthresholdException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/java/org/gvsig/raster/tools/algorithm/maskthreshold/MaskthresholdProcess.java
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/java/org/gvsig/raster/tools/algorithm/maskthreshold/MaskthresholdProcess.java	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/java/org/gvsig/raster/tools/algorithm/maskthreshold/MaskthresholdProcess.java	(revision 8183)
@@ -0,0 +1,698 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.tools.algorithm.maskthreshold;
+
+import java.awt.geom.Rectangle2D;
+
+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.NoData;
+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.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.algorithm.process.DataProcess;
+import org.gvsig.raster.algorithm.process.ProcessException;
+import org.gvsig.raster.algorithm.util.Operation;
+import org.gvsig.tools.locator.LocatorException;
+
+/**
+ * Process to create a mask using a threshold. This threshold could be a value
+ * of a pixel or a fixed value.
+ * 
+ * Possible use cases:
+ * <UL>
+ * <LI><b>Fixed-oplayer:</b>  A input layer, an operator layer and a fixed value if the condition is satisfied.
+ * If the condition is not satisfied the value is set to NoData</LI>
+ * 
+ * <LI><b>Fixed-threshold:</b>  A input layer, a threshold and a fixed value if the condition is satisfied.
+ * If the condition is not satisfied the value is set to NoData</LI>
+ *
+ * <LI><b>Replicate-oplayer:</b>  A input layer, an operator layer and a output layer. If the condition is satisfied.
+ * the result layer replicates the output bands. If the condition is not satisfied the values is set to NoData</LI>
+ * 
+ * <LI><b>Replicate-threshold:</b>  A input layer, a threshold layer and a output layer. If the condition is satisfied.
+ * the result layer replicates the output bands. If the condition is not satisfied the values is set to NoData</LI>
+ * 
+ * <LI><b>Transparent-oplayer:</b> A input layer, an operator layer and a RGB output layer. If the condition is satisfied
+ * the layer result replicates the output RGB with transparency values. If the condition is not satisfied 
+ * the layer result only replicates the output RGB.</LI>
+ * 
+ * <LI><b>Transparent-threshold:</b> A input layer, a threshold and a RGB output layer. If the condition is satisfied
+ * the layer result replicates the output RGB with transparency values. If the condition is not satisfied 
+ * the layer result only replicates the output RGB.</LI>
+ * 
+ * <LI><b>Opacity-oplayer:</b> A input layer, an operator layer, a RGB output layer. If the condition is satisfied
+ * the layer result replicates the output layer values and if not this pixels are set to transparent </LI>
+ * 
+ * <LI><b>Opacity-threshold:</b> A input layer, an operator layer, a threshold. If the condition is satisfied
+ * the layer result replicates the output layer values and if not this pixels are set to transparent </LI>
+ * </UL>
+ * 
+ * <table>
+ * <tr>
+ * <th>band1</th><th>band2</th><th>threshold</th><th>output</th>
+ * </tr>
+ * <tr>
+ * <td>-1</td><td>-1</td><td>-</td><td>el n�mero de bandas de la capa de operaci�n debe 
+ *                                   ser mayor o igual a la de entrada. Compara la banda 
+ *                                   i de la capa de entrada con la banda i de la de operaci�n</td>
+ * </tr>
+ * <tr>
+ * <td>-1</td><td>0</td><td>-</td><td>Compara todas las bandas de la capa de entrada con la 
+ *                                   banda cero de la capa de operaci�n</td>
+ * </tr>
+ * <tr>
+ * <td>-1</td><td>-</td><td>value</td><td>Compara todas las bandas de la capa de entrada con el valor 
+ *                                   de threshold</td>
+ * </tr>
+ * <tr>
+ * <td>0</td><td>-1</td><td>-</td><td>Caso no permitido</td>
+ * </tr>
+ * <tr>
+ * <td>0</td><td>-</td><td>value</td><td>Compara la banda cero de la capa de entrada con el valor
+ *                                   de threshold</td>
+ * </tr>                                  
+ * </table>  
+ * 
+ * Input parameters
+ * <UL>
+ * <LI><b>RASTER_STORE1:</b>(Store method) Input store.</LI>
+ * <LI><b>RASTER_STORE2:</b>(Store method) Operation store. If this parameter is null then THRESHOLD is mandatory</LI>
+ * <LI><b>RASTER_STORE3:</b>(Store method) Output store. If this parameter is null then FIXED_VALUE is mandatory</LI>
+ * <LI><b>RASTER_BUFFER1:</b>(Buffer method) Input buffer</LI>
+ * <LI><b>RASTER_BUFFER2:</b>(Buffer method) Operation buffer. If this parameter is null then THRESHOLD is mandatory</LI>
+ * <LI><b>RASTER_BUFFER3:</b>(Buffer method) Output buffer. If this parameter is null then FIXED_VALUE is mandatory</LI>
+ * <LI><b>BAND1:</b> RASTER_STORE1 band. Band to compare with the threshold or operation band. If BAND1 is lesser than 0 then all
+ * bands will be compared. If BAND1 is lesser than zero and BAND2 is lesser than zero then the store </LI>
+ * <LI><b>BAND2:</b> RASTER_STORE2 band. Band to compare with the input store band</LI>
+ * <LI><b>BAND3:</b> RASTER:STORE3 band. Band to put in the output when the method is "layer bands selecteds"</LI>
+ * <LI><b>THRESHOLD:</b> Threshold to compare with the input data</LI>
+ * <LI><b>FIXED_VALUE:</b> Value to put in the output when the method is "Fixed Value" or "NoData"</LI>
+ * <LI><b>OPERATION:</b> Operation. Index in list MASK_OPERATIONS</LI>
+ * <LI><b>SATISFY_METHOD:</b> Output method. Index in list OUTPUT_METHODS</LI>
+ * <LI><b>PATH:</b></LI>
+ * </UL>
+ * 
+ * Possible output parameters
+ * <UL>
+ * <LI><b>BUFFER:</b></LI>
+ * <LI><b>FILENAME:</b></LI>
+ * <LI><b>TIME:</b></LI>
+ * </UL>
+ * 10/12/2007
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class MaskthresholdProcess extends DataProcess {
+	//Possible input parameters
+	public static String      RASTER_STORE1    = "RasterStore1"; //Input store
+	public static String      RASTER_STORE2    = "RasterStore2"; //Operation store if exists (threshold)
+	public static String      RASTER_STORE3    = "RasterStore3"; //Output store if exists (fixed value)
+	public static String      RASTER_BUFFER1   = "Buffer1";      //Intput buffer
+	public static String      RASTER_BUFFER2   = "Buffer2";      //Operation buffer if exists (threshold)
+	public static String      RASTER_BUFFER3   = "Buffer3";      //Output buffer if exists (fixed value)
+	public static String      BAND1            = "Band1";       
+	public static String      BAND2            = "Band2";
+	public static String      BAND3            = "Band3";
+	public static String      THRESHOLD        = "Threshold";
+	public static String      FIXED_VALUE      = "FixedValue";
+	public static String      OPERATION        = "Operation";
+	public static String      SATISFY_METHOD   = "Satisfy_Method";
+	public static String      PATH             = "Path";
+	
+	//Possible output parameters
+	public static String      BUFFER           = "Buffer";
+	public static String      FILENAME         = "FileName";
+	
+	public static String[]    MASK_OPERATIONS  = new String[]{"Greater", "Lower", 
+		                                                      "GreaterOrEquals", "LoweOrEquals"};
+	public static String[]    OUTPUT_METHODS   = new String[]{"NoData", "FixedValue", 
+		                                                      "Transparency", "Opacity", 
+		                                                      "LayerAndBandsSelected", "LayerAndBandsSelectedInverse"};
+	
+	private RasterDataStore   inputStore       = null;
+	private RasterDataStore   operationStore   = null;
+	private RasterDataStore   outputStore      = null;
+	private Buffer            inputBuffer      = null;
+	private Buffer            operationBuffer  = null;
+	private Buffer            outputBuffer     = null;
+	private int               band1            = 0;
+	private int               band2            = 0;
+	private int               band3            = 0; //-1 All
+	private int               resultNumBands   = 0;
+	
+	private String            filename         = null; //If is null only returns a buffer
+	private double            threshold        = 0;
+	private double            fixedValue       = 0;
+	private NoData            nodata           = null;
+	private AbstractOperation operation        = null;
+	private AbstractOperation opSatisfy        = null;
+	private AbstractOperation opNotSatisfy     = null;
+	private Buffer            resultBuffer     = null;
+	
+	public static void registerParameters() {
+		registerInputParameter(RASTER_STORE1, RasterDataStore.class, MaskthresholdAlgorithmLibrary.PROCESS_LABEL);
+		registerInputParameter(RASTER_STORE2, RasterDataStore.class, MaskthresholdAlgorithmLibrary.PROCESS_LABEL);
+		registerInputParameter(RASTER_STORE3, RasterDataStore.class, MaskthresholdAlgorithmLibrary.PROCESS_LABEL);
+		
+		registerInputParameter(RASTER_BUFFER1, Buffer.class, MaskthresholdAlgorithmLibrary.PROCESS_LABEL);
+		registerInputParameter(RASTER_BUFFER2, Buffer.class, MaskthresholdAlgorithmLibrary.PROCESS_LABEL);
+		registerInputParameter(RASTER_BUFFER3, Buffer.class, MaskthresholdAlgorithmLibrary.PROCESS_LABEL);
+		
+		registerInputParameter(BAND1, Integer.class, MaskthresholdAlgorithmLibrary.PROCESS_LABEL);
+		registerInputParameter(BAND2, Integer.class, MaskthresholdAlgorithmLibrary.PROCESS_LABEL);
+		registerInputParameter(BAND3, Integer.class, MaskthresholdAlgorithmLibrary.PROCESS_LABEL);
+		
+		registerInputParameter(SATISFY_METHOD, Integer.class, MaskthresholdAlgorithmLibrary.PROCESS_LABEL);
+		registerInputParameter(THRESHOLD, Double.class, MaskthresholdAlgorithmLibrary.PROCESS_LABEL);
+		registerInputParameter(FIXED_VALUE, Double.class, MaskthresholdAlgorithmLibrary.PROCESS_LABEL);
+		registerInputParameter(OPERATION, Integer.class, MaskthresholdAlgorithmLibrary.PROCESS_LABEL);
+		
+		registerInputParameter(PATH, String.class, MaskthresholdAlgorithmLibrary.PROCESS_LABEL);
+		
+		registerOutputParameter(FILENAME, String.class, MaskthresholdAlgorithmLibrary.PROCESS_LABEL);
+		registerOutputParameter(BUFFER, Buffer.class, MaskthresholdAlgorithmLibrary.PROCESS_LABEL);
+	}
+	
+	public void init() {
+		inputStore = getParam(RASTER_STORE1) != null ? (RasterDataStore)getParam(RASTER_STORE1) : null;
+		operationStore = getParam(RASTER_STORE2) != null ? (RasterDataStore)getParam(RASTER_STORE2) : null; //Default Null
+		outputStore = getParam(RASTER_STORE3) != null ? (RasterDataStore)getParam(RASTER_STORE3) : null; //Default Null
+		
+		inputBuffer = getParam(RASTER_BUFFER1) != null ? (Buffer)getParam(RASTER_BUFFER1) : null;
+		operationBuffer = getParam(RASTER_BUFFER2) != null ? (Buffer)getParam(RASTER_BUFFER2) : null;
+		outputBuffer = getParam(RASTER_BUFFER3) != null ? (Buffer)getParam(RASTER_BUFFER3) : null;
+		
+		band1 = (Integer)getIntParam(BAND1); //Default 0
+		band2 = (Integer)getIntParam(BAND2); //Default 0
+		band3 = (Integer)getIntParam(BAND3); //Default 0
+
+		//Caso no permitido. No se puede comparar una banda de la de entrada 
+		//con todas de la capa de operaci�n. Evitamos el pete
+		if(band2 < 0 && band1 >= 0) 
+			band2 = 0;
+
+		int satisfy = (Integer)getIntParam(SATISFY_METHOD); //Default 0
+
+		if(satisfy == 0) {
+			opSatisfy = new NoDataOp();
+			opNotSatisfy = new FixedValueOp();
+			resultNumBands = 1;
+		}
+		if(satisfy == 1) {
+			opSatisfy = new FixedValueOp();
+			opNotSatisfy = new NoDataOp();
+			resultNumBands = 1;
+		}
+		if(satisfy == 2) {
+			opSatisfy = new TransparencyOp();
+			opNotSatisfy = new OpacityOp();
+			resultNumBands = 4;
+		}
+		if(satisfy == 3) {
+			opSatisfy = new OpacityOp();
+			opNotSatisfy = new TransparencyOp();
+			resultNumBands = 4;
+		}
+		if(satisfy == 4) {
+			opSatisfy = new LayerOp();
+			opNotSatisfy = new NoDataOp();
+		}
+		if(satisfy == 5) {
+			opSatisfy = new NoDataOp();
+			opNotSatisfy = new LayerOp();
+		}
+		if(satisfy == 4 || satisfy == 5) {
+			if(outputStore != null)
+				resultNumBands = band3 >= 0 ? band3 + 1 : outputStore.getBandCount();
+			if(outputBuffer != null)
+				resultNumBands = band3 >= 0 ? band3 + 1 : outputBuffer.getBandCount();
+		}
+		
+		int op = (Integer)getIntParam(OPERATION); //Default 0
+		if(op == 0)
+			operation = new Greater();
+		if(op == 1)
+			operation = new Lower();
+		if(op == 2)
+			operation = new GreaterOrEquals();
+		if(op == 3)
+			operation = new LowerOrEquals();
+		threshold = (Double)getDoubleParam(THRESHOLD); //Default 0
+		fixedValue = (Double)getDoubleParam(FIXED_VALUE); //Default 0
+		
+		filename = getStringParam(PATH);
+	}
+	
+	/**
+	 * M�todo donde se ejecutar� el Thread, aqu� se reproyecta el raster.
+	 */
+	public void process() throws ProcessInterruptedException, ProcessException {
+		insertLineLog(Messages.getText("maskthreshold"));
+		
+		try {
+			if(inputStore != null)
+				checkStore();
+			else
+				checkBuffer();
+			
+			Rectangle2D[] pxBBox = null;
+			
+			if(inputStore != null) {
+				inputBuffer = readROBuffer(inputStore, band1);
+				RasterDataStore[] storeList = new RasterDataStore[]{inputStore, operationStore, outputStore};
+				pxBBox = getIntersectionInPxCoords(storeList);
+			} else {
+				Rectangle2D r = new Rectangle2D.Double(0, 0, inputBuffer.getWidth(), inputBuffer.getHeight());
+				pxBBox = new Rectangle2D[]{r, r, r};
+			}
+			
+			if(operationStore != null) 
+				operationBuffer = readROBuffer(operationStore, band2);
+			
+			int dataType = Buffer.TYPE_DOUBLE;
+			
+			if(outputStore != null) { 
+				outputBuffer = readROBuffer(outputStore, band3);
+			}
+			
+			if(outputBuffer != null) {
+				dataType = outputBuffer.getDataType();
+			}
+			
+			BufferParam param = RasterLocator.getManager().getBufferFactory().createBufferParams(
+					(int)pxBBox[0].getWidth(), 
+					(int)pxBBox[0].getHeight(), 
+					resultNumBands, 
+					dataType, 
+					true);
+			resultBuffer = RasterLocator.getManager().getBufferFactory().createBuffer(param);
+			
+			write(resultBuffer, pxBBox);
+			
+			if(filename != null)
+				exportRaster(filename, resultBuffer, inputStore.getCellSize(), 
+						inputStore.getExtent().getULX(), inputStore.getExtent().getULY());
+
+			addOutputValue(FILENAME, filename);
+			addOutputValue(BUFFER, resultBuffer);
+		} catch (MaskthresholdException e) {
+			if (incrementableTask != null)
+				incrementableTask.processFinalize();
+			messageBoxError("error_processing_maskthreshold", null, e);
+		} catch (LocatorException e) {
+			messageBoxError("error_creating_buffer", null, e);
+		} catch (BufferCreationException e) {
+			messageBoxError("error_creating_buffer", null, e);
+		} finally {
+			if (incrementableTask != null) {
+				incrementableTask.processFinalize();
+				setProgressActive(false);
+			}
+		}
+	}
+	
+	/**
+	 * Checks input parameters for DataStores
+	 * @throws MaskthresholdException
+	 */
+	private void checkStore() throws MaskthresholdException {
+		if(opSatisfy instanceof TransparencyOp || opSatisfy instanceof OpacityOp && 
+				(outputStore == null || outputStore.getBandCount() < 3 || outputStore.getDataType()[0] != Buffer.TYPE_BYTE)) {
+			throw new MaskthresholdException("Not valid parameters. Transparency method have 3 output bands");
+		}
+
+		if((opSatisfy instanceof LayerOp || opNotSatisfy instanceof LayerOp) && 
+				outputStore == null)
+			throw new MaskthresholdException("Not valid parameters. Layer method have output data store");
+
+		if (inputStore == null)
+			throw new MaskthresholdException("Layer not valid");
+		
+		if(operationStore != null) {
+			if(!inputStore.getExtent().intersects(operationStore.getExtent()))
+				throw new MaskthresholdException("Extents don't intersect");
+			if(inputStore.getCellSize() != operationStore.getCellSize())
+				throw new MaskthresholdException("Cell sizes are not equal");
+			if(band1 < 0 && band2 < 0) { // Si se comparan todas las bandas, la capa dos debe tener m�s bandas que la uno o las mismas
+				if(operationStore.getBandCount() < inputStore.getBandCount())
+					throw new MaskthresholdException("If exists operation layer and all bands have to be compared then the operation layer must have more or the same number of bands that the input layer.");
+			}
+		}
+	}
+	
+	/**
+	 * Checks input parameters for Buffers
+	 * @throws MaskthresholdException
+	 */
+	private void checkBuffer() throws MaskthresholdException {
+		if(opSatisfy instanceof TransparencyOp || opSatisfy instanceof OpacityOp && 
+				(outputBuffer == null || outputBuffer.getBandCount() < 3 || outputBuffer.getDataType() != Buffer.TYPE_BYTE)) {
+			throw new MaskthresholdException("Not valid parameters. Transparency method have 3 output bands");
+		}
+
+		if((opSatisfy instanceof LayerOp || opNotSatisfy instanceof LayerOp) && 
+				outputBuffer == null)
+			throw new MaskthresholdException("Not valid parameters. Layer method have output data store");
+
+		if (inputBuffer == null)
+			throw new MaskthresholdException("Layer not valid");
+		
+		if(outputBuffer != null) {
+			if ((inputBuffer.getWidth() != outputBuffer.getWidth()) || 
+					(inputBuffer.getHeight() != outputBuffer.getHeight()))
+				throw new MaskthresholdException("Buffer sizes not valid");
+		}
+		
+		if(operationBuffer != null) {
+			if(band1 < 0 && band2 < 0) { // Si se comparan todas las bandas, la capa dos debe tener m�s bandas que la uno o las mismas
+				if(operationBuffer.getBandCount() < inputBuffer.getBandCount())
+					throw new MaskthresholdException("If exists operation layer and all bands have to be compared then the operation layer must have more or the same number of bands that the input layer.");
+			}
+		}
+	}
+	
+	/**
+	 * Reads a band of a buffer
+	 * @param store
+	 * @param band
+	 * @return
+	 * @throws MaskthresholdException
+	 * @throws ProcessInterruptedException
+	 */
+	private Buffer readROBuffer(RasterDataStore store, int band) throws MaskthresholdException, ProcessInterruptedException {
+		RasterQuery query = RasterLocator.getManager().createQuery();
+		if(band >= 0 && band < store.getBandCount())
+			query.setDrawableBands(new int[]{band});
+		else
+			query.setAllDrawableBands();
+		query.setReadOnly(true);
+		query.setAreaOfInterest();
+		
+		try {
+			return store.query(query);
+		} catch (QueryException e) {
+			throw new MaskthresholdException("Error reading input raster.");
+		}
+	}
+	
+	private void write(Buffer result, Rectangle2D[] pxBbox) throws ProcessInterruptedException {
+		if(nodata == null)
+			nodata = RasterLocator.getManager().getDataStructFactory().createDefaultNoData(1, result.getDataType());
+		int colSource = (int)pxBbox[0].getX();
+		int rowSource = (int)pxBbox[0].getY();
+		int colOperation = colSource;
+		int rowOperation = rowSource;
+		if(pxBbox.length > 1) {
+			colOperation = (int)pxBbox[1].getX();
+			rowOperation = (int)pxBbox[1].getY();
+		}
+
+		opSatisfy.fixedValue = opNotSatisfy.fixedValue = fixedValue;
+		opSatisfy.result = opNotSatisfy.result = result;
+		opSatisfy.outBuffer = opNotSatisfy.outBuffer = outputBuffer;
+		opSatisfy.band = opNotSatisfy.band = band3;
+		
+		int inputInitBand = band1 < 0 ? 0 : band1;
+		int inputEndBand = band1 < 0 ? inputBuffer.getBandCount() : band1 + 1;
+
+		for (int row = 0; row < result.getHeight(); row++) {
+			if(pxBbox.length > 1) {
+				colOperation = (int)pxBbox[1].getX();
+				colSource = (int)pxBbox[0].getX();
+			}
+			colSource = 0;
+			for (int col = 0; col < result.getWidth(); col++) {
+				boolean compare = true;
+				for (int iBands = inputInitBand; iBands < inputEndBand; iBands++) {
+					double op1 = getValue(inputBuffer, rowSource, colSource, iBands);
+					double op2 = getValue(operationBuffer, rowOperation, colOperation, getBandToCompare(operationBuffer, iBands));
+					if(!operation.compare(op1, op2)) {
+						compare = false;
+						break;
+					}
+				}
+				if(compare) {
+					opSatisfy.row = row;
+					opSatisfy.col = col;
+					opSatisfy.invoke();
+				} else {
+					opNotSatisfy.row = row;
+					opNotSatisfy.col = col;
+					opNotSatisfy.invoke();
+				}
+				colSource ++;
+				colOperation++;
+			}
+			rowSource ++;
+			rowOperation ++;
+			updatePercent((int)((row * 100) / result.getHeight()), 100);
+		}
+	}
+
+	/**
+	 * Gets the band to operate. If the buffer is null then it does not 
+	 * matter and it returns zero.
+	 * @param buf
+	 * @param inputBand
+	 * @return
+	 */
+	private int getBandToCompare(Buffer buf, int inputBand) {
+		if(buf == null)
+			return 0;
+		if(band2 < 0)
+			return inputBand;
+		else
+			return band2;
+	}
+
+	/**
+	 * Gets the operation value in using a double value. If there is a operation data store then
+	 * returns the value of the pixel in this position else it returns a threshold value
+	 * @param operationBuffer
+	 * @param rowOperation
+	 * @param colOperation
+	 * @return
+	 */
+	private double getValue(Buffer buf, int rowOperation, int colOperation, int band) {
+		if(buf == null)
+			return threshold;
+		if(buf.getDataType() == Buffer.TYPE_BYTE)
+			return buf.getElemByte(rowOperation, colOperation, band);
+		if(buf.getDataType() == Buffer.TYPE_FLOAT)
+			return buf.getElemFloat(rowOperation, colOperation, band);
+		if(buf.getDataType() == Buffer.TYPE_DOUBLE)
+			return buf.getElemDouble(rowOperation, colOperation, band);
+		if(buf.getDataType() == Buffer.TYPE_SHORT)
+			return buf.getElemShort(rowOperation, colOperation, band);
+		if(buf.getDataType() == Buffer.TYPE_INT)
+			return buf.getElemInt(rowOperation, colOperation, band);
+		return 0;
+	}
+	
+	public String getTitle() {
+		return Messages.getText("maskthreshold");
+	}
+	
+	abstract class AbstractOperation implements Operation {
+		public int       row          = 0;
+		public int       col          = 0;
+		public Buffer    result       = null;
+		public double    fixedValue   = 0;
+		public Buffer    outBuffer   = null;
+		public int       band         = 0;
+		
+		public void invoke() {
+			
+		}
+		public boolean compare(double a, double b) {
+			return false;
+		}
+	}
+	
+	class LayerOp extends AbstractOperation {
+		public void invoke() {
+			if(result.getDataType() == Buffer.TYPE_BYTE) {
+				if(band < 0) {
+					for (int i = 0; i < result.getBandCount(); i++) {
+						byte vSource = outBuffer.getElemByte(row, col, i);
+						result.setElem(row, col, i, vSource);
+					}
+				} else {
+					byte vSource = outBuffer.getElemByte(row, col, band);
+					result.setElem(row, col, band, vSource);
+				}
+			} else if(result.getDataType() == Buffer.TYPE_FLOAT) {
+				if(band < 0) {
+					for (int i = 0; i < result.getBandCount(); i++) {
+						float vSource = outBuffer.getElemFloat(row, col, i);
+						result.setElem(row, col, i, vSource);
+					}
+				} else {
+					float vSource = outBuffer.getElemFloat(row, col, band);
+					result.setElem(row, col, band, vSource);
+				}
+			} else if(result.getDataType() == Buffer.TYPE_DOUBLE) {
+				if(band < 0) {
+					for (int i = 0; i < result.getBandCount(); i++) {
+						double vSource = outBuffer.getElemDouble(row, col, i);
+						result.setElem(row, col, i, vSource);
+					}
+				} else {
+					double vSource = outBuffer.getElemDouble(row, col, band);
+					result.setElem(row, col, band, vSource);
+				}
+			} else if(result.getDataType() == Buffer.TYPE_SHORT) {
+				if(band < 0) {
+					for (int i = 0; i < result.getBandCount(); i++) {
+						float vSource = outBuffer.getElemShort(row, col, i);
+						result.setElem(row, col, i, vSource);
+					}
+				} else {
+					float vSource = outBuffer.getElemShort(row, col, band);
+					result.setElem(row, col, band, vSource);
+				}
+			} else if(result.getDataType() == Buffer.TYPE_INT) {
+				if(band < 0) {
+					for (int i = 0; i < result.getBandCount(); i++) {
+						int vSource = outBuffer.getElemInt(row, col, i);
+						result.setElem(row, col, i, vSource);
+					}
+				} else {
+					int vSource = outBuffer.getElemInt(row, col, band);
+					result.setElem(row, col, band, vSource);
+				}
+			}
+		}
+	}
+	
+	class TransparencyOp extends AbstractOperation {
+		public void invoke() {
+			if(result.getDataType() == Buffer.TYPE_BYTE) {
+				for (int i = 0; i < 3; i++) {
+					byte vSource = outBuffer.getElemByte(row, col, i);
+					result.setElem(row, col, i, vSource);
+				}
+				result.setElem(row, col, 4, (byte)0);
+			}
+		}
+	}
+	
+	class OpacityOp extends AbstractOperation {
+		public void invoke() {
+			if(result.getDataType() == Buffer.TYPE_BYTE) {
+				for (int i = 0; i < 3; i++) {
+					byte vSource = outBuffer.getElemByte(row, col, i);
+					result.setElem(row, col, i, vSource);
+				}
+				result.setElem(row, col, 4, (byte)255);
+			}
+		}
+	}
+
+	class FixedValueOp extends AbstractOperation {
+		public void invoke() {
+			if(result.getDataType() == Buffer.TYPE_BYTE)
+				result.setElem(row, col, 0, (byte)fixedValue);
+			else if(result.getDataType() == Buffer.TYPE_FLOAT)
+				result.setElem(row, col, 0, (float)fixedValue);
+			else if(result.getDataType() == Buffer.TYPE_DOUBLE)
+				result.setElem(row, col, 0, fixedValue);
+			else if(result.getDataType() == Buffer.TYPE_SHORT)
+				result.setElem(row, col, 0, (short)fixedValue);
+			else if(result.getDataType() == Buffer.TYPE_INT)
+				result.setElem(row, col, 0, (int)fixedValue);
+		}
+	}
+	
+	class NoDataOp extends AbstractOperation {
+		public void invoke() {
+			if(result.getDataType() == Buffer.TYPE_BYTE)
+				if(band < 0) {
+					for (int i = 0; i < result.getBandCount(); i++) {
+						result.setElem(row, col, i, nodata.getValue().byteValue());
+					}
+				} else {
+					result.setElem(row, col, band, nodata.getValue().byteValue());
+				}
+			else if(result.getDataType() == Buffer.TYPE_FLOAT)
+				if(band < 0) {
+					for (int i = 0; i < result.getBandCount(); i++) {
+						result.setElem(row, col, i, nodata.getValue().floatValue());
+					}
+				} else {
+					result.setElem(row, col, band, nodata.getValue().floatValue());
+				}
+			else if(result.getDataType() == Buffer.TYPE_DOUBLE)
+				if(band < 0) {
+					for (int i = 0; i < result.getBandCount(); i++) {
+						result.setElem(row, col, i, nodata.getValue().doubleValue());
+					}
+				} else {
+					result.setElem(row, col, band, nodata.getValue().doubleValue());
+				}
+			else if(result.getDataType() == Buffer.TYPE_SHORT)
+				if(band < 0) {
+					for (int i = 0; i < result.getBandCount(); i++) {
+						result.setElem(row, col, i, nodata.getValue().shortValue());
+					}
+				} else {
+					result.setElem(row, col, band, nodata.getValue().shortValue());
+				}
+			else if(result.getDataType() == Buffer.TYPE_INT)
+				if(band < 0) {
+					for (int i = 0; i < result.getBandCount(); i++) {
+						result.setElem(row, col, i, nodata.getValue().intValue());
+					}
+				} else {
+					result.setElem(row, col, band, nodata.getValue().intValue());
+				}
+		}
+	}
+
+	class Greater extends AbstractOperation {
+		public boolean compare(double a, double b) {
+			return a > b;
+		}
+	}
+
+	class Lower extends AbstractOperation {
+		public boolean compare(double a, double b) {
+			return a < b;
+		}
+	}
+
+	class GreaterOrEquals extends AbstractOperation {
+		public boolean compare(double a, double b) {
+			return a >= b;
+		}
+	}
+
+	class LowerOrEquals extends AbstractOperation {
+		public boolean compare(double a, double b) {
+			return a <= b;
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/java/org/gvsig/raster/tools/algorithm/maskthreshold/MaskthresholdProcess.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/java/org/gvsig/raster/tools/algorithm/maskthreshold
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/java/org/gvsig/raster/tools/algorithm
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/java/org/gvsig/raster/tools
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/java/org/gvsig/raster
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/java/org/gvsig
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/java/org
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/java
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 8183)
@@ -0,0 +1 @@
+org.gvsig.raster.tools.algorithm.maskthreshold.MaskthresholdAlgorithmLibrary
\ No newline at end of file

Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/resources/META-INF/services
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/resources/META-INF
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main/resources
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src/main
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/src
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/pom.xml
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/pom.xml	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold/pom.xml	(revision 8183)
@@ -0,0 +1,19 @@
+<?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.tools.algorithm.maskthreshold</artifactId>
+	<packaging>jar</packaging>
+	<name>org.gvsig.raster.tools.algorithm.maskthreshold</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.tools.algorithm</artifactId>
+		<version>2.2.62</version>
+	</parent>
+    <dependencies>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.algorithm</artifactId>
+            <scope>compile</scope>
+		</dependency>
+	</dependencies>
+</project>

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


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.maskthreshold
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath
target



Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/org.gvsig.raster.tools.algorithm
___________________________________________________________________
Added: svn:ignore
   + .project
.settings
.classpath


Index: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/pom.xml
===================================================================
--- org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/pom.xml	(revision 0)
+++ org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62/pom.xml	(revision 8183)
@@ -0,0 +1,136 @@
+<?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.tools</artifactId>
+	<packaging>pom</packaging>
+	<version>2.2.62</version>
+	<name>org.gvsig.raster.tools</name>
+	<description>Raster tools for gvSIG</description>
+	<inceptionYear>2011</inceptionYear>
+	<parent>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.desktop</artifactId>
+      <version>2.0.206</version>
+  </parent>
+
+        <properties>
+            <!-- El plugin versions:use-latest-versions falla con scope import -->
+            <!-- asi que toca usar el versions:update-properties que si que funciona -->
+            <org.gvsig.raster.version>2.2.73</org.gvsig.raster.version>
+            <org.gvsig.geoprocess.version>2.2.84</org.gvsig.geoprocess.version>
+        </properties>
+
+  <repositories>
+    <repository>
+      <id>gvsig-public-http-repository</id>
+      <name>gvSIG maven public HTTP repository</name>
+      <url>http://devel.gvsig.org/m2repo/j2se</url>
+      <releases>
+        <enabled>true</enabled>
+        <updatePolicy>daily</updatePolicy>
+        <checksumPolicy>warn</checksumPolicy>
+      </releases>
+      <snapshots>
+        <enabled>true</enabled>
+        <updatePolicy>daily</updatePolicy>
+        <checksumPolicy>warn</checksumPolicy>
+      </snapshots>
+    </repository>
+  </repositories>
+
+  <scm>
+      <connection>scm:svn:https://devel.gvsig.org/svn/gvsig-raster/org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62</connection>
+      <developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-raster/org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62</developerConnection>
+      <url>https://devel.gvsig.org/redmine/projects/gvsig-raster/repository/show/org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62</url>
+  </scm>
+
+  <dependencyManagement>
+  	<dependencies>
+                        <dependency>
+                                <groupId>org.gvsig</groupId>
+                                <artifactId>org.gvsig.raster</artifactId>
+                                <version>${org.gvsig.raster.version}</version>
+                                <type>pom</type>
+                                <scope>import</scope>
+                        </dependency>
+
+                        <dependency>
+                                <groupId>org.gvsig</groupId>
+                                <artifactId>org.gvsig.geoprocess</artifactId>
+                                <version>${org.gvsig.geoprocess.version}</version>
+                                <type>pom</type>
+                                <scope>import</scope>
+                        </dependency>
+
+
+    	<!--
+    	Versions of child projects
+    	-->
+			<dependency>
+				<groupId>org.gvsig</groupId>
+				<artifactId>org.gvsig.raster.tools.app.basic</artifactId>
+				<version>2.2.62</version>
+			</dependency>
+			<dependency>
+				<groupId>org.gvsig</groupId>
+				<artifactId>org.gvsig.raster.tools.algorithm.layerdatatype</artifactId>
+       	<version>2.2.62</version>
+			</dependency>
+			<dependency>
+				<groupId>org.gvsig</groupId>
+				<artifactId>org.gvsig.raster.tools.algorithm.saveraster</artifactId>
+       	<version>2.2.62</version>
+			</dependency>
+			<!--
+			<dependency>
+				<groupId>org.gvsig</groupId>
+				<artifactId>org.gvsig.raster.tools.algorithm.clip</artifactId>
+       	<version>2.0.1-SNAPSHOT</version>
+			</dependency>
+			-->
+			<dependency>
+          <groupId>org.gvsig</groupId>
+	        <artifactId>org.gvsig.raster.tools.algorithm.swing.api</artifactId>
+	        <version>2.2.62</version>
+    	</dependency>
+    	<dependency>
+          <groupId>org.gvsig</groupId>
+	        <artifactId>org.gvsig.raster.tools.algorithm.swing.impl</artifactId>
+	        <version>2.2.62</version>
+    	</dependency>
+    	<dependency>
+          <groupId>org.gvsig</groupId>
+	        <artifactId>org.gvsig.raster.tools.algorithm.maskthreshold</artifactId>
+	        <version>2.2.62</version>
+    	</dependency>
+    	<dependency>
+				<groupId>org.gvsig</groupId>
+				<artifactId>org.gvsig.raster.tools.toolbox.algorithm</artifactId>
+				<version>2.2.62</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.tools/tags/</tagBase>
+                  <goals>deploy</goals>
+              </configuration>
+          </plugin>
+      </plugins>
+  </build>
+
+	<modules>
+		<module>org.gvsig.raster.tools.algorithm</module>
+		<module>org.gvsig.raster.tools.app.basic</module>
+		<module>org.gvsig.raster.tools.toolbox.algorithm</module>
+		<!-- <module>org.gvsig.raster.tools.main</module>-->
+	</modules>
+
+</project>

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


Property changes on: org.gvsig.raster.tools/tags/org.gvsig.raster.tools-2.2.62
___________________________________________________________________
Added: svn:mergeinfo
   Merged /org.gvsig.raster.tools/branches/org.gvsig.raster.tools_proyeccion_al_vuelo:r5471-5472
Added: svn:ignore
   + .project
.settings
.classpath
.pom.xml.swp


