Revision 6501 trunk/extensions/extWFS2/src/com/iver/cit/gvsig/gui/panels/WFSSelectFeaturePanel.java

View differences:

WFSSelectFeaturePanel.java
55 55
 *
56 56
 * $Id$
57 57
 * $Log$
58
 * Revision 1.6  2006-06-21 12:35:45  jorpiell
58
 * Revision 1.7  2006-07-21 11:50:31  jaume
59
 * improved appearance
60
 *
61
 * Revision 1.6  2006/06/21 12:35:45  jorpiell
59 62
 * Se ha a?adido la ventana de propiedades. Esto implica a?adir listeners por todos los paneles. Adem?s no se muestra la geomatr?a en la lista de atributos y se muestran ?nicamnete los que se van a descargar
60 63
 *
61 64
 * Revision 1.5  2006/05/25 10:31:06  jorpiell
......
80 83
	private JScrollPane jScrollPane = null;
81 84
	private LayerTable lstFeatures = null;
82 85
	private JTextField txtName = null;
83
	private JCheckBox chkExtendedNames = null; 
86
	private JCheckBox chkExtendedNames = null;
84 87
	private WFSWizardData data = null;
85 88
	private WFSParamsPanel parent = null;
86 89
	private JPanel layerNamePanel = null;
87 90

  
88 91
	/**
89
	 * This method initializes 
90
	 * 
92
	 * This method initializes
93
	 *
91 94
	 */
