Revision 45634 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/gui/WizardPanel.java
WizardPanel.java | ||
---|---|---|
23 | 23 |
package org.gvsig.app.gui; |
24 | 24 |
|
25 | 25 |
import java.awt.Window; |
26 |
|
|
27 | 26 |
import javax.swing.JOptionPane; |
28 | 27 |
import javax.swing.JPanel; |
29 |
import javax.swing.SwingUtilities; |
|
30 |
|
|
31 | 28 |
import org.cresques.cts.IProjection; |
32 |
|
|
33 | 29 |
import org.gvsig.app.ApplicationLocator; |
34 | 30 |
import org.gvsig.app.ApplicationManager; |
35 | 31 |
import org.gvsig.app.gui.wizards.WizardListener; |
... | ... | |
40 | 36 |
import org.gvsig.fmap.dal.DataManager; |
41 | 37 |
import org.gvsig.fmap.dal.DataStore; |
42 | 38 |
import org.gvsig.fmap.dal.DataStoreParameters; |
39 |
import org.gvsig.fmap.dal.DataTypes; |
|
43 | 40 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters; |
44 | 41 |
import org.gvsig.fmap.mapcontext.MapContext; |
45 | 42 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
46 | 43 |
import org.gvsig.fmap.mapcontext.MapContextManager; |
47 | 44 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
48 |
import org.gvsig.fmap.mapcontext.layers.operations.SingleLayer; |
|
49 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
50 | 45 |
import org.gvsig.fmap.mapcontrol.MapControl; |
51 | 46 |
import org.gvsig.fmap.mapcontrol.MapControlCreationException; |
52 | 47 |
import org.gvsig.fmap.mapcontrol.MapControlLocator; |
53 | 48 |
import org.gvsig.tools.ToolsLocator; |
54 | 49 |
import org.gvsig.tools.dispose.DisposeUtils; |
50 |
import org.gvsig.tools.dynobject.DynField; |
|
55 | 51 |
import org.gvsig.tools.i18n.I18nManager; |
56 | 52 |
import org.gvsig.tools.identitymanagement.UnauthorizedException; |
57 | 53 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
58 | 54 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
59 |
|
|
60 | 55 |
import org.slf4j.Logger; |
61 | 56 |
import org.slf4j.LoggerFactory; |
62 | 57 |
|
... | ... | |
327 | 322 |
return true; |
328 | 323 |
} |
329 | 324 |
|
325 |
protected void fixCRS(DataStoreParameters params) { |
|
326 |
IProjection proj = this.getMapCtrl().getProjection(); |
|
327 |
|
|
328 |
// Buscamos por el parametro de la proyeccion |
|
329 |
// que sean obligatorios y est?n a null |
|
330 |
// y le ponemos la proyeccion de la vista |
|
331 |
DynField[] fields = params.getDynClass().getDynFields(); |
|
332 |
int crsfields = 0; |
|
333 |
DynField crsfield = null; |
|
334 |
for (DynField field : fields) { |
|
335 |
if (field.getType() == DataTypes.CRS) { |
|
336 |
crsfields++; |
|
337 |
crsfield = field; |
|
338 |
if (field.isMandatory()) { |
|
339 |
if (params.getDynValue(field.getName()) == null) { |
|
340 |
params.setDynValue(field.getName(), proj); |
|
341 |
} |
|
342 |
} |
|
343 |
} |
|
344 |
} |
|
345 |
if (crsfields == 1 && crsfield != null) { |
|
346 |
// Si solo hay un parametro CRS y esta a null, aunque no sea |
|
347 |
// obligatorio le asigna el CRS de la vista. |
|
348 |
if (params.getDynValue(crsfield.getName()) == null) { |
|
349 |
params.setDynValue(crsfield.getName(), proj); |
|
350 |
} |
|
351 |
} |
|
352 |
} |
|
353 |
|
|
330 | 354 |
} |
Also available in: Unified diff