Revision 9188

View differences:

trunk/extensions/extWFS2/src/com/iver/cit/gvsig/gui/wizards/WFSWizard.java
1 1
package com.iver.cit.gvsig.gui.wizards;
2 2

  
3
import java.awt.Component;
4 3
import java.awt.FlowLayout;
4
import java.awt.event.ComponentAdapter;
5
import java.awt.event.ComponentEvent;
6
import java.awt.event.KeyAdapter;
7
import java.awt.event.KeyEvent;
5 8
import java.awt.geom.Rectangle2D;
6 9
import java.net.MalformedURLException;
7 10
import java.net.URL;
......
11 14
import org.gvsig.gui.beans.swing.JButton;
12 15
import javax.swing.JCheckBox;
13 16
import javax.swing.JLabel;
14
import javax.swing.JOptionPane;
15 17
import javax.swing.JPanel;
16 18

  
17
import org.apache.log4j.Logger;
18
import org.cresques.cts.IProjection;
19
import org.cresques.cts.ProjectionPool;
20

  
21 19
import com.iver.andami.PluginServices;
22 20
import com.iver.andami.persistence.serverData.ServerDataPersistence;
23
import com.iver.cit.gvsig.fmap.crs.CRSFactory;
24 21
import com.iver.cit.gvsig.fmap.drivers.wfs.FMapWFSDriver;
25 22
import com.iver.cit.gvsig.fmap.layers.FLayer;
26
import com.iver.cit.gvsig.fmap.layers.FLyrWFS;
27 23
import com.iver.cit.gvsig.fmap.layers.FLyrWFSFactory;
28 24
import com.iver.cit.gvsig.gui.WizardPanel;
29 25
import com.iver.cit.gvsig.gui.panels.WFSParamsPanel;
30
import com.iver.cit.gvsig.project.documents.view.gui.View;
31 26
import com.iver.utiles.NotExistInXMLEntity;
32 27
import com.iver.utiles.XMLEntity;
33 28
import com.iver.utiles.swing.jcomboServer.JComboServer;
......
77 72
 *
78 73
 * $Id$
79 74
 * $Log$
80
 * Revision 1.19  2006-10-31 09:38:15  jorpiell
75
 * Revision 1.20  2006-12-05 09:22:59  ppiqueras
76
 * Que con la tecla "Enter" permita hacer lo mismo que pulsando con el ratón sobre los botones "Conectar", "Siguiente" y "Anterior" en WFS.
77
 *
78
 * Revision 1.19  2006/10/31 09:38:15  jorpiell
81 79
 * Se ha creado una factoria para crear la capa. De ese modo no se repite c?digo desde le panel de propiedades y desde el panel de la capa
82 80
 *
83 81
 * Revision 1.18  2006/10/27 06:44:56  jorpiell
......
318 316
			}
319 317

  
320 318
			cmbHost.setServerList(servers);
319
			
320
			// Allows that user can start the connection to the written server pressing the 'Enter' key
321
			cmbHost.getEditor().getEditorComponent().addKeyListener(new KeyAdapter() {
322
				/*
323
				 * (non-Javadoc)
324
				 * @see java.awt.event.KeyAdapter#keyReleased(java.awt.event.KeyEvent)
325
				 */
326
				public void keyReleased(KeyEvent e) {
327
					if (e.getKeyCode() == KeyEvent.VK_ENTER) {
328
						rellenarControles();
329
						getBtnSiguiente().requestFocus(); // Sets focus to the 'next' button
330
					}
331
				}
332
			});
321 333
		}
322 334
		return cmbHost;
323 335
	}
......
336 348
			btnConnect.setText(PluginServices.getText(this, "connect"));
337 349
			btnConnect.addActionListener(new java.awt.event.ActionListener() {
338 350
				public void actionPerformed(java.awt.event.ActionEvent e) {
351
					btnConnect.setEnabled(false); // This avoids multiple contiguous actions 
339 352
					rellenarControles();
353
					btnConnect.setEnabled(true); // This avoids multiple contiguous actions
340 354
				}
341 355
			});
