gvsig-raster / org.gvsig.raster / branches / org.gvsig.raster.2.4 / org.gvsig.raster / org.gvsig.raster.lib / org.gvsig.raster.lib.buffer / org.gvsig.raster.lib.buffer.spi / src / main / java / org / gvsig / raster / lib / buffer / spi / operations / AbstractSpecifiedBandsOperation.java @ 8682
History | View | Annotate | Download (2.31 KB)
1 |
/* gvSIG. Desktop Geographic Information System.
|
---|---|
2 |
*
|
3 |
* Copyright ? 2007-2018 gvSIG Association
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
18 |
* MA 02110-1301, USA.
|
19 |
*
|
20 |
* For any additional information, do not hesitate to contact us
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
22 |
*/
|
23 |
package org.gvsig.raster.lib.buffer.spi.operations; |
24 |
|
25 |
import java.util.ArrayList; |
26 |
import java.util.List; |
27 |
|
28 |
import org.gvsig.raster.lib.buffer.api.exceptions.BufferOperationException; |
29 |
import org.gvsig.raster.lib.buffer.api.operations.SpecifiedBandsOperation; |
30 |
import org.gvsig.raster.lib.buffer.spi.exceptions.ProcessingOperationException; |
31 |
|
32 |
/**
|
33 |
* @author fdiaz
|
34 |
*
|
35 |
*/
|
36 |
public abstract class AbstractSpecifiedBandsOperation extends AbstractOperation implements SpecifiedBandsOperation { |
37 |
|
38 |
protected List<Integer> bandsToProcess; |
39 |
|
40 |
/**
|
41 |
*
|
42 |
*/
|
43 |
public AbstractSpecifiedBandsOperation() {
|
44 |
// TODO Auto-generated constructor stub
|
45 |
} |
46 |
|
47 |
@Override
|
48 |
public void preProcess() throws BufferOperationException { |
49 |
super.preProcess();
|
50 |
if(this.parameters.getDynClass().getDynField(BANDS_TO_PROCESS_PARAM)!=null) { |
51 |
bandsToProcess = (List<Integer>)this.parameters.getDynValue(BANDS_TO_PROCESS_PARAM); |
52 |
} |
53 |
|
54 |
if(this.bandsToProcess==null) { |
55 |
bandsToProcess = new ArrayList(buffer.getBandCount()); |
56 |
for (int i=0; i<buffer.getBandCount(); i++){ |
57 |
bandsToProcess.add(i); |
58 |
} |
59 |
}; |
60 |
} |
61 |
|
62 |
@Override
|
63 |
public void process() throws ProcessingOperationException { |
64 |
super.process();
|
65 |
} |
66 |
|
67 |
@Override
|
68 |
public void postProcess() throws BufferOperationException { |
69 |
super.postProcess();
|
70 |
} |
71 |
} |