Revision 17820
trunk/extensions/extRemoteSensing/src/org/gvsig/remotesensing/classification/gui/ClassificationPanel.java | ||
---|---|---|
77 | 77 |
import org.gvsig.raster.dataset.GeoRasterWriter; |
78 | 78 |
import org.gvsig.raster.dataset.IRasterDataSource; |
79 | 79 |
import org.gvsig.raster.grid.GridException; |
80 |
import org.gvsig.rastertools.PropertyEvent; |
|
81 |
import org.gvsig.rastertools.PropertyListener; |
|
80 | 82 |
import org.gvsig.rastertools.RasterModule; |
81 | 83 |
import org.gvsig.rastertools.roi.ui.ROIsTablePanel; |
82 | 84 |
import org.gvsig.remotesensing.classification.ClassificationGeneralProcess; |
... | ... | |
105 | 107 |
* @author Diego Guerrero Sevilla (diego.guerrero@uclm.es) |
106 | 108 |
* @version 19/10/2007 |
107 | 109 |
*/ |
108 |
public class ClassificationPanel extends DefaultButtonsPanel implements IWindow, IWindowListener, |
|
110 |
public class ClassificationPanel extends DefaultButtonsPanel implements PropertyListener, IWindow, IWindowListener,
|
|
109 | 111 |
ButtonsPanelListener,ActionListener,FocusListener{ |
110 | 112 |
|
111 | 113 |
private static final long serialVersionUID = 1L; |
... | ... | |
300 | 302 |
* @return javax.swing.JTextField |
301 | 303 |
*/ |
302 | 304 |
public JTextField getJTextNombreCapa() { |
303 |
if (jTextNombreCapa==null){ |
|
305 |
if (jTextNombreCapa==null) {
|
|
304 | 306 |
jTextNombreCapa=new JTextField(10); |
305 |
jTextNombreCapa.setText("NewLayer_" + RasterModule.layerCount); |
|
306 |
RasterModule.layerCount++; |
|
307 |
jTextNombreCapa.setText(RasterModule.getOnlyLayerName()); |
|
307 | 308 |
jTextNombreCapa.addFocusListener(this); |
308 |
} |
|
309 |
RasterModule.addOnlyLayerNameListener(this); |
|
310 |
} |
|
309 | 311 |
return jTextNombreCapa; |
310 | 312 |
} |
311 | 313 |
|
... | ... | |
314 | 316 |
* Especificar el nombre de la nueva capa para el recuadro de texto asign?ndo |
315 | 317 |
* en cada llamada un nombre consecutivo. |
316 | 318 |
*/ |
317 |
public void setNewLayerText() { |
|
318 |
getJTextNombreCapa().setText("NewLayer_" + RasterModule.layerCount); |
|
319 |
RasterModule.layerCount++; |
|
320 |
} |
|
319 |
public void updateNewLayerText() { |
|
320 |
getJTextNombreCapa().setText(RasterModule.getOnlyLayerName()); |
|
321 |
} |
|
321 | 322 |
|
322 | 323 |
/** |
323 | 324 |
* @return JRadioButton de generar fichero |
... | ... | |
364 | 365 |
*/ |
365 | 366 |
public void close(){ |
366 | 367 |
try { |
368 |
RasterModule.removeOnlyLayerNameListener(this); |
|
367 | 369 |
PluginServices.getMDIManager().closeWindow(this); |
368 | 370 |
} catch (ArrayIndexOutOfBoundsException ex) { |
369 | 371 |
// Si la ventana no se puede eliminar no hacemos nada |
... | ... | |
422 | 424 |
FileOpenWizard.setLastPath(chooser.getSelectedFile().getPath().substring(0, chooser.getSelectedFile().getPath().lastIndexOf(File.separator))); |
423 | 425 |
path = fName; |
424 | 426 |
} else { |
425 |
path = Utilities.createTempDirectory() + File.separator +getJTextNombreCapa().getText() + ".tif"; |
|
426 |
setNewLayerText(); |
|
427 |
String file = getJTextNombreCapa().getText(); |
|
428 |
if(file.compareTo(RasterModule.getOnlyLayerName()) == 0) |
|
429 |
RasterModule.usesOnlyLayerName(); |
|
430 |
|
|
431 |
path = Utilities.createTempDirectory() + File.separator + file + ".tif"; |
|
432 |
updateNewLayerText(); |
|
427 | 433 |
} |
428 | 434 |
|
429 | 435 |
return path; |
... | ... | |
680 | 686 |
|
681 | 687 |
} |
682 | 688 |
|
683 |
public void windowActivated() {} |
|
689 |
public void windowActivated() {} |
|
690 |
|
|
691 |
public void actionValueChanged(PropertyEvent e) { |
|
692 |
updateNewLayerText(); |
|
693 |
} |
|
684 | 694 |
} |
685 | 695 |
|
686 | 696 |
/** |
Also available in: Unified diff