Revision 1055 org.gvsig.geoprocess/branches/refactor-2018/org.gvsig.geoprocess/org.gvsig.geoprocess.lib/org.gvsig.geoprocess.lib.sextante/src/main/java/org/gvsig/geoprocess/lib/sextante/core/DefaultOutputFactory.java
DefaultOutputFactory.java | ||
---|---|---|
53 | 53 |
import es.unex.sextante.outputs.FileOutputChannel; |
54 | 54 |
import es.unex.sextante.outputs.IOutputChannel; |
55 | 55 |
import es.unex.sextante.outputs.NullOutputChannel; |
56 |
import java.util.logging.Level; |
|
57 |
import java.util.logging.Logger; |
|
58 |
import org.gvsig.raster.lib.buffer.api.exceptions.BufferException; |
|
56 | 59 |
|
57 | 60 |
/** |
58 | 61 |
* An OutputFactory based on the gvSIG data model. Supports only file-based |
... | ... | |
63 | 66 |
*/ |
64 | 67 |
public class DefaultOutputFactory extends OutputFactory { |
65 | 68 |
|
69 |
@Override |
|
66 | 70 |
public IVectorLayer getNewVectorLayer(final String name, |
67 | 71 |
final int shapeType, final Class[] types, final String[] fields, |
68 | 72 |
final IOutputChannel channel, final Object crs, final int subtype) |
... | ... | |
145 | 149 |
final String sFilename = |
146 | 150 |
((FileOutputChannel) channel).getFilename(); |
147 | 151 |
final BufferWriteOnlyIRasterLayer layer = new BufferWriteOnlyIRasterLayer(); |
148 |
layer.create(sName, sFilename, extent, iDataType, iBands, crs); |
|
152 |
try { |
|
153 |
layer.create(sName, sFilename, extent, iDataType, iBands, crs); |
|
154 |
} catch (BufferException ex) { |
|
155 |
Logger.getLogger(DefaultOutputFactory.class.getName()).log(Level.SEVERE, null, ex); |
|
156 |
} |
|
149 | 157 |
return layer; |
150 | 158 |
} else { |
151 | 159 |
throw new UnsupportedOutputChannelException(); |
... | ... | |
236 | 244 |
//If there is not active view then it looks for a view |
237 | 245 |
if(window == null || !(window instanceof AbstractViewPanel)) { |
238 | 246 |
IWindow[] windowList = PluginServices.getMDIManager().getAllWindows(); |
239 |
for (int i = 0; i < windowList.length; i++) {
|
|
240 |
if(windowList[i] instanceof AbstractViewPanel) {
|
|
241 |
window = windowList[i];
|
|
242 |
break;
|
|
243 |
}
|
|
244 |
}
|
|
247 |
for (IWindow windowList1 : windowList) {
|
|
248 |
if (windowList1 instanceof AbstractViewPanel) {
|
|
249 |
window = windowList1;
|
|
250 |
break;
|
|
251 |
}
|
|
252 |
}
|
|
245 | 253 |
} |
246 | 254 |
|
247 | 255 |
if(window != null && window instanceof AbstractViewPanel) { |
Also available in: Unified diff