356
			
357
			// If user press the 'Enter' key -> advance
358
			btnConnect.addKeyListener(new KeyAdapter() {
359
				/*
360
				 *  (non-Javadoc)
361
				 * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
362
				 */
363
				public void keyReleased(KeyEvent e) {
364
					// TODO Auto-generated method stub
365
					if (e.getKeyCode() == KeyEvent.VK_ENTER) {
366
						btnConnect.doClick();
367
						getBtnSiguiente().requestFocus();
368
					}
369
				}		
370
			});
342 371
		}
343 372

  
344 373
		return btnConnect;
......
501 530
			btnSiguiente.setText(PluginServices.getText(this, "siguiente"));
502 531
			btnSiguiente.addActionListener(new java.awt.event.ActionListener() {
503 532
				public void actionPerformed(java.awt.event.ActionEvent e) {
533
					btnSiguiente.setEnabled(false); // This avoids multiple contiguous actions
504 534
					if (page > 0) {
505 535
						// si page es mayor que cero, vamos enfocando las
506 536
						// sucesivas SOLAPAS del wfsParamsPanel
......
512 542
					getPanelPage1().setVisible(false);
513 543
					getPanelPage2().setVisible(true);
514 544
					activarVisualizarBotones();
545
					btnSiguiente.setEnabled(true); // This avoids multiple contiguous actions
515 546
				}
516 547
			});
548
			
549
			// If user press the 'Enter' key -> advance
550
			btnSiguiente.addKeyListener(new KeyAdapter() {
551
				/*
552
				 *  (non-Javadoc)
553
				 * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
554
				 */
555
				public void keyReleased(KeyEvent e) {
556
					// TODO Auto-generated method stub
557
					if (e.getKeyCode() == KeyEvent.VK_ENTER) {
558
						btnSiguiente.doClick();				
559
					}
560
				}			
561
			});
562
			
517 563
		}
518 564
		return btnSiguiente;
519 565
	}
......
531 577
			btnAnterior.setPreferredSize(new java.awt.Dimension(100, 30));
532 578
			btnAnterior.addActionListener(new java.awt.event.ActionListener() {
533 579
				public void actionPerformed(java.awt.event.ActionEvent e) {
580
					btnAnterior.setEnabled(false); // This avoids multiple contiguous actions
534 581
					page --;
535 582
					if (page > 0) {
536 583
						// Tenemos que retroceder en el wfsParamsPanel
......
550 597
						connected = false;
551 598
					}
552 599
					listenerSupport.callStateChanged(wfsParamsPanel.isCorretlyConfigured());
600
					btnAnterior.setEnabled(true);
553 601
				}
554 602
			});
603
			
604
			// If user press the 'Enter' key -> backs down
605
			btnAnterior.addKeyListener(new KeyAdapter() {
606
				/*
607
				 *  (non-Javadoc)
608
				 * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
609
				 */
610
				public void keyReleased(KeyEvent e) {
611
					if (e.getKeyCode() == KeyEvent.VK_ENTER)
612
						btnAnterior.doClick();
613
				}				
614
			});
555 615
		}
556 616
		return btnAnterior;
557 617
	}
......
572 632
			jPanel1.setBounds(2, 5, 477, 85);
573 633
			jPanel1.add(getTxtHost(), null);
574 634
			jPanel1.add(getBtnConnect(), null);
575
			jPanel1.add(getChkCaching(), null);
635
			jPanel1.add(getChkCaching(), null);	
576 636
		}
577 637

  
578 638
		return jPanel1;
......
688 748
			});
689 749
			chkCaching.addActionListener(new java.awt.event.ActionListener() {
690 750
				public void actionPerformed(java.awt.event.ActionEvent e) {
751
					chkCaching.setEnabled(false); // This avoids multiple contiguous actions
691 752
					fPrefs.putBoolean("refresh_capabilities", chkCaching.isSelected());
753
					chkCaching.setEnabled(true); // This avoids multiple contiguous actions
692 754
				}
693 755
			});
694 756

  

Also available in: Unified diff