Revision 4911 trunk/extensions/extWFS2/src/com/iver/cit/gvsig/gui/panels/WFSParamsPanel.java

View differences:

WFSParamsPanel.java
63 63
 *
64 64
 * $Id$
65 65
 * $Log$
66
 * Revision 1.1  2006-04-19 12:50:16  jorpiell
66
 * Revision 1.2  2006-04-20 16:38:24  jorpiell
67
 * Ahora mismo ya se puede hacer un getCapabilities y un getDescribeType de la capa seleccionada para ver los atributos a dibujar. Queda implementar el panel de opciones y hacer el getFeature().
68
 *
69
 * Revision 1.1  2006/04/19 12:50:16  jorpiell
67 70
 * Primer commit de la aplicaci?n. Se puede hacer un getCapabilities y ver el mensaje de vienvenida del servidor
68 71
 *
69 72
 *
......
75 78
		
76 79
	private JTabbedPane jTabbedPane = null;  //  @jve:decl-index=0:visual-constraint="37,30"
77 80
	private WFSSelectFeaturePanel featurePanel = null;
81
	private WFSSelectFieldsPanel fieldsPanel = null;
82
	private WFSOptionsPanel optionsPanel = null;
78 83
	private WFSWizardData data;
79 84
	private WizardListenerSupport listenerSupport;
80 85
	public	static Preferences fPrefs = Preferences.userRoot().node( "gvsig.wcs-wizard" );
81
	private InfoPanel infoPanel;
86
	private WFSInfoPanel infoPanel;
87
	private int indInfo;
88
	private int indFeature;
89
	private int indFields;
90
	private int indOptions;
82 91

  
83 92
	/**
84 93
	 * This method initializes jTabbedPane	
......
149 158
			jTabbedPane = new JTabbedPane();
150 159
			jTabbedPane.setSize(476, 422);
151 160
			jTabbedPane.addTab(PluginServices.getText(this, "info"), null, getInfoPanel());
152
			jTabbedPane.addTab(PluginServices.getText(this, "feature"), null, getPanelCovertures(), null);
161
			jTabbedPane.addTab(PluginServices.getText(this, "feature"), null, getPanelFeatures(), null);
162
			jTabbedPane.addTab(PluginServices.getText(this, "fields"),null, getPanelFields(), null);
163
			indFields = jTabbedPane.getTabCount()-1;
164
			jTabbedPane.setEnabledAt(indFields, false);
165
			jTabbedPane.addTab(PluginServices.getText(this, "options"),null, getOptionsPanel(), null);
153 166
		}
154 167
		return jTabbedPane;
155 168
	}
156 169
	
157
	private InfoPanel getInfoPanel() {
170
	private WFSInfoPanel getInfoPanel() {
158 171
		if (infoPanel==null) {
159
			infoPanel = new InfoPanel();
172
			infoPanel = new WFSInfoPanel();
160 173
			infoPanel.addFocusListener(new FocusListener() {
161 174
				public void focusGained(java.awt.event.FocusEvent e) {
162
					refreshInfo();
175
//					refreshInfo();
163 176
				}
164 177

  
165 178
				public void focusLost(FocusEvent e) {
......
169 182
		}
170 183
		return infoPanel;
171 184
	}
172
	/**
173
	 * Fires a notification to this wizard listeners telling them if the
174
	 * configuration is fair enough to send a GetCoverage request.
175
	 * @param b
176
	 */
177
	private void fireWizardComplete(boolean b){
178
		listenerSupport.callStateChanged(b);
179
		callStateChanged(b);
180
	}
181

  
182
	/**
183
	 * Refreshes the info shown in the info tab.
184
	 */
185
	public void refreshInfo() {
186
		infoPanel.refresh(data);
187
		
188
	}
189 185
	
190 186
	/**
191 187
	 * 
192
	 * @return the features list
188
	 * @return the selected list
193 189
	 */