92 95
	public WFSSelectFeaturePanel(WFSParamsPanel parent) {
93 96
		super();
......
97 100

  
98 101
	/**
99 102
	 * This method initializes this
100
	 * 
103
	 *
101 104
	 */
102 105
	private void initialize() {
103 106
		this.setLayout(null);
104
		this.setBounds(10, 5, 481, 427);		
107
		this.setBounds(10, 5, 481, 427);
105 108
		this.add(getFeaturesListPanel(), null);
106 109
		this.add(getChkExtendedNames(), null);
107 110
		this.add(getLayerNamePanel(), null);
108
			
111

  
109 112
	}
110 113

  
111 114
	/**
112
	 * This method initializes coveragesListPanel	
113
	 * 	
114
	 * @return javax.swing.JPanel	
115
	 * This method initializes coveragesListPanel
116
	 *
117
	 * @return javax.swing.JPanel
115 118
	 */
116 119
	private JPanel getFeaturesListPanel() {
117 120
		if (coveragesListPanel == null) {
118 121
			coveragesListPanel = new JPanel();
119 122
			coveragesListPanel.setLayout(null);
120
			coveragesListPanel.setLocation(new java.awt.Point(4,59));
121
			coveragesListPanel.setSize(new java.awt.Dimension(457,302));
123
			coveragesListPanel.setLocation(new java.awt.Point(7,57));
124
			coveragesListPanel.setSize(new java.awt.Dimension(482,302));
122 125
			coveragesListPanel.add(getJScrollPane(), null);
123 126
			coveragesListPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
124 127
					null, PluginServices.getText(this, "select_features"),
......
127 130
		}
128 131
		return coveragesListPanel;
129 132
	}
130
	
133

  
131 134
	/**
132
	 * This method initializes jScrollPane	
133
	 * 	
134
	 * @return javax.swing.JScrollPane	
135
	 */    
135
	 * This method initializes jScrollPane
136
	 *
137
	 * @return javax.swing.JScrollPane
138
	 */
136 139
	private JScrollPane getJScrollPane() {
137 140
		if (jScrollPane == null) {
138 141
			jScrollPane = new JScrollPane();
139
			jScrollPane.setBounds(6, 17, 446, 280);
142
			jScrollPane.setBounds(6, 17, 469, 280);
140 143
			jScrollPane.setViewportView(getLstFeatures());
141 144
		}
142 145
		return jScrollPane;
143 146
	}
144
	
147

  
145 148
	/**
146
	 * This method initializes jList1	
147
	 * 	
148
	 * @return javax.swing.JList	
149
	 */    
149
	 * This method initializes jList1
150
	 *
151
	 * @return javax.swing.JList
152
	 */
150 153
	public LayerTable getLstFeatures() {
151 154
		if (lstFeatures == null) {
152 155
			lstFeatures = new LayerTable();
153 156
			lstFeatures.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
154
			lstFeatures.getSelectionModel().addListSelectionListener(new ListSelectionListener() { 
155
				public void valueChanged(javax.swing.event.ListSelectionEvent e) {    
157
			lstFeatures.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
158
				public void valueChanged(javax.swing.event.ListSelectionEvent e) {
156 159
					refreshData();
157 160
				}
158 161
			});
159 162
		}
160 163
		return lstFeatures;
161 164
	}
162
	
165

  
163 166
	/**
164
	 * This method initializes jTextField	
165
	 * 	
166
	 * @return javax.swing.JTextField	
167
	 */    
167
	 * This method initializes jTextField
168
	 *
169
	 * @return javax.swing.JTextField
170
	 */
168 171
	public JTextField getTxtName() {
169 172
		if (txtName == null) {
170 173
			txtName = new JTextField();
171
			txtName.setBounds(10, 19, 437, 20);
174
			txtName.setBounds(6, 19, 469, 20);
172 175
			txtName.setText(PluginServices.getText(this, "WFSLayer"));
173
			txtName.addKeyListener(new java.awt.event.KeyAdapter() { 
174
				public void keyTyped(java.awt.event.KeyEvent e) {    
176
			txtName.addKeyListener(new java.awt.event.KeyAdapter() {
177
				public void keyTyped(java.awt.event.KeyEvent e) {
175 178
					parent.isApplicable(true);
176 179
				}
177 180
			});
......
179 182
		return txtName;
180 183
	}
181 184
	/**
182
	 * This method initializes chkExtendedNames	
183
	 * 	
184
	 * @return javax.swing.JCheckBox	
185
	 */    
185
	 * This method initializes chkExtendedNames
186
	 *
187
	 * @return javax.swing.JCheckBox
188
	 */
186 189
	private JCheckBox getChkExtendedNames() {
187 190
		if (chkExtendedNames == null) {
188 191
			chkExtendedNames = new JCheckBox();
189 192
			chkExtendedNames.setText(PluginServices.getText(this, "show_layer_names"));
190 193
			chkExtendedNames.setBounds(10, 368, 150, 20);
191
			chkExtendedNames.addItemListener(new java.awt.event.ItemListener() { 
194
			chkExtendedNames.addItemListener(new java.awt.event.ItemListener() {
192 195
				public void itemStateChanged(java.awt.event.ItemEvent e) {
193 196
					boolean b = chkExtendedNames.isSelected();
194 197
					getLstFeatures().setShowLayerNames(b);
195 198
					getLstFeatures().repaint();
196 199
				}
197 200
			});
198
			chkExtendedNames.addActionListener(new java.awt.event.ActionListener() { 
199
				public void actionPerformed(java.awt.event.ActionEvent e) {    
201
			chkExtendedNames.addActionListener(new java.awt.event.ActionListener() {
202
				public void actionPerformed(java.awt.event.ActionEvent e) {
200 203
//					fPrefs.putBoolean("show_layer_names", chkExtendedNames.isSelected());
201 204
				}
202
			});			
205
			});
203 206
//			chkExtendedNames.setSelected(fPrefs.getBoolean("show_layer_names", false));
204
			
207

  
205 208
		}
206 209
		return chkExtendedNames;
207 210
	}
208
	
211

  
209 212
	/**
210
	 * 
213
	 *
211 214
	 * @return The selected Feature
212 215
	 */
213 216
	public WFSLayerNode getSelectedFeature(){
214 217
		return (WFSLayerNode)getLstFeatures().getSelectedValue();
215 218
	}
216
	
219

  
217 220
	public void setSelectedFeature(WFSLayerNode layerNode){
218 221
		int index = -1;
219 222
		for (int i=0; i<getLstFeatures().getRowCount(); i++){
......
226 229
			getLstFeatures().changeSelection(index,0,false,false);
227 230
		}
228 231
	}
229
	
232

  
230 233
	/**
231 234
	 * Sets the object that holds the wizard data.
232
	 * 
235
	 *
233 236
	 * Establece el objeto que contiene los datos del wizard.
234
	 * 
237
	 *
235 238
	 * @param data
236 239
	 */
237 240
	public void setWizardData(WFSWizardData data) {
238 241
		this.data = data;
239 242
		refreshInfo();
240 243
	}
241
	
244

  
242 245
	/**
243 246
	 * Refresh the features list
244 247
	 *
......
246 249
	public void refreshInfo(){
247 250
		getLstFeatures().addFeatures(data.getFeatures());
248 251
	}
249
	
252

  
250 253
	/**
251 254
	 * Refreshes the wizard components data each time a feature
252
	 * is selected. The describeFeatureType operation must be 
253
	 * sent 
255
	 * is selected. The describeFeatureType operation must be
256
	 * sent
254 257
	 */
255 258
	public void refreshData(){
256 259
		WFSLayerNode lyr = (WFSLayerNode)getLstFeatures().getSelectedValue();
......
259 262
		}catch(NullPointerException e){
260 263
			getTxtName().setText(PluginServices.getText(this,"default_name"));
261 264
		}
262
		parent.refreshData(lyr);		
265
		parent.refreshData(lyr);
263 266
	}
264 267

  
265 268
	/**
266
	 * This method initializes layerNamePanel	
267
	 * 	
268
	 * @return javax.swing.JPanel	
269
	 * This method initializes layerNamePanel
270
	 *
271
	 * @return javax.swing.JPanel
269 272
	 */
270 273
	private JPanel getLayerNamePanel() {
271 274
		if (layerNamePanel == null) {
......
275 278
					null, PluginServices.getText(this, "layer_name"),
276 279
					javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
277 280
					javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
278
			layerNamePanel.setBounds(new java.awt.Rectangle(4, 8, 457, 49));
281
			layerNamePanel.setBounds(new java.awt.Rectangle(7, 4, 482, 49));
279 282
			layerNamePanel.add(getTxtName(), null);
280
			
283

  
281 284
		}
282 285
		return layerNamePanel;
283 286
	}
284
	
287

  
285 288
	/**
286
	 * 
289
	 *
287 290
	 * @return the layer name
288 291
	 */
289 292
	public String getLayerName(){
290 293
		return ((WFSLayerNode)getLstFeatures().getSelectedValue()).getName();
291 294
	}
292
	
295

  
293 296
	public WFSLayerNode getWFSLayerNode(){
294 297
		WFSLayerNode layerNode = (WFSLayerNode)getLstFeatures().getSelectedValue();
295 298
		return layerNode;
296 299
	}
297
	
300

  
298 301
	/**
299
	 * 
302
	 *
300 303
	 * @return the test that will be showed it the gvSIG
301 304
	 * toc
302 305
	 */
......
305 308
	}
306 309

  
307 310
	public void setLayerName(String name) {
308
		getTxtName().setText(name);		
311
		getTxtName().setText(name);
309 312
	}
310
	
311
	
312
	
313 313

  
314

  
315

  
316

  
314 317
}  //  @jve:decl-index=0:visual-constraint="10,16"

Also available in: Unified diff