Statistics
| Revision:

svn-gvsig-desktop / tags / v1_0_2_Build_898 / extensions / extWFS2 / src / com / iver / cit / gvsig / gui / panels / WFSAreaPanel.java @ 10513

History | View | Annotate | Download (4.03 KB)

1 8018 jorpiell
package com.iver.cit.gvsig.gui.panels;
2
3
import java.awt.event.ItemEvent;
4
import java.awt.event.ItemListener;
5
6
import javax.swing.JCheckBox;
7
import javax.swing.JPanel;
8
9
import com.iver.andami.PluginServices;
10
import com.iver.cit.gvsig.gui.wizards.WFSWizardData;
11
12
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
13
 *
14
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
15
 *
16
 * This program is free software; you can redistribute it and/or
17
 * modify it under the terms of the GNU General Public License
18
 * as published by the Free Software Foundation; either version 2
19
 * of the License, or (at your option) any later version.
20
 *
21
 * This program is distributed in the hope that it will be useful,
22
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
 * GNU General Public License for more details.
25
 *
26
 * You should have received a copy of the GNU General Public License
27
 * along with this program; if not, write to the Free Software
28
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
29
 *
30
 * For more information, contact:
31
 *
32
 *  Generalitat Valenciana
33
 *   Conselleria d'Infraestructures i Transport
34
 *   Av. Blasco Ib??ez, 50
35
 *   46010 VALENCIA
36
 *   SPAIN
37
 *
38
 *      +34 963862235
39
 *   gvsig@gva.es
40
 *      www.gvsig.gva.es
41
 *
42
 *    or
43
 *
44
 *   IVER T.I. S.A
45
 *   Salamanca 50
46
 *   46005 Valencia
47
 *   Spain
48
 *
49
 *   +34 963163400
50
 *   dac@iver.es
51
 */
52
/* CVS MESSAGES:
53
 *
54
 * $Id$
55
 * $Log$
56 8847 ppiqueras
 * Revision 1.1.2.2  2006-11-17 11:28:45  ppiqueras
57
 * Corregidos bugs y a?adida nueva funcionalidad.
58 8767 jjdelcerro
 *
59
 * Revision 1.1  2006/10/10 12:55:06  jorpiell
60 8018 jorpiell
 * Se ha a?adido el soporte de features complejas
61
 *
62
 *
63
 */
64
/**
65
 * @author Jorge Piera Llodr? (piera_jor@gva.es)
66
 */
67
public class WFSAreaPanel extends JPanel{
68
        private WFSWizardData data = null;
69
        private WFSParamsPanel parent = null;
70
        private JCheckBox checkBCoordinates = null;
71
        private JCheckBox checkBView = null;
72
73
        /**
74
         * This method initializes
75
         *
76
         */
77
        public WFSAreaPanel(WFSParamsPanel parent) {
78
                super();
79
                this.parent = parent;
80
                initialize();
81
        }
82
83
        /**
84
         * This method initializes this
85
         *
86
         */
87
        private void initialize() {
88
                this.setLayout(null);
89
                this.setBounds(5, 17, 464, 374);
90
                this.setBorder(javax.swing.BorderFactory.createTitledBorder(
91
                                null, PluginServices.getText(this, "select_area"),
92
                                javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
93
                                javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
94
                this.add(getCheckBCoordinates(), null);
95
                this.add(getCheckBView(), null);
96
        }
97
98
        /**
99
         * This method initializes CbCoordinates
100
         *
101
         * @return javax.swing.JCheckBox
102
         */
103
        private JCheckBox getCheckBCoordinates() {
104
                if (checkBCoordinates == null) {
105
                        checkBCoordinates = new JCheckBox();
106
                        checkBCoordinates.setBounds(new java.awt.Rectangle(6,19,445,20));
107
                        checkBCoordinates.setText(PluginServices.getText(this,"select_coordinates_manually"));
108
                        checkBCoordinates.addItemListener(new CheckBoxListener("manual"));
109
                }
110
                return checkBCoordinates;
111
        }
112
113
        /**
114
         * This method initializes checkBview
115
         *
116
         * @return javax.swing.JCheckBox
117
         */
118
        private JCheckBox getCheckBView() {
119
                if (checkBView == null) {
120
                        checkBView = new JCheckBox();
121
                        checkBView.setBounds(new java.awt.Rectangle(6,100,442,20));
122
                        checkBView.setText(PluginServices.getText(this,"select_coordinates_using_view"));
123
                        checkBView.addItemListener(new CheckBoxListener("view"));
124
                }
125
                return checkBView;
126
        }
127
128
        private class CheckBoxListener implements ItemListener{
129
                private String comboName = null;
130
131
                private CheckBoxListener(String comboName){
132
                        this.comboName = comboName;
133
                }
134
135
                /*
136
                 *  (non-Javadoc)
137
                 * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
138
                 */
139
                public void itemStateChanged(ItemEvent e) {
140
                        if (comboName.equals("manual")){
141
                                if (getCheckBCoordinates().isSelected()){
142
                                        getCheckBView().setSelected(false);
143
                                }
144
                        }else if(comboName.equals("view")){
145
                                if (getCheckBView().isSelected()){
146
                                        getCheckBCoordinates().setSelected(false);
147
                                }
148
                        }
149
150
                }
151
152
        }
153
154
155
}