Revision 6107
trunk/extensions/extGeoProcessing/src/com/iver/cit/gvsig/geoprocess/core/gui/AbstractGeoprocessPanel.java | ||
---|---|---|
45 | 45 |
* |
46 | 46 |
* $Id$ |
47 | 47 |
* $Log$ |
48 |
* Revision 1.4 2006-06-08 18:22:02 azabala |
|
48 |
* Revision 1.5 2006-06-29 17:29:34 azabala |
|
49 |
* Added common functionality to all geoprocess panels (result layer dialog) |
|
50 |
* |
|
51 |
* Revision 1.4 2006/06/08 18:22:02 azabala |
|
49 | 52 |
* Arreglado pete cuando abr?amos un dialogo de geoprocessing habiendo agrupaciones en el TOC |
50 | 53 |
* |
51 | 54 |
* Revision 1.3 2006/06/02 18:21:28 azabala |
... | ... | |
82 | 85 |
*/ |
83 | 86 |
package com.iver.cit.gvsig.geoprocess.core.gui; |
84 | 87 |
|
88 |
import java.awt.Component; |
|
85 | 89 |
import java.io.File; |
86 | 90 |
import java.util.ArrayList; |
87 | 91 |
import java.util.Arrays; |
88 | 92 |
|
89 | 93 |
import javax.swing.JComboBox; |
94 |
import javax.swing.JFileChooser; |
|
90 | 95 |
import javax.swing.JOptionPane; |
91 | 96 |
import javax.swing.JPanel; |
97 |
import javax.swing.JTextField; |
|
92 | 98 |
|
93 | 99 |
import com.iver.andami.PluginServices; |
94 | 100 |
import com.iver.cit.gvsig.fmap.DriverException; |
... | ... | |
97 | 103 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
98 | 104 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
99 | 105 |
import com.iver.cit.gvsig.gui.thememanager.CreateSpatialIndexMonitorableTask; |
106 |
import com.iver.utiles.GenericFileFilter; |
|
100 | 107 |
import com.iver.utiles.swing.threads.IMonitorableTask; |
101 | 108 |
|
102 | 109 |
/** |
... | ... | |
255 | 262 |
} |
256 | 263 |
return false; |
257 | 264 |
} |
258 |
|
|
265 |
|
|
266 |
public void openResultFile() { |
|
267 |
JFileChooser jfc = new JFileChooser(); |
|
268 |
jfc.addChoosableFileFilter(new GenericFileFilter("shp", |
|
269 |
"Ficheros SHP")); |
|
270 |
if (jfc.showSaveDialog((Component) PluginServices.getMainFrame()) == |
|
271 |
JFileChooser.APPROVE_OPTION) { |
|
272 |
File file = jfc.getSelectedFile(); |
|
273 |
if (!(file.getPath().endsWith(".shp") || file.getPath().endsWith(".SHP"))){ |
|
274 |
file = new File(file.getPath()+".shp"); |
|
275 |
} |
|
276 |
}//if |
|
277 |
if (jfc.getSelectedFile()!=null) { |
|
278 |
getFileNameResultTextField().setText( |
|
279 |
jfc.getSelectedFile().getAbsolutePath()); |
|
280 |
} |
|
281 |
|
|
282 |
} |
|
283 |
|
|
284 |
//FIXME Estos dos metodos no deben ser abstractos, sino implementados |
|
285 |
//por el panel (en realidad, deber?an devolver IWriter |
|
286 |
|
|
287 |
public abstract JTextField getFileNameResultTextField(); |
|
288 |
|
|
289 |
public abstract File getOutputFile(); |
|
259 | 290 |
} |
260 | 291 |
|
261 | 292 |
|
Also available in: Unified diff