Revision 27277
branches/v2_0_0_prep/extensions/extGeocoding/src/org/gvsig/geocoding/gui/newpattern/SimpleRangePanel.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2008 Prodevelop S.L. main developer |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.geocoding.gui.newpattern; |
|
29 |
|
|
30 |
import java.util.List; |
|
31 |
|
|
32 |
import javax.swing.DefaultComboBoxModel; |
|
33 |
import javax.swing.JComboBox; |
|
34 |
import javax.swing.JLabel; |
|
35 |
import javax.swing.JPanel; |
|
36 |
|
|
37 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
38 |
import org.gvsig.geocoding.extension.GeocoController; |
|
39 |
|
|
40 |
/** |
|
41 |
* Simple Range panel |
|
42 |
* |
|
43 |
* @author <a href="mailto:jsanz@prodevelop.es"> Jorge Gaspar Sanz Salinas</a> |
|
44 |
* @author <a href="mailto:vsanjaime@prodevelop.es"> Vicente Sanjaime Calvet</a> |
|
45 |
*/ |
|
46 |
public class SimpleRangePanel extends JPanel { |
|
47 |
|
|
48 |
private static final long serialVersionUID = 1L; |
|
49 |
|
|
50 |
private JComboBox jComboFromNum; |
|
51 |
private JComboBox jComboToNum; |
|
52 |
private JLabel jLabFromNum; |
|
53 |
private JLabel jLabToNum; |
|
54 |
|
|
55 |
/** |
|
56 |
* Constructor |
|
57 |
*/ |
|
58 |
public SimpleRangePanel(GeocoController control, |
|
59 |
List<FeatureAttributeDescriptor> fields) { |
|
60 |
initComponents(); |
|
61 |
// Fill two combos with the fields of datasource |
|
62 |
if (fields != null) { |
|
63 |
fillCombos(fields); |
|
64 |
} |
|
65 |
|
|
66 |
} |
|
67 |
|
|
68 |
/** |
|
69 |
* Initialize panel components |
|
70 |
*/ |
|
71 |
private void initComponents() { |
|
72 |
java.awt.GridBagConstraints gridBagConstraints; |
|
73 |
|
|
74 |
jLabFromNum = new javax.swing.JLabel(); |
|
75 |
jComboFromNum = new javax.swing.JComboBox(); |
|
76 |
jLabToNum = new javax.swing.JLabel(); |
|
77 |
jComboToNum = new javax.swing.JComboBox(); |
|
78 |
|
|
79 |
setMinimumSize(new java.awt.Dimension(500, 40)); |
|
80 |
setPreferredSize(new java.awt.Dimension(500, 40)); |
|
81 |
setLayout(new java.awt.GridBagLayout()); |
|
82 |
|
|
83 |
jLabFromNum.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); |
|
84 |
jLabFromNum.setText("FromNumber"); |
|
85 |
jLabFromNum.setFocusable(false); |
|
86 |
jLabFromNum.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); |
|
87 |
jLabFromNum.setMinimumSize(new java.awt.Dimension(70, 14)); |
|
88 |
jLabFromNum.setPreferredSize(new java.awt.Dimension(70, 14)); |
|
89 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
90 |
gridBagConstraints.gridx = 0; |
|
91 |
gridBagConstraints.gridy = 0; |
|
92 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
93 |
gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0); |
|
94 |
add(jLabFromNum, gridBagConstraints); |
|
95 |
|
|
96 |
jComboFromNum.setModel(new javax.swing.DefaultComboBoxModel( |
|
97 |
new String[] { "" })); |
|
98 |
jComboFromNum.setMinimumSize(new java.awt.Dimension(150, 20)); |
|
99 |
jComboFromNum.setOpaque(false); |
|
100 |
jComboFromNum.setPreferredSize(new java.awt.Dimension(150, 20)); |
|
101 |
jComboFromNum.addActionListener(new java.awt.event.ActionListener() { |
|
102 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
|
103 |
evFromNum(evt); |
|
104 |
} |
|
105 |
}); |
|
106 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
107 |
gridBagConstraints.gridx = 1; |
|
108 |
gridBagConstraints.gridy = 0; |
|
109 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
110 |
gridBagConstraints.weightx = 1.0; |
|
111 |
gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 15); |
|
112 |
add(jComboFromNum, gridBagConstraints); |
|
113 |
|
|
114 |
jLabToNum.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); |
|
115 |
jLabToNum.setText("ToNumber"); |
|
116 |
jLabToNum.setFocusable(false); |
|
117 |
jLabToNum.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); |
|
118 |
jLabToNum.setMinimumSize(new java.awt.Dimension(70, 14)); |
|
119 |
jLabToNum.setPreferredSize(new java.awt.Dimension(70, 14)); |
|
120 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
121 |
gridBagConstraints.gridx = 2; |
|
122 |
gridBagConstraints.gridy = 0; |
|
123 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
124 |
add(jLabToNum, gridBagConstraints); |
|
125 |
|
|
126 |
jComboToNum.setModel(new javax.swing.DefaultComboBoxModel( |
|
127 |
new String[] { "" })); |
|
128 |
jComboToNum.setMinimumSize(new java.awt.Dimension(150, 20)); |
|
129 |
jComboToNum.setPreferredSize(new java.awt.Dimension(150, 20)); |
|
130 |
jComboToNum.addActionListener(new java.awt.event.ActionListener() { |
|
131 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
|
132 |
evToNum(evt); |
|
133 |
} |
|
134 |
}); |
|
135 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
136 |
gridBagConstraints.gridx = 3; |
|
137 |
gridBagConstraints.gridy = 0; |
|
138 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
139 |
gridBagConstraints.weightx = 1.0; |
|
140 |
gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 5); |
|
141 |
add(jComboToNum, gridBagConstraints); |
|
142 |
} |
|
143 |
|
|
144 |
/** |
|
145 |
* Change value of FromNum |
|
146 |
* |
|
147 |
* @param evt |
|
148 |
*/ |
|
149 |
private void evFromNum(java.awt.event.ActionEvent evt) { |
|
150 |
// TODO add your handling code here: |
|
151 |
} |
|
152 |
|
|
153 |
/** |
|
154 |
* Change Value of ToNum |
|
155 |
* |
|
156 |
* @param evt |
|
157 |
*/ |
|
158 |
private void evToNum(java.awt.event.ActionEvent evt) { |
|
159 |
// TODO add your handling code here: |
|
160 |
} |
|
161 |
|
|
162 |
/** |
|
163 |
* Fill panel combos |
|
164 |
* |
|
165 |
* @param fields |
|
166 |
*/ |
|
167 |
private void fillCombos(List<FeatureAttributeDescriptor> fields) { |
|
168 |
if (fields != null) { |
|
169 |
DefaultComboBoxModel model = new DefaultComboBoxModel(); |
|
170 |
for (FeatureAttributeDescriptor field : fields) { |
|
171 |
ComboDesc desc = new ComboDesc(field); |
|
172 |
model.addElement(desc); |
|
173 |
} |
|
174 |
jComboFromNum.setModel(model); |
|
175 |
DefaultComboBoxModel model2 = new DefaultComboBoxModel(); |
|
176 |
for (FeatureAttributeDescriptor field2 : fields) { |
|
177 |
ComboDesc desc2 = new ComboDesc(field2); |
|
178 |
model2.addElement(desc2); |
|
179 |
} |
|
180 |
jComboToNum.setModel(model2); |
|
181 |
} |
|
182 |
} |
|
183 |
|
|
184 |
/** |
|
185 |
* Get description FromMun Combo |
|
186 |
* |
|
187 |
* @return |
|
188 |
*/ |
|
189 |
public FeatureAttributeDescriptor getDescriptorFronMun() { |
|
190 |
|
|
191 |
return (FeatureAttributeDescriptor) jComboFromNum.getSelectedItem(); |
|
192 |
} |
|
193 |
|
|
194 |
/** |
|
195 |
* Get description ToMun Combo |
|
196 |
* |
|
197 |
* @return |
|
198 |
*/ |
|
199 |
public FeatureAttributeDescriptor getDescriptorToMun() { |
|
200 |
|
|
201 |
return (FeatureAttributeDescriptor) jComboToNum.getSelectedItem(); |
|
202 |
} |
|
203 |
|
|
204 |
/** |
|
205 |
* |
|
206 |
* @param desc |
|
207 |
*/ |
|
208 |
public void setComboValues(List<FeatureAttributeDescriptor> desc) { |
|
209 |
fillCombos(desc); |
|
210 |
this.validate(); |
|
211 |
} |
|
212 |
|
|
213 |
} |
branches/v2_0_0_prep/extensions/extGeocoding/src/org/gvsig/geocoding/gui/newpattern/DoubleRangePanel.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2008 Prodevelop S.L. main developer |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.geocoding.gui.newpattern; |
|
29 |
|
|
30 |
import java.util.List; |
|
31 |
|
|
32 |
import javax.swing.DefaultComboBoxModel; |
|
33 |
import javax.swing.JComboBox; |
|
34 |
import javax.swing.JLabel; |
|
35 |
import javax.swing.JPanel; |
|
36 |
|
|
37 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
38 |
import org.gvsig.geocoding.extension.GeocoController; |
|
39 |
|
|
40 |
/** |
|
41 |
* Double Range panel |
|
42 |
* |
|
43 |
* @author <a href="mailto:jsanz@prodevelop.es"> Jorge Gaspar Sanz Salinas</a> |
|
44 |
* @author <a href="mailto:vsanjaime@prodevelop.es"> Vicente Sanjaime Calvet</a> |
|
45 |
*/ |
|
46 |
public class DoubleRangePanel extends JPanel { |
|
47 |
|
|
48 |
private static final long serialVersionUID = 1L; |
|
49 |
|
|
50 |
private JComboBox jComboLeftFromNum; |
|
51 |
private JComboBox jComboLeftToNum; |
|
52 |
private JComboBox jComboRightFromNum; |
|
53 |
private JComboBox jComboRightToNum; |
|
54 |
private JLabel jLabLeftFromNum; |
|
55 |
private JLabel jLabLeftToNum; |
|
56 |
private JLabel jLabRightFromNum; |
|
57 |
private JLabel jLabRightToNum; |
|
58 |
private JPanel jPanRight; |
|
59 |
private JPanel jPanLeft; |
|
60 |
|
|
61 |
/** |
|
62 |
* Constructor |
|
63 |
*/ |
|
64 |
public DoubleRangePanel(GeocoController control, |
|
65 |
List<FeatureAttributeDescriptor> fields) { |
|
66 |
initComponents(); |
|
67 |
// fill Combos |
|
68 |
if (fields != null) { |
|
69 |
fillCombos(fields); |
|
70 |
} |
|
71 |
} |
|
72 |
|
|
73 |
/** |
|
74 |
* Initialize panel components |
|
75 |
*/ |
|
76 |
private void initComponents() { |
|
77 |
java.awt.GridBagConstraints gridBagConstraints; |
|
78 |
|
|
79 |
jPanLeft = new JPanel(); |
|
80 |
jLabLeftFromNum = new JLabel(); |
|
81 |
jComboLeftFromNum = new JComboBox(); |
|
82 |
jLabLeftToNum = new JLabel(); |
|
83 |
jComboLeftToNum = new JComboBox(); |
|
84 |
jPanRight = new JPanel(); |
|
85 |
jLabRightFromNum = new JLabel(); |
|
86 |
jComboRightFromNum = new JComboBox(); |
|
87 |
jLabRightToNum = new JLabel(); |
|
88 |
jComboRightToNum = new JComboBox(); |
|
89 |
|
|
90 |
setMinimumSize(new java.awt.Dimension(500, 65)); |
|
91 |
setPreferredSize(new java.awt.Dimension(500, 65)); |
|
92 |
setLayout(new java.awt.GridBagLayout()); |
|
93 |
|
|
94 |
jPanLeft.setLayout(new java.awt.GridBagLayout()); |
|
95 |
|
|
96 |
jLabLeftFromNum |
|
97 |
.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); |
|
98 |
jLabLeftFromNum.setText("LeftFromNum"); |
|
99 |
jLabLeftFromNum.setMaximumSize(new java.awt.Dimension(200, 14)); |
|
100 |
jLabLeftFromNum.setMinimumSize(new java.awt.Dimension(70, 14)); |
|
101 |
jLabLeftFromNum.setPreferredSize(new java.awt.Dimension(70, 14)); |
|
102 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
103 |
gridBagConstraints.gridx = 0; |
|
104 |
gridBagConstraints.gridy = 0; |
|
105 |
gridBagConstraints.insets = new java.awt.Insets(0, 0, 3, 5); |
|
106 |
jPanLeft.add(jLabLeftFromNum, gridBagConstraints); |
|
107 |
|
|
108 |
jComboLeftFromNum.setModel(new javax.swing.DefaultComboBoxModel( |
|
109 |
new String[] { "" })); |
|
110 |
jComboLeftFromNum.setMinimumSize(new java.awt.Dimension(150, 20)); |
|
111 |
jComboLeftFromNum.setPreferredSize(new java.awt.Dimension(150, 20)); |
|
112 |
jComboLeftFromNum |
|
113 |
.addActionListener(new java.awt.event.ActionListener() { |
|
114 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
|
115 |
evLeftFromNum(evt); |
|
116 |
} |
|
117 |
}); |
|
118 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
119 |
gridBagConstraints.gridx = 1; |
|
120 |
gridBagConstraints.gridy = 0; |
|
121 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
122 |
gridBagConstraints.weightx = 1.0; |
|
123 |
gridBagConstraints.insets = new java.awt.Insets(0, 0, 3, 0); |
|
124 |
jPanLeft.add(jComboLeftFromNum, gridBagConstraints); |
|
125 |
|
|
126 |
jLabLeftToNum.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); |
|
127 |
jLabLeftToNum.setText("LeftToNum"); |
|
128 |
jLabLeftToNum |
|
129 |
.setMaximumSize(new java.awt.Dimension(1000000000, 1400000)); |
|
130 |
jLabLeftToNum.setMinimumSize(new java.awt.Dimension(70, 14)); |
|
131 |
jLabLeftToNum.setPreferredSize(new java.awt.Dimension(70, 14)); |
|
132 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
133 |
gridBagConstraints.gridx = 0; |
|
134 |
gridBagConstraints.gridy = 1; |
|
135 |
gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5); |
|
136 |
jPanLeft.add(jLabLeftToNum, gridBagConstraints); |
|
137 |
|
|
138 |
jComboLeftToNum.setModel(new javax.swing.DefaultComboBoxModel( |
|
139 |
new String[] { "" })); |
|
140 |
jComboLeftToNum.setMinimumSize(new java.awt.Dimension(150, 20)); |
|
141 |
jComboLeftToNum.setPreferredSize(new java.awt.Dimension(150, 20)); |
|
142 |
jComboLeftToNum.addActionListener(new java.awt.event.ActionListener() { |
|
143 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
|
144 |
evLeftToNum(evt); |
|
145 |
} |
|
146 |
}); |
|
147 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
148 |
gridBagConstraints.gridx = 1; |
|
149 |
gridBagConstraints.gridy = 1; |
|
150 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
151 |
gridBagConstraints.weightx = 1.0; |
|
152 |
jPanLeft.add(jComboLeftToNum, gridBagConstraints); |
|
153 |
|
|
154 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
155 |
gridBagConstraints.gridx = 0; |
|
156 |
gridBagConstraints.gridy = 0; |
|
157 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
158 |
gridBagConstraints.weightx = 1.0; |
|
159 |
gridBagConstraints.insets = new java.awt.Insets(2, 5, 2, 5); |
|
160 |
add(jPanLeft, gridBagConstraints); |
|
161 |
|
|
162 |
jPanRight.setLayout(new java.awt.GridBagLayout()); |
|
163 |
|
|
164 |
jLabRightFromNum |
|
165 |
.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); |
|
166 |
jLabRightFromNum.setText("RightFromNum"); |
|
167 |
jLabRightFromNum |
|
168 |
.setMaximumSize(new java.awt.Dimension(3400000, 140000)); |
|
169 |
jLabRightFromNum.setMinimumSize(new java.awt.Dimension(70, 14)); |
|
170 |
jLabRightFromNum.setPreferredSize(new java.awt.Dimension(70, 14)); |
|
171 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
172 |
gridBagConstraints.gridx = 2; |
|
173 |
gridBagConstraints.gridy = 0; |
|
174 |
gridBagConstraints.insets = new java.awt.Insets(0, 0, 3, 5); |
|
175 |
jPanRight.add(jLabRightFromNum, gridBagConstraints); |
|
176 |
|
|
177 |
jComboRightFromNum.setModel(new javax.swing.DefaultComboBoxModel( |
|
178 |
new String[] { "" })); |
|
179 |
jComboRightFromNum.setMinimumSize(new java.awt.Dimension(150, 20)); |
|
180 |
jComboRightFromNum.setPreferredSize(new java.awt.Dimension(150, 20)); |
|
181 |
jComboRightFromNum |
|
182 |
.addActionListener(new java.awt.event.ActionListener() { |
|
183 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
|
184 |
evRightFromNum(evt); |
|
185 |
} |
|
186 |
}); |
|
187 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
188 |
gridBagConstraints.gridx = 3; |
|
189 |
gridBagConstraints.gridy = 0; |
|
190 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
191 |
gridBagConstraints.weightx = 1.0; |
|
192 |
gridBagConstraints.insets = new java.awt.Insets(0, 0, 3, 0); |
|
193 |
jPanRight.add(jComboRightFromNum, gridBagConstraints); |
|
194 |
|
|
195 |
jLabRightToNum.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); |
|
196 |
jLabRightToNum.setText("RightToNum"); |
|
197 |
jLabRightToNum |
|
198 |
.setMaximumSize(new java.awt.Dimension(3400000, 140000000)); |
|
199 |
jLabRightToNum.setMinimumSize(new java.awt.Dimension(70, 14)); |
|
200 |
jLabRightToNum.setPreferredSize(new java.awt.Dimension(70, 14)); |
|
201 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
202 |
gridBagConstraints.gridx = 2; |
|
203 |
gridBagConstraints.gridy = 1; |
|
204 |
gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5); |
|
205 |
jPanRight.add(jLabRightToNum, gridBagConstraints); |
|
206 |
|
|
207 |
jComboRightToNum.setModel(new javax.swing.DefaultComboBoxModel( |
|
208 |
new String[] { "" })); |
|
209 |
jComboRightToNum.setMinimumSize(new java.awt.Dimension(150, 20)); |
|
210 |
jComboRightToNum.setPreferredSize(new java.awt.Dimension(150, 20)); |
|
211 |
jComboRightToNum.addActionListener(new java.awt.event.ActionListener() { |
|
212 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
|
213 |
evRightToNum(evt); |
|
214 |
} |
|
215 |
}); |
|
216 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
217 |
gridBagConstraints.gridx = 3; |
|
218 |
gridBagConstraints.gridy = 1; |
|
219 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
220 |
gridBagConstraints.weightx = 1.0; |
|
221 |
jPanRight.add(jComboRightToNum, gridBagConstraints); |
|
222 |
|
|
223 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
224 |
gridBagConstraints.gridx = 1; |
|
225 |
gridBagConstraints.gridy = 0; |
|
226 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
227 |
gridBagConstraints.weightx = 1.0; |
|
228 |
gridBagConstraints.insets = new java.awt.Insets(2, 5, 2, 5); |
|
229 |
add(jPanRight, gridBagConstraints); |
|
230 |
} |
|
231 |
|
|
232 |
/** |
|
233 |
* Change value of LeftFromNum |
|
234 |
* |
|
235 |
* @param evt |
|
236 |
*/ |
|
237 |
private void evLeftFromNum(java.awt.event.ActionEvent evt) { |
|
238 |
// TODO add your handling code here: |
|
239 |
} |
|
240 |
|
|
241 |
/** |
|
242 |
* Change value of LeftToNum |
|
243 |
* |
|
244 |
* @param evt |
|
245 |
*/ |
|
246 |
private void evLeftToNum(java.awt.event.ActionEvent evt) { |
|
247 |
// TODO add your handling code here: |
|
248 |
} |
|
249 |
|
|
250 |
/** |
|
251 |
* Change value of RightFromNum |
|
252 |
* |
|
253 |
* @param evt |
|
254 |
*/ |
|
255 |
private void evRightFromNum(java.awt.event.ActionEvent evt) { |
|
256 |
// TODO add your handling code here: |
|
257 |
} |
|
258 |
|
|
259 |
/** |
|
260 |
* Change value of RightToNum |
|
261 |
* |
|
262 |
* @param evt |
|
263 |
*/ |
|
264 |
private void evRightToNum(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_evRightToNum |
|
265 |
// TODO add your handling code here: |
|
266 |
} |
|
267 |
|
|
268 |
/** |
|
269 |
* Fill panel combos |
|
270 |
* |
|
271 |
* @param fields |
|
272 |
*/ |
|
273 |
private void fillCombos(List<FeatureAttributeDescriptor> fields) { |
|
274 |
|
|
275 |
if (fields != null) { |
|
276 |
DefaultComboBoxModel model = new DefaultComboBoxModel(); |
|
277 |
for (FeatureAttributeDescriptor field : fields) { |
|
278 |
ComboDesc desc = new ComboDesc(field); |
|
279 |
model.addElement(desc); |
|
280 |
} |
|
281 |
jComboRightFromNum.setModel(model); |
|
282 |
|
|
283 |
DefaultComboBoxModel model2 = new DefaultComboBoxModel(); |
|
284 |
for (FeatureAttributeDescriptor field2 : fields) { |
|
285 |
ComboDesc desc2 = new ComboDesc(field2); |
|
286 |
model2.addElement(desc2); |
|
287 |
} |
|
288 |
jComboRightToNum.setModel(model2); |
|
289 |
|
|
290 |
DefaultComboBoxModel model3 = new DefaultComboBoxModel(); |
|
291 |
for (FeatureAttributeDescriptor field3 : fields) { |
|
292 |
ComboDesc desc3 = new ComboDesc(field3); |
|
293 |
model3.addElement(desc3); |
|
294 |
} |
|
295 |
jComboLeftFromNum.setModel(model3); |
|
296 |
|
|
297 |
DefaultComboBoxModel model4 = new DefaultComboBoxModel(); |
|
298 |
for (FeatureAttributeDescriptor field4 : fields) { |
|
299 |
ComboDesc desc4 = new ComboDesc(field4); |
|
300 |
model4.addElement(desc4); |
|
301 |
} |
|
302 |
jComboLeftToNum.setModel(model4); |
|
303 |
} |
|
304 |
} |
|
305 |
|
|
306 |
/** |
|
307 |
* Get description RightFromMun Combo |
|
308 |
* |
|
309 |
* @return |
|
310 |
*/ |
|
311 |
public FeatureAttributeDescriptor getDescriptorRightFronMun() { |
|
312 |
|
|
313 |
return (FeatureAttributeDescriptor) jComboRightFromNum |
|
314 |
.getSelectedItem(); |
|
315 |
} |
|
316 |
|
|
317 |
/** |
|
318 |
* Get description RightToMun Combo |
|
319 |
* |
|
320 |
* @return |
|
321 |
*/ |
|
322 |
public FeatureAttributeDescriptor getDescriptorRightToMun() { |
|
323 |
|
|
324 |
return (FeatureAttributeDescriptor) jComboRightToNum.getSelectedItem(); |
|
325 |
} |
|
326 |
|
|
327 |
/** |
|
328 |
* Get description LeftFromMun Combo |
|
329 |
* |
|
330 |
* @return |
|
331 |
*/ |
|
332 |
public FeatureAttributeDescriptor getDescriptorLeftFronMun() { |
|
333 |
|
|
334 |
return (FeatureAttributeDescriptor) jComboLeftFromNum.getSelectedItem(); |
|
335 |
} |
|
336 |
|
|
337 |
/** |
|
338 |
* Get description LeftToMun Combo |
|
339 |
* |
|
340 |
* @return |
|
341 |
*/ |
|
342 |
public FeatureAttributeDescriptor getDescriptorLeftToMun() { |
|
343 |
|
|
344 |
return (FeatureAttributeDescriptor) jComboLeftToNum.getSelectedItem(); |
|
345 |
} |
|
346 |
|
|
347 |
/** |
|
348 |
* |
|
349 |
* @param desc |
|
350 |
*/ |
|
351 |
public void setComboValues(List<FeatureAttributeDescriptor> desc) { |
|
352 |
fillCombos(desc); |
|
353 |
this.validate(); |
|
354 |
} |
|
355 |
} |
branches/v2_0_0_prep/extensions/extGeocoding/src/org/gvsig/geocoding/gui/newpattern/ComboLayer.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2008 Prodevelop S.L. main developer |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.geocoding.gui.newpattern; |
|
29 |
|
|
30 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
31 |
import org.gvsig.geocoding.gui.styles.ComboName; |
|
32 |
|
|
33 |
/** |
|
34 |
* |
|
35 |
* |
|
36 |
* @author <a href="mailto:jsanz@prodevelop.es"> Jorge Gaspar Sanz Salinas</a> |
|
37 |
* @author <a href="mailto:vsanjaime@prodevelop.es"> Vicente Sanjaime Calvet</a> |
|
38 |
*/ |
|
39 |
public class ComboLayer implements ComboName { |
|
40 |
|
|
41 |
|
|
42 |
private FLyrVect lyr = null; |
|
43 |
|
|
44 |
/** |
|
45 |
* Constructor |
|
46 |
* @param lyr |
|
47 |
*/ |
|
48 |
public ComboLayer(FLyrVect lyr){ |
|
49 |
this.lyr = lyr; |
|
50 |
} |
|
51 |
|
|
52 |
/** |
|
53 |
* to String |
|
54 |
* @return layer name |
|
55 |
*/ |
|
56 |
public String toString(){ |
|
57 |
|
|
58 |
return lyr.getName(); |
|
59 |
} |
|
60 |
|
|
61 |
/** |
|
62 |
* get the layer stored |
|
63 |
* @return |
|
64 |
*/ |
|
65 |
public FLyrVect getLayer(){ |
|
66 |
return lyr; |
|
67 |
} |
|
68 |
|
|
69 |
} |
branches/v2_0_0_prep/extensions/extGeocoding/src/org/gvsig/geocoding/gui/newpattern/ComboDesc.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2008 Prodevelop S.L. main developer |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.geocoding.gui.newpattern; |
|
29 |
|
|
30 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
31 |
import org.gvsig.geocoding.gui.styles.ComboName; |
|
32 |
|
|
33 |
/** |
|
34 |
* |
|
35 |
* |
|
36 |
* @author <a href="mailto:jsanz@prodevelop.es"> Jorge Gaspar Sanz Salinas</a> |
|
37 |
* @author <a href="mailto:vsanjaime@prodevelop.es"> Vicente Sanjaime Calvet</a> |
|
38 |
*/ |
|
39 |
public class ComboDesc implements ComboName { |
|
40 |
|
|
41 |
private FeatureAttributeDescriptor desc = null; |
|
42 |
|
|
43 |
/** |
|
44 |
* Constructor |
|
45 |
* |
|
46 |
* @param lyr |
|
47 |
*/ |
|
48 |
public ComboDesc(FeatureAttributeDescriptor desc) { |
|
49 |
this.desc = desc; |
|
50 |
} |
|
51 |
|
|
52 |
/** |
|
53 |
* to String |
|
54 |
* |
|
55 |
* @return layer name |
|
56 |
*/ |
|
57 |
public String toString() { |
|
58 |
|
|
59 |
return desc.getName(); |
|
60 |
} |
|
61 |
|
|
62 |
/** |
|
63 |
* get the layer stored |
|
64 |
* |
|
65 |
* @return |
|
66 |
*/ |
|
67 |
public FeatureAttributeDescriptor getDescriptor() { |
|
68 |
return desc; |
|
69 |
} |
|
70 |
|
|
71 |
} |
Also available in: Unified diff