194
	private Object getLstFeatures() {
195
		return featurePanel.getLstSelectedLayers();
190
	private Object getSelectedFeature() {
191
		return featurePanel.getSelectedFeature();
196 192
	}	
197 193
	
198 194
	
199 195
	/**
200
	 * This method initializes panelCovertures	
196
	 * This method initializes panelFeatures	
201 197
	 * 	
202 198
	 * @return javax.swing.JPanel	
203 199
	 */    
204
	private JPanel getPanelCovertures() {
200
	private JPanel getPanelFeatures() {
205 201
		if (featurePanel == null) {
206
			featurePanel = new WFSSelectFeaturePanel();
202
			featurePanel = new WFSSelectFeaturePanel(this);
207 203
			featurePanel.setLayout(null);
208 204
		}
209 205
		return featurePanel;
210 206
	}
207
	
211 208
	/**
209
	 * This method initializes fieldsPanel	
210
	 * 	
211
	 * @return javax.swing.JPanel	
212
	 */    
213
	private JPanel getPanelFields(){
214
		if (fieldsPanel == null) {
215
			fieldsPanel = new WFSSelectFieldsPanel();
216
			fieldsPanel.setLayout(null);
217
		}
218
		return fieldsPanel;
219
	}
220
	
221
	
222
	
223
	/**
224
	 * This method initializes fieldsPanel	
225
	 * 	
226
	 * @return javax.swing.JPanel	
227
	 */    
228
	private JPanel getOptionsPanel(){
229
		if (optionsPanel == null) {
230
			optionsPanel = new WFSOptionsPanel();
231
			optionsPanel.setLayout(null);
232
		}
233
		return optionsPanel;
234
	}
235
	
236
	/**
212 237
	 * Verifies that the selected parameters are enough to request the coverage
213 238
	 * to the server.
214 239
	 * 
......
248 273
	}
249 274
	
250 275
	/**
251
	 * Refreshes the wizard components data each time a coverage is selected.
276
	 * Refreshes the wizard components data each time a feature
277
	 * is selected.
252 278
	 * 
253
	 * Actualiza los datos de los componentes del wizard cada vez que se selecciona
254
	 * una cobertura diferente.
279
	 * Actualiza los datos de los componentes del wizard cada vez 
280
	 * que se selecciona una feature diferente.
281
	 * 
282
	 * @param feature
283
	 * Selected feature
255 284
	 */
256
	public void refreshData(){
257
//		String coverageName = getCurrentCoverageName();
258
//		cleanupWizard();
259
//		if (coverageName != null){
260
//			WFSLayer lyr = data.getLayer(coverageName);
261
//			getTxtName().setText(lyr.getTitle());
262
//			
263
//			// CRS
264
//			getLstCRSs().clearSelection();
265
//			getLstCRSs().setListData(lyr.getSRSs().toArray());
266
//
267
//			// Formats
268
//			getLstFormats().clearSelection();
269
//			getLstFormats().setListData(lyr.getFormats().toArray());
270
//			
271
//			// InterpolationMethods
272
//			boolean b = lyr.getInterpolationMethods() != null;
273
//			cmbInterpolationMethods.removeAllItems();
274
//			if (b) {
275
//				ArrayList im = lyr.getInterpolationMethods();
276
//				for (int i = 0; i < im.size(); i++) 					
277
//					cmbInterpolationMethods.addItem(im.get(i));
278
//			}
279
//			getChkUseInterpolationMethod().setEnabled(b);
280
//			getCmbInterpolationMethods().setEnabled(b);
281
//			
282
//			// Time
283
//			getLstTimes().removeAll();
284
//			ArrayList list = lyr.getTimePositions();
285
//			b = !(list == null || list.isEmpty());
286
//			if (b) 
287
//				getLstTimes().setListData(list.toArray());
288
//			jTabbedPane.setEnabledAt(indTime, b);
289
//	
290
//			// Parameters
291
//			cmbParam.removeAllItems();
292
//			list = lyr.getParameterList();
293
//			b = !(list == null || list.isEmpty());
294
//			if (b) {
295
//				for (int i = 0; i < list.size(); i++) 
296
//					cmbParam.addItem(list.get(i));
297
//				getSingleParamValuesList().setListData(
298
//						((FMapWCSParameter) cmbParam.getSelectedItem()).getValueList().toArray()
299
//						);
300
//			}
301
//			jTabbedPane.setEnabledAt(indParameter, b);
302
//			fireWizardComplete(isCorretlyConfigured());
303
//		}		
285
	public void refreshData(WFSLayerNode feature){
286
		infoPanel.refresh(data,feature);
287
		feature = (WFSLayerNode)data.getFeatureInfo(feature.getName());
288
		fieldsPanel.setFields(feature);
289
		jTabbedPane.setEnabledAt(indFields,true);		
304 290
	}
305 291

  
306 292
	/**
......
312 298
	 */
313 299
	public void setWizardData(WFSWizardData data) {
314 300
		this.data = data;
315
		featurePanel.setFeatures(data);
316
		refreshInfo();
301
		featurePanel.setWizardData(data);
302
		infoPanel.refresh(data,null);
317 303
	}
318 304
	
319 305
	/**

Also available in: Unified diff