Index: TailTrimOperation.java
===================================================================
--- TailTrimOperation.java	(revision 43863)
+++ TailTrimOperation.java	(revision 43864)
@@ -33,7 +33,6 @@
 import org.gvsig.raster.lib.buffer.api.operations.OperationFactory;
 import org.gvsig.raster.lib.buffer.api.statistics.Statistics;
 import org.gvsig.raster.lib.buffer.spi.exceptions.ProcessingOperationException;
-import org.gvsig.raster.lib.buffer.spi.operations.AbstractOperation;
 import org.gvsig.raster.lib.buffer.spi.operations.AbstractSpecifiedBandsOperation;
 import org.gvsig.tools.locator.LocatorException;
 
@@ -56,7 +55,7 @@
      *
      */
     public TailTrimOperation(OperationFactory factory) {
-        this.factory = factory;
+        super(factory);
     }
 
     @SuppressWarnings("unchecked")
@@ -65,32 +64,26 @@
         super.preProcess();
         BufferManager manager = BufferLocator.getBufferManager();
 
-        if(this.parameters.getDynClass().getDynField(STATISTICS_PARAM)!=null) {
-            statistics = (Statistics) this.parameters.getDynValue(STATISTICS_PARAM);
-        }
+        statistics = (Statistics) this.getParameter(STATISTICS_PARAM, null);
         if (statistics == null) {
-            statistics = this.buffer.getStatistics(null);
+            statistics = this.getInputBuffer().getStatistics(null);
         };
-        if(this.parameters.getDynClass().getDynField(TAIL_TRIM_PERCENT_PARAM)!=null) {
-            tailTrimPercent = (Double)this.parameters.getDynValue(TAIL_TRIM_PERCENT_PARAM);
-            tailTrimPercent = (tailTrimPercent>100)?100:tailTrimPercent;
-            tailTrimPercent = (tailTrimPercent<0)?0:tailTrimPercent;
-        } else {
-            tailTrimPercent = 0; // FIXME: ¿0 o 100?
-        };
+        tailTrimPercent = (double) this.getParameter(TAIL_TRIM_PERCENT_PARAM, 0);
+        tailTrimPercent = (tailTrimPercent>100)?100:tailTrimPercent;
+        tailTrimPercent = (tailTrimPercent<0)?0:tailTrimPercent;
 
         //FIXME: Falta la gestión del parámetro copyUnprocessedBands, de momento se copian sin tenerlo en cuenta
 
-        int bands = this.buffer.getBandCount();
+        int bands = this.getInputBuffer().getBandCount();
         rowProcessors = new RowProcessor[bands];
         int [] bandTypes = new int[bands];
         for (int i = 0; i < bandTypes.length; i++) {
-            bandTypes[i] = this.buffer.getBandTypes()[i];
+            bandTypes[i] = this.getInputBuffer().getBandTypes()[i];
         }
