Revision 4937 trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/MyFinishAction.java
MyFinishAction.java | ||
---|---|---|
23 | 23 |
import com.iver.cit.gvsig.fmap.drivers.VectorialJDBCDriver; |
24 | 24 |
import com.iver.cit.gvsig.fmap.drivers.jdbc.postgis.PostGISWriter; |
25 | 25 |
import com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter; |
26 |
import com.iver.cit.gvsig.fmap.edition.writers.dxf.DxfWriter; |
|
26 | 27 |
import com.iver.cit.gvsig.fmap.edition.writers.shp.ShpWriter; |
27 | 28 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
28 | 29 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory; |
... | ... | |
30 | 31 |
import com.iver.cit.gvsig.gui.cad.panels.ChooseGeometryType; |
31 | 32 |
import com.iver.cit.gvsig.gui.cad.panels.JPanelFieldDefinition; |
32 | 33 |
import com.iver.cit.gvsig.gui.cad.panels.PostGISpanel; |
33 |
import com.iver.cit.gvsig.gui.cad.panels.ShpPanel;
|
|
34 |
import com.iver.cit.gvsig.gui.cad.panels.FileBasedPanel;
|
|
34 | 35 |
import com.iver.cit.gvsig.jdbc_spatial.gui.jdbcwizard.ConnectionSettings; |
35 | 36 |
|
36 | 37 |
public class MyFinishAction extends FinishAction |
... | ... | |
67 | 68 |
mapCtrl.getMapContext().beginAtomicEvent(); |
68 | 69 |
if (actionComand.equals("SHP")) |
69 | 70 |
{ |
70 |
ShpPanel shpPanel = (ShpPanel) myWizardComponents.getWizardPanel(2);
|
|
71 |
FileBasedPanel shpPanel = (FileBasedPanel) myWizardComponents.getWizardPanel(2);
|
|
71 | 72 |
File newFile = new File(shpPanel.getPath()); |
72 | 73 |
SHPLayerDefinition lyrDef = new SHPLayerDefinition(); |
73 | 74 |
lyrDef.setFieldsDesc(fieldsDesc); |
... | ... | |
85 | 86 |
(VectorialFileDriver) drv, newFile, mapCtrl.getProjection()); |
86 | 87 |
|
87 | 88 |
} |
89 |
else if (actionComand.equals("DXF")) |
|
90 |
{ |
|
91 |
FileBasedPanel shpPanel = (FileBasedPanel) myWizardComponents.getWizardPanel(2); |
|
92 |
File newFile = new File(shpPanel.getPath()); |
|
93 |
SHPLayerDefinition lyrDef = new SHPLayerDefinition(); |
|
94 |
lyrDef.setFieldsDesc(fieldsDesc); |
|
95 |
lyrDef.setFile(newFile); |
|
96 |
lyrDef.setName(layerName); |
|
97 |
lyrDef.setShapeType(geometryType); |
|
98 |
DxfWriter writer= (DxfWriter)LayerFactory.getWM().getWriter("DXF Writer"); |
|
99 |
writer.setFile(newFile); |
|
100 |
writer.initialize(lyrDef); |
|
101 |
writer.preProcess(); |
|
102 |
writer.postProcess(); |
|
103 |
|
|
104 |
|
|
105 |
lyr = (FLyrVect) LayerFactory.createLayer(layerName, |
|
106 |
(VectorialFileDriver) drv, newFile, mapCtrl.getProjection()); |
|
107 |
|
|
108 |
} |
|
88 | 109 |
else if (drv instanceof VectorialJDBCDriver) |
89 | 110 |
{ |
90 | 111 |
VectorialJDBCDriver dbDriver = (VectorialJDBCDriver) drv; |
Also available in: Unified diff