Revision 45634 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/fmap/dal/serverexplorer/filesystem/swing/FilesystemExplorerWizardPanel.java
FilesystemExplorerWizardPanel.java | ||
---|---|---|
146 | 146 |
String layerName; |
147 | 147 |
|
148 | 148 |
for (DataStoreParameters params : this.getParameters()) { |
149 |
IProjection proj = this.getMapCtrl().getProjection();
|
|
149 |
fixCRS(params);
|
|
150 | 150 |
|
151 |
// Buscamos por el parametro de la proyeccion |
|
152 |
// que sean obligatorios y est?n a null |
|
153 |
// y le ponemos la proyeccion de la vista |
|
154 |
DynField[] fields = params.getDynClass().getDynFields(); |
|
155 |
int crsfields = 0; |
|
156 |
DynField crsfield = null; |
|
157 |
for (DynField field : fields) { |
|
158 |
if (field.getType() == DataTypes.CRS ) { |
|
159 |
crsfields++; |
|
160 |
crsfield = field; |
|
161 |
if( field.isMandatory() ) { |
|
162 |
if (params.getDynValue(field.getName()) == null) { |
|
163 |
params.setDynValue(field.getName(), proj); |
|
164 |
} |
|
165 |
} |
|
166 |
} |
|
167 |
} |
|
168 |
if( crsfields == 1 && crsfield!=null ) { |
|
169 |
// Si solo hay un parametro CRS y esta a null, aunque no sea |
|
170 |
// obligatorio le asigna el CRS de la vista. |
|
171 |
if (params.getDynValue(crsfield.getName()) == null) { |
|
172 |
params.setDynValue(crsfield.getName(), proj); |
|
173 |
} |
|
174 |
} |
|
175 |
|
|
176 | 151 |
layerName = ((FilesystemStoreParameters) params).getFile().getName(); |
177 | 152 |
|
178 | 153 |
this.doAddLayer(layerName, params); |
Also available in: Unified diff