Revision 651 org.gvsig.geoprocess/trunk/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 | ||
---|---|---|
51 | 51 |
import es.unex.sextante.gui.core.DefaultTaskMonitor; |
52 | 52 |
import es.unex.sextante.outputs.FileOutputChannel; |
53 | 53 |
import es.unex.sextante.outputs.IOutputChannel; |
54 |
import es.unex.sextante.outputs.NullOutputChannel; |
|
54 | 55 |
|
55 | 56 |
/** |
56 | 57 |
* An OutputFactory based on the gvSIG data model. Supports only file-based |
57 | 58 |
* outputs. |
58 |
*
|
|
59 |
* |
|
59 | 60 |
* @author volaya |
60 |
*
|
|
61 |
* |
|
61 | 62 |
*/ |
62 | 63 |
public class DefaultOutputFactory extends OutputFactory { |
63 | 64 |
|
... | ... | |
72 | 73 |
sizes); |
73 | 74 |
|
74 | 75 |
} |
75 |
|
|
76 |
|
|
76 | 77 |
private int[] getSizesFromTypeClass(final Class[] types) { |
77 | 78 |
final int[] sizes = new int[types.length]; |
78 | 79 |
for (int i = 0; i < sizes.length; i++) { |
... | ... | |
99 | 100 |
crs, fieldSize); |
100 | 101 |
return layer; |
101 | 102 |
|
102 |
} else |
|
103 |
if (channel instanceof FileOutputChannel) {
|
|
104 |
FlyrVectIVectorLayer layer = new FlyrVectIVectorLayer();
|
|
105 |
String fileName =
|
|
106 |
((FileOutputChannel) channel).getFilename();
|
|
107 |
layer.create(sName, fileName, iShapeType, types, sFields,
|
|
108 |
crs, fieldSize);
|
|
109 |
return layer;
|
|
110 |
}
|
|
103 |
} else if (channel instanceof FileOutputChannel) {
|
|
104 |
FlyrVectIVectorLayer layer = new FlyrVectIVectorLayer();
|
|
105 |
String fileName = ((FileOutputChannel) channel).getFilename();
|
|
106 |
layer.create(sName, fileName, iShapeType, types, sFields, crs,
|
|
107 |
fieldSize);
|
|
108 |
return layer;
|
|
109 |
} else if (channel instanceof NullOutputChannel) {
|
|
110 |
return null;
|
|
111 |
} |
|
111 | 112 |
} |
112 | 113 |
|
113 |
|
|
114 | 114 |
throw new UnsupportedOutputChannelException(); |
115 | 115 |
} |
116 | 116 |
|
... | ... | |
131 | 131 |
} |
132 | 132 |
|
133 | 133 |
} |
134 |
|
|
134 |
|
|
135 | 135 |
public IRasterLayer getNewEmptyRORasterLayer(final String sName, |
136 | 136 |
final int iDataType, final AnalysisExtent extent, final int iBands, |
137 | 137 |
final IOutputChannel channel, final Object crs) |
... | ... | |
211 | 211 |
public Object getDefaultCRS() { |
212 | 212 |
//Uses the active view |
213 | 213 |
IWindow window = PluginServices.getMDIManager().getActiveWindow(); |
214 |
|
|
214 |
|
|
215 | 215 |
//If there is not active view then it looks for a view |
216 | 216 |
if(window == null || !(window instanceof AbstractViewPanel)) { |
217 | 217 |
IWindow[] windowList = PluginServices.getMDIManager().getAllWindows(); |
... | ... | |
222 | 222 |
} |
223 | 223 |
} |
224 | 224 |
} |
225 |
|
|
225 |
|
|
226 | 226 |
if(window != null && window instanceof AbstractViewPanel) { |
227 | 227 |
return ((AbstractViewPanel)window).getMapControl().getProjection(); |
228 | 228 |
} else { |
Also available in: Unified diff