-        NoData[] noData = this.buffer.getBandNoData();
+        NoData[] noData = this.getInputBuffer().getBandNoData();
         NoData[] resultNoData = new NoData[noData.length];
         for (int band = 0; band < noData.length; band++) {
-            int bandType = this.buffer.getBand(band).getDataType();
+            int bandType = this.getInputBuffer().getBand(band).getDataType();
             switch (bandType) {
             case BufferManager.TYPE_BYTE:
                 rowProcessors[band] = new ByteRowProcessor(band);
@@ -159,13 +152,13 @@
         }
 
         try {
-            this.outputBuffer = manager.createBuffer(
-                this.buffer.getRows(),
-                this.buffer.getColumns(),
+            this.setOutputBuffer(manager.createBuffer(
+                this.getInputBuffer().getRows(),
+                this.getInputBuffer().getColumns(),
                 bandTypes,
                 resultNoData,
-                this.buffer.getProjection(),
-                this.buffer.getEnvelope());
+                this.getInputBuffer().getProjection(),
+                this.getInputBuffer().getEnvelope()));
         } catch (LocatorException | BufferException | CreateEnvelopeException e) {
             throw new BufferOperationException(e);
         }
@@ -174,12 +167,12 @@
     @Override
     public void process() throws ProcessingOperationException {
         super.process();
-        for (int band=0; band<this.buffer.getBandCount(); band++){
-            if (bandsToProcess.contains(band)) {
-                Band bufferBand = this.buffer.getBand(band);
-                Band outputBufferBand = this.outputBuffer.getBand(band);
+        for (int band=0; band<this.getInputBuffer().getBandCount(); band++){
+            if (getBandsToProcess().contains(band)) {
+                Band bufferBand = this.getInputBuffer().getBand(band);
+                Band outputBufferBand = this.getOutputBuffer().getBand(band);
 
-                for (int row = 0; row < this.buffer.getRows(); row++) {
+                for (int row = 0; row < this.getInputBuffer().getRows(); row++) {
                     Object rowBuffer = bufferBand.createRowBuffer();
                     bufferBand.fetchRow(row, rowBuffer);
 
@@ -192,7 +185,7 @@
                 }
             } else {
                 try {
-                    this.outputBuffer.getBand(band).copyFrom(this.buffer.getBand(band));
+                    this.getOutputBuffer().getBand(band).copyFrom(this.getInputBuffer().getBand(band));
                 } catch (BandException e) {
                     throw new ProcessingOperationException(e);
                 }
@@ -219,7 +212,7 @@
 
         public AbstractRowProcessor(int band) {
             this.band = band;
-            noData = buffer.getBand(band).getNoData();
+            noData = getInputBuffer().getBand(band).getNoData();
 //            outputNoData = outputBuffer.getBand(band).getNoData();
 
             double[][] tailTrim = statistics.getTailTrimValue(tailTrimPercent);
@@ -248,13 +241,13 @@
         @Override
         public Number processValue(Number value) {
             if(noData.isDefined() && noData.getValue().equals(value)){
-                return outputBuffer.getBand(band).getNoData().getValue();
+                return getOutputBuffer().getBand(band).getNoData().getValue();
             }
 
             int iValue = 0xFF & ((Byte) value).byteValue();
 
             if(iValue < minValue || iValue > maxValue){
-                return outputBuffer.getBand(band).getNoData().getValue();
+                return getOutputBuffer().getBand(band).getNoData().getValue();
             } else {
                 return value;
             }
@@ -280,13 +273,13 @@
         @Override
         public Number processValue(Number value) {
             if(noData.isDefined() && noData.getValue().equals(value)){
-                return outputBuffer.getBand(band).getNoData().getValue();
+                return getOutputBuffer().getBand(band).getNoData().getValue();
             }
 
             int iValue = ((Short) value).shortValue();
 
             if(iValue < minValue || iValue > maxValue){
-                return outputBuffer.getBand(band).getNoData().getValue();
+                return getOutputBuffer().getBand(band).getNoData().getValue();
             } else {
                 return value;
             }
@@ -312,13 +305,13 @@
         @Override
         public Number processValue(Number value) {
             if(noData.isDefined() && noData.getValue().equals(value)){
-                return outputBuffer.getBand(band).getNoData().getValue();
+                return getOutputBuffer().getBand(band).getNoData().getValue();
             }
 
             int iValue = 0xFFFF & ((Short) value).shortValue();
 
             if(iValue < minValue || iValue > maxValue){
-                return outputBuffer.getBand(band).getNoData().getValue();
+                return getOutputBuffer().getBand(band).getNoData().getValue();
             } else {
                 return value;
             }
@@ -344,12 +337,12 @@
         @Override
         public Number processValue(Number value) {
             if(noData.isDefined() && noData.getValue().equals(value)){
-                return outputBuffer.getBand(band).getNoData().getValue();
+                return getOutputBuffer().getBand(band).getNoData().getValue();
             }
             int iValue = value.intValue();
 
             if(iValue < minValue || iValue > maxValue){
-                return outputBuffer.getBand(band).getNoData().getValue();
+                return getOutputBuffer().getBand(band).getNoData().getValue();
             } else {
                 return value;
             }
@@ -374,12 +367,12 @@
         @Override
         public Number processValue(Number value) {
             if(noData.isDefined() && noData.getValue().equals(value)){
-                return outputBuffer.getBand(band).getNoData().getValue();
+                return getOutputBuffer().getBand(band).getNoData().getValue();
             }
             float fValue = value.floatValue();
 
             if(fValue < minValue || fValue > maxValue){
-                return outputBuffer.getBand(band).getNoData().getValue();
+                return getOutputBuffer().getBand(band).getNoData().getValue();
             } else {
                 return value;
             }
@@ -405,12 +398,12 @@
         @Override
         public Number processValue(Number value) {
             if(noData.isDefined() && noData.getValue().equals(value)){
-                return outputBuffer.getBand(band).getNoData().getValue();
+                return getOutputBuffer().getBand(band).getNoData().getValue();
             }
             double fValue = value.doubleValue();
 
             if(fValue < minValue || fValue > maxValue){
-                return outputBuffer.getBand(band).getNoData().getValue();
+                return getOutputBuffer().getBand(band).getNoData().getValue();
             } else {
                 return value;
             }
