root / tags / v1_0_2_Build_916 / extensions / extWMS / src / com / iver / cit / gvsig / gui / wizards / WMSWizard.java @ 12327
History | View | Annotate | Download (27.8 KB)
1 | 3746 | jaume | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
||
4 | *
|
||
5 | * This program is free software; you can redistribute it and/or
|
||
6 | * modify it under the terms of the GNU General Public License
|
||
7 | * as published by the Free Software Foundation; either version 2
|
||
8 | * of the License, or (at your option) any later version.
|
||
9 | *
|
||
10 | * This program is distributed in the hope that it will be useful,
|
||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
13 | * GNU General Public License for more details.
|
||
14 | *
|
||
15 | * You should have received a copy of the GNU General Public License
|
||
16 | * along with this program; if not, write to the Free Software
|
||
17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
||
18 | *
|
||
19 | * For more information, contact:
|
||
20 | *
|
||
21 | * Generalitat Valenciana
|
||
22 | * Conselleria d'Infraestructures i Transport
|
||
23 | * Av. Blasco Ib??ez, 50
|
||
24 | * 46010 VALENCIA
|
||
25 | * SPAIN
|
||
26 | *
|
||
27 | * +34 963862235
|
||
28 | * gvsig@gva.es
|
||
29 | * www.gvsig.gva.es
|
||
30 | *
|
||
31 | * or
|
||
32 | *
|
||
33 | * IVER T.I. S.A
|
||
34 | * Salamanca 50
|
||
35 | * 46005 Valencia
|
||
36 | * Spain
|
||
37 | *
|
||
38 | * +34 963163400
|
||
39 | * dac@iver.es
|
||
40 | */
|
||
41 | package com.iver.cit.gvsig.gui.wizards; |
||
42 | |||
43 | 4222 | jaume | import java.awt.Component; |
44 | import java.awt.Dimension; |
||
45 | 6122 | jaume | import java.awt.FlowLayout; |
46 | 3746 | jaume | import java.awt.geom.Rectangle2D; |
47 | import java.net.MalformedURLException; |
||
48 | import java.net.URL; |
||
49 | 4222 | jaume | import java.util.Hashtable; |
50 | 3746 | jaume | import java.util.Vector; |
51 | 4501 | jaume | import java.util.prefs.Preferences; |
52 | import javax.swing.DefaultComboBoxModel; |
||
53 | import javax.swing.JCheckBox; |
||
54 | 3746 | jaume | import javax.swing.JLabel; |
55 | 4222 | jaume | import javax.swing.JOptionPane; |
56 | 3746 | jaume | import javax.swing.JPanel; |
57 | import javax.swing.tree.TreePath; |
||
58 | import org.apache.log4j.Logger; |
||
59 | import com.iver.andami.PluginServices; |
||
60 | 4507 | jorpiell | import com.iver.andami.persistence.serverData.ServerDataPersistence; |
61 | 3746 | jaume | import com.iver.cit.gvsig.fmap.drivers.wms.FMapWMSDriver; |
62 | 4222 | jaume | import com.iver.cit.gvsig.fmap.exceptions.CannotReprojectException; |
63 | 3746 | jaume | import com.iver.cit.gvsig.fmap.layers.FLayer; |
64 | 4511 | ldiaz | import com.iver.cit.gvsig.fmap.layers.FLayers; |
65 | 3746 | jaume | import com.iver.cit.gvsig.fmap.layers.FLyrWMS; |
66 | 4511 | ldiaz | import com.iver.cit.gvsig.fmap.layers.WMSLayerNode; |
67 | 3746 | jaume | import com.iver.cit.gvsig.gui.WizardPanel; |
68 | 4511 | ldiaz | import com.iver.cit.gvsig.gui.panels.LayerTree; |
69 | 3746 | jaume | import com.iver.cit.gvsig.gui.panels.WMSParamsPanel; |
70 | 4501 | jaume | import com.iver.utiles.NotExistInXMLEntity; |
71 | import com.iver.utiles.XMLEntity; |
||
72 | 4507 | jorpiell | import com.iver.utiles.swing.jcomboServer.JComboServer; |
73 | import com.iver.utiles.swing.jcomboServer.ServerData; |
||
74 | 3746 | jaume | |
75 | |||
76 | /**
|
||
77 | 3850 | jaume | * The WMS properties container panel.
|
78 | 3746 | jaume | *
|
79 | 3850 | jaume | * @author Jaume Dominguez Faus
|
80 | 3746 | jaume | */
|
81 | public class WMSWizard extends WizardPanel { |
||
82 | private static Logger logger = Logger.getLogger(WMSWizard.class.getName()); |
||
83 | 4624 | ldiaz | protected int page; |
84 | protected boolean connected = false; |
||
85 | 4507 | jorpiell | private JComboServer cmbHost = null; |
86 | 6115 | jaume | private org.gvsig.gui.beans.swing.JButton btnConnect = null; |
87 | 3746 | jaume | private javax.swing.JPanel jPanel = null; |
88 | private javax.swing.JLabel jLabel1 = null; |
||
89 | private javax.swing.JLabel lblTitle = null; |
||
90 | private javax.swing.JScrollPane jScrollPane = null; |
||
91 | private javax.swing.JTextArea txtAbstract = null; |
||
92 | private javax.swing.JPanel panelPage1 = null; |
||
93 | 6115 | jaume | private org.gvsig.gui.beans.swing.JButton btnSiguiente = null; |
94 | private org.gvsig.gui.beans.swing.JButton btnAnterior = null; |
||
95 | 3746 | jaume | private javax.swing.JPanel jPanel1 = null; |
96 | 4624 | ldiaz | protected WizardListenerSupport listenerSupport = new WizardListenerSupport(); |
97 | protected WMSWizardData dataSource;
|
||
98 | protected WMSParamsPanel wmsParamsPanel = null; |
||
99 | protected JLabel lblServerType = null; |
||
100 | protected JLabel lblServerTypeValue = null; |
||
101 | 4501 | jaume | private JCheckBox chkCaching = null; |
102 | private static Preferences fPrefs = Preferences.userRoot().node( "gvsig.wms-wizard" ); |
||
103 | private boolean refreshing = fPrefs.getBoolean("refresh_capabilities", false); |
||
104 | 4624 | ldiaz | protected int firstPage; |
105 | 6122 | jaume | private JPanel pnlName = null; |
106 | 4507 | jorpiell | |
107 | public WMSWizard (WMSParamsPanel params){
|
||
108 | 6115 | jaume | |
109 | 4507 | jorpiell | super();
|
110 | firstPage = 1;
|
||
111 | page = firstPage; |
||
112 | 6115 | jaume | this.wmsParamsPanel = params;
|
113 | 4507 | jorpiell | this.dataSource = wmsParamsPanel.dataSource;
|
114 | |||
115 | 6115 | jaume | setTabName("WMS");
|
116 | 4383 | ldiaz | lblServerType = new JLabel(); |
117 | lblServerType.setBounds(20, 444, 100, 20); |
||
118 | lblServerType.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); |
||
119 | lblServerType.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); |
||
120 | lblServerType.setFont(new java.awt.Font("Arial", java.awt.Font.PLAIN, 11)); |
||
121 | lblServerType.setText(PluginServices.getText(this, "server_type")+":"); |
||
122 | lblServerTypeValue = new JLabel(); |
||
123 | lblServerTypeValue.setBounds(128, 444, 148, 20); |
||
124 | lblServerTypeValue.setFont(new java.awt.Font("Arial", java.awt.Font.BOLD, 11)); |
||
125 | lblServerTypeValue.setText("-");
|
||
126 | this.setSize(510, 468); |
||
127 | this.setLayout(null); |
||
128 | this.setPreferredSize(new java.awt.Dimension(750, 420)); |
||
129 | this.setVisible(true); |
||
130 | 4507 | jorpiell | |
131 | 4383 | ldiaz | wmsParamsPanel.setListenerSupport(this.listenerSupport);
|
132 | 6844 | ldiaz | wmsParamsPanel.setBounds(0, 5, 510, 428); |
133 | 4383 | ldiaz | wmsParamsPanel.getJTabbedPane().addMouseListener( |
134 | 4507 | jorpiell | new java.awt.event.MouseAdapter() {
|
135 | public void mouseClicked(java.awt.event.MouseEvent e) { |
||
136 | page = wmsParamsPanel.currentPage() + 1;
|
||
137 | activarVisualizarBotones(); |
||
138 | } |
||
139 | }); |
||
140 | 4383 | ldiaz | this.add(wmsParamsPanel, null); |
141 | this.add(lblServerType, null); |
||
142 | this.add(lblServerTypeValue, null); |
||
143 | 4360 | ldiaz | getPanelPage2().setVisible(true);
|
144 | 6844 | ldiaz | |
145 | 6115 | jaume | connected = true;
|
146 | 4507 | jorpiell | } |
147 | 6115 | jaume | |
148 | 3746 | jaume | /**
|
149 | 4513 | ldiaz | * This is the default constructor
|
150 | */
|
||
151 | public WMSWizard() {
|
||
152 | super();
|
||
153 | firstPage = 0;
|
||
154 | page = firstPage; |
||
155 | initialize(); |
||
156 | 6115 | jaume | } |
157 | 4513 | ldiaz | /**
|
158 | 3746 | jaume | * This method initializes this
|
159 | */
|
||
160 | 4501 | jaume | private void initialize() { |
161 | setTabName("WMS");
|
||
162 | 4507 | jorpiell | |
163 | 3746 | jaume | lblServerType = new JLabel(); |
164 | 3796 | jaume | lblServerType.setBounds(20, 444, 100, 20); |
165 | 3746 | jaume | lblServerType.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); |
166 | lblServerType.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); |
||
167 | lblServerType.setFont(new java.awt.Font("Arial", java.awt.Font.PLAIN, 11)); |
||
168 | 3796 | jaume | lblServerType.setText(PluginServices.getText(this, "server_type")+":"); |
169 | 3746 | jaume | lblServerTypeValue = new JLabel(); |
170 | lblServerTypeValue.setBounds(128, 444, 148, 20); |
||
171 | lblServerTypeValue.setFont(new java.awt.Font("Arial", java.awt.Font.BOLD, 11)); |
||
172 | lblServerTypeValue.setText("-");
|
||
173 | this.setSize(510, 468); |
||
174 | this.setLayout(null); |
||
175 | this.setPreferredSize(new java.awt.Dimension(750, 420)); |
||
176 | this.setVisible(true); |
||
177 | this.add(getPanelPage1(), null); |
||
178 | this.add(getPanelPage2(), null); |
||
179 | this.add(getBtnAnterior(), null); |
||
180 | this.add(getBtnSiguiente(), null); |
||
181 | this.add(lblServerType, null); |
||
182 | this.add(lblServerTypeValue, null); |
||
183 | activarVisualizarBotones(); |
||
184 | } |
||
185 | |||
186 | |||
187 | 4624 | ldiaz | protected JPanel getPanelPage2(){ |
188 | 3746 | jaume | if (wmsParamsPanel == null){ |
189 | wmsParamsPanel = new WMSParamsPanel();
|
||
190 | wmsParamsPanel.setListenerSupport(this.listenerSupport);
|
||
191 | 6500 | jaume | wmsParamsPanel.setBounds(0, 5, 510, 428); |
192 | 3746 | jaume | wmsParamsPanel.getJTabbedPane().addMouseListener( |
193 | 4507 | jorpiell | new java.awt.event.MouseAdapter() {
|
194 | public void mouseClicked(java.awt.event.MouseEvent e) { |
||
195 | page = wmsParamsPanel.currentPage() + 1;
|
||
196 | activarVisualizarBotones(); |
||
197 | } |
||
198 | }); |
||
199 | 3746 | jaume | } |
200 | return wmsParamsPanel;
|
||
201 | } |
||
202 | /**
|
||
203 | * DOCUMENT ME!
|
||
204 | *
|
||
205 | * @param host DOCUMENT ME!
|
||
206 | */
|
||
207 | private void addHost(String host) { |
||
208 | 4501 | jaume | host = host.trim(); |
209 | |||
210 | 4507 | jorpiell | ServerDataPersistence persistence = new ServerDataPersistence(this,ServerData.SERVER_TYPE_WMS); |
211 | persistence.addServerData(new ServerData(host, ServerData.SERVER_TYPE_WMS));
|
||
212 | 3746 | jaume | } |
213 | |||
214 | /**
|
||
215 | * DOCUMENT ME!
|
||
216 | */
|
||
217 | private void rellenarControles() { |
||
218 | try {
|
||
219 | String host = cmbHost.getModel().getSelectedItem().toString();
|
||
220 | 4507 | jorpiell | |
221 | dataSource.setHost(new URL(host), refreshing); |
||
222 | lblTitle.setText(dataSource.getTitle()); |
||
223 | 3746 | jaume | lblServerTypeValue.setText(dataSource.getServerType()); |
224 | 4507 | jorpiell | txtAbstract.setText(dataSource.getAbstract()); |
225 | |||
226 | 3746 | jaume | addHost(host); |
227 | wmsParamsPanel.setWizardData(dataSource); |
||
228 | 4501 | jaume | connected = true;
|
229 | 3746 | jaume | activarVisualizarBotones(); |
230 | } catch (Exception e) { |
||
231 | listenerSupport.callError(e); |
||
232 | e.printStackTrace(); |
||
233 | } |
||
234 | } |
||
235 | |||
236 | /**
|
||
237 | * DOCUMENT ME!
|
||
238 | */
|
||
239 | 4624 | ldiaz | protected void activarVisualizarBotones() { |
240 | 4511 | ldiaz | if (page == firstPage) {
|
241 | 3746 | jaume | getBtnAnterior().setEnabled(false);
|
242 | getBtnSiguiente().setVisible(true);
|
||
243 | |||
244 | 4501 | jaume | if (connected) {
|
245 | 3746 | jaume | getBtnSiguiente().setEnabled(true);
|
246 | } else {
|
||
247 | getBtnSiguiente().setEnabled(false);
|
||
248 | } |
||
249 | } else if (page < wmsParamsPanel.getNumTabs()) { |
||
250 | getBtnSiguiente().setEnabled(true);
|
||
251 | getBtnSiguiente().setVisible(true);
|
||
252 | getBtnAnterior().setEnabled(true);
|
||
253 | getBtnAnterior().setVisible(true);
|
||
254 | if (wmsParamsPanel.nextEnabledPage()==-1){ |
||
255 | 4507 | jorpiell | getBtnSiguiente().setEnabled(false);
|
256 | 3746 | jaume | } |
257 | listenerSupport.callStateChanged(wmsParamsPanel.isCorrectlyConfigured()); |
||
258 | } else if (page == wmsParamsPanel.getNumTabs()) { |
||
259 | getBtnSiguiente().setVisible(false);
|
||
260 | getBtnSiguiente().setEnabled(false);
|
||
261 | 6115 | jaume | listenerSupport.callStateChanged(wmsParamsPanel |
262 | 3746 | jaume | .isCorrectlyConfigured()); |
263 | } |
||
264 | } |
||
265 | |||
266 | /**
|
||
267 | * This method initializes txtHost
|
||
268 | *
|
||
269 | * @return javax.swing.JTextField
|
||
270 | */
|
||
271 | 4501 | jaume | private javax.swing.JComboBox getTxtHost() {
|
272 | 3746 | jaume | if (cmbHost == null) { |
273 | 4507 | jorpiell | cmbHost = new JComboServer();
|
274 | 4501 | jaume | cmbHost.setModel(new DefaultComboBoxModel()); |
275 | 3746 | jaume | cmbHost.setPreferredSize(new java.awt.Dimension(350, 20)); |
276 | cmbHost.setBounds(11, 26, 454, 20); |
||
277 | 6115 | jaume | cmbHost.setEditable(true);
|
278 | 3746 | jaume | |
279 | 4507 | jorpiell | ServerDataPersistence persistence = new ServerDataPersistence(this,ServerData.SERVER_TYPE_WMS); |
280 | ServerData[] servers = persistence.getArrayOfServerData();
|
||
281 | 4501 | jaume | |
282 | 4507 | jorpiell | if (servers.length == 0){ |
283 | 4509 | jorpiell | PluginServices ps = PluginServices.getPluginServices(this);
|
284 | XMLEntity xml = ps.getPersistentXML(); |
||
285 | 4507 | jorpiell | try {
|
286 | String[] oldServers = xml.getStringArrayProperty("wms-servers"); |
||
287 | servers = new ServerData[oldServers.length];
|
||
288 | for (int i=0; i<oldServers.length; i++) { |
||
289 | servers[i] = new ServerData(oldServers[i],ServerData.SERVER_TYPE_WMS);
|
||
290 | } |
||
291 | xml.remove("wms-servers");
|
||
292 | 4509 | jorpiell | ps.setPersistentXML(xml); |
293 | 4507 | jorpiell | } catch (NotExistInXMLEntity e) {
|
294 | 4601 | jaume | // Old servers doesn't exist
|
295 | servers = new ServerData[12]; |
||
296 | 4507 | jorpiell | servers[0] = new ServerData("http://www.idee.es/wms/IDEE-Base/IDEE-Base",ServerData.SERVER_TYPE_WMS); |
297 | servers[1] = new ServerData("http://wms.jpl.nasa.gov/wms.cgi",ServerData.SERVER_TYPE_WMS); |
||
298 | servers[2] = new ServerData("http://www2.dmsolutions.ca/cgi-bin/mswms_gmap?",ServerData.SERVER_TYPE_WMS); |
||
299 | servers[3] = new ServerData("http://orto.cth.gva.es/wmsconnector/com.esri.wms.Esrimap/wms_patricova",ServerData.SERVER_TYPE_WMS); |
||
300 | servers[4] = new ServerData("http://orto.cth.gva.es/wmsconnector/com.esri.wms.Esrimap/wms_parque_fondo_prug",ServerData.SERVER_TYPE_WMS); |
||
301 | servers[5] = new ServerData("http://orto.cth.gva.es/wmsconnector/com.esri.wms.Esrimap/wms_pgof",ServerData.SERVER_TYPE_WMS); |
||
302 | servers[6] = new ServerData("http://orto.cth.gva.es/wmsconnector/com.esri.wms.Esrimap/wms_urbanismo_tematicos",ServerData.SERVER_TYPE_WMS); |
||
303 | servers[7] = new ServerData("http://onearth.jpl.nasa.gov/wms.cgi",ServerData.SERVER_TYPE_WMS); |
||
304 | servers[8] = new ServerData("http://www.demis.nl/wms/wms.asp?WMS=WorldMap",ServerData.SERVER_TYPE_WMS); |
||
305 | servers[9] = new ServerData("http://aes.gsfc.nasa.gov/cgi-bin/wms",ServerData.SERVER_TYPE_WMS); |
||
306 | servers[10] = new ServerData("http://mapas.euitto.upm.es/cgi-bin/cnauticas",ServerData.SERVER_TYPE_WMS); |
||
307 | 4601 | jaume | servers[11] = new ServerData("http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx", ServerData.SERVER_TYPE_WMS); |
308 | 4507 | jorpiell | } |
309 | 4501 | jaume | |
310 | 4507 | jorpiell | for (int i=0 ; i<servers.length ; i++){ |
311 | 6115 | jaume | persistence.addServerData(servers[i]); |
312 | 4501 | jaume | } |
313 | 6115 | jaume | persistence.setPersistent(); |
314 | 4501 | jaume | } |
315 | 4507 | jorpiell | |
316 | cmbHost.setServerList(servers); |
||
317 | |||
318 | |||
319 | // XMLEntity xml = PluginServices.getPluginServices(this)
|
||
320 | // .getPersistentXML();
|
||
321 | // if (xml == null)
|
||
322 | // xml = new XMLEntity();
|
||
323 | |||
324 | // if (!xml.contains("wms-servers")) {
|
||
325 | // String[] servers = new String[11];
|
||
326 | // // Begining of rubbish code
|
||
327 | // //
|
||
328 | // // The following block should not exist and it only will live in the
|
||
329 | // // 0.6 version. It fixes an error that has been happening since the 0.4 version
|
||
330 | // // and recovers the user's server data from the wrong location that has been used to use.
|
||
331 | // // This code will be removed from the 0.7 version
|
||
332 | // boolean bool = false;
|
||
333 | // {
|
||
334 | // Class gvSIGClass = AddLayer.class; // for example... (we only need to use a class that has been loaded by gvSIG's class loader
|
||
335 | // XMLEntity xml2 = PluginServices.getPluginServices(PluginServices.getExtension(gvSIGClass)).getPersistentXML();
|
||
336 | // if (xml2.contains("wms-servers")) {
|
||
337 | // String oldServers[] = xml2.getStringArrayProperty("wms-servers");
|
||
338 | // servers = new String[servers.length+oldServers.length];
|
||
339 | // for (int i = 0; i < oldServers.length; i++) {
|
||
340 | // servers[oldServers.length+i] = oldServers[i];
|
||
341 | // }
|
||
342 | // xml2.remove("wms-servers");
|
||
343 | // bool = true;
|
||
344 | // }
|
||
345 | // }
|
||
346 | // if (!bool) {
|
||
347 | // // end of the rubbish code (don't forget to remove the closing bracket)
|
||
348 | |||
349 | // servers[0] = "http://www.idee.es/wms/IDEE-Base/IDEE-Base";
|
||
350 | // servers[1] = "http://wms.jpl.nasa.gov/wms.cgi";
|
||
351 | // servers[2] = "http://www2.dmsolutions.ca/cgi-bin/mswms_gmap?";
|
||
352 | // servers[3] = "http://demo.deegree.org:8080/deegree/wms";
|
||
353 | // servers[4] = "http://orto.cth.gva.es/wmsconnector/com.esri.wms.Esrimap/wms_patricova";
|
||
354 | // servers[5] = "http://orto.cth.gva.es/wmsconnector/com.esri.wms.Esrimap/wms_parque_fondo_prug";
|
||
355 | // servers[6] = "http://orto.cth.gva.es/wmsconnector/com.esri.wms.Esrimap/wms_pgof";
|
||
356 | // servers[7] = "http://orto.cth.gva.es/wmsconnector/com.esri.wms.Esrimap/wms_urbanismo_tematicos";
|
||
357 | // servers[8] = "http://onearth.jpl.nasa.gov/wms.cgi";
|
||
358 | // servers[9] = "http://www.demis.nl/wms/wms.asp?WMS=WorldMap";
|
||
359 | // servers[9] = "http://aes.gsfc.nasa.gov/cgi-bin/wms";
|
||
360 | // servers[10]= "http://mapas.euitto.upm.es/cgi-bin/cnauticas";
|
||
361 | |||
362 | // } // this bracket will be removed too in version <= 0.7
|
||
363 | // xml.putProperty("wms-servers", servers);
|
||
364 | 6115 | jaume | // }
|
365 | 4507 | jorpiell | // try {
|
366 | // String[] servers = xml.getStringArrayProperty("wms-servers");
|
||
367 | // for (int i = 0; i < servers.length; i++) {
|
||
368 | // ((DefaultComboBoxModel) cmbHost.getModel()).addElement(servers[i]);
|
||
369 | // }
|
||
370 | // } catch (NotExistInXMLEntity e) {
|
||
371 | // }
|
||
372 | 3746 | jaume | } |
373 | |||
374 | return cmbHost;
|
||
375 | 6115 | jaume | } |
376 | 3746 | jaume | |
377 | 4507 | jorpiell | |
378 | 3746 | jaume | /**
|
379 | * This method initializes btnDetalles
|
||
380 | *
|
||
381 | * @return javax.swing.JButton
|
||
382 | */
|
||
383 | private javax.swing.JButton getBtnConnect() {
|
||
384 | if (btnConnect == null) { |
||
385 | 6115 | jaume | btnConnect = new org.gvsig.gui.beans.swing.JButton();
|
386 | 3746 | jaume | btnConnect.setPreferredSize(new java.awt.Dimension(100, 20)); |
387 | btnConnect.setBounds(366, 50, 100, 20); |
||
388 | btnConnect.setText(PluginServices.getText(this, "conectar")); |
||
389 | btnConnect.addActionListener(new java.awt.event.ActionListener() {
|
||
390 | 4507 | jorpiell | public void actionPerformed(java.awt.event.ActionEvent e) { |
391 | rellenarControles(); |
||
392 | } |
||
393 | }); |
||
394 | 3746 | jaume | } |
395 | |||
396 | return btnConnect;
|
||
397 | } |
||
398 | |||
399 | /**
|
||
400 | * This method initializes jPanel
|
||
401 | *
|
||
402 | * @return javax.swing.JPanel
|
||
403 | */
|
||
404 | private javax.swing.JPanel getJPanel() {
|
||
405 | if (jPanel == null) { |
||
406 | jPanel = new javax.swing.JPanel();
|
||
407 | jPanel.setLayout(null);
|
||
408 | jPanel.setPreferredSize(new java.awt.Dimension(470, 130)); |
||
409 | jPanel.setBorder(javax.swing.BorderFactory.createTitledBorder( |
||
410 | 3774 | jaume | null, PluginServices.getText(this, "description"), |
411 | 3746 | jaume | javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
412 | javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); |
||
413 | jPanel.setBounds(2, 96, 477, 324); |
||
414 | 6122 | jaume | |
415 | 3746 | jaume | jPanel.add(getJScrollPane(), null);
|
416 | 6122 | jaume | jPanel.add(getPnlName(), null);
|
417 | 3746 | jaume | } |
418 | |||
419 | return jPanel;
|
||
420 | } |
||
421 | |||
422 | /**
|
||
423 | * This method initializes jLabel1
|
||
424 | *
|
||
425 | * @return javax.swing.JLabel
|
||
426 | */
|
||
427 | private javax.swing.JLabel getJLabel1() {
|
||
428 | if (jLabel1 == null) { |
||
429 | jLabel1 = new javax.swing.JLabel();
|
||
430 | 3796 | jaume | jLabel1.setText(PluginServices.getText(this, "name") + ":"); |
431 | 3746 | jaume | } |
432 | |||
433 | return jLabel1;
|
||
434 | } |
||
435 | |||
436 | /**
|
||
437 | * This method initializes lblTitle
|
||
438 | *
|
||
439 | * @return javax.swing.JLabel
|
||
440 | */
|
||
441 | private javax.swing.JLabel getLblTitle() {
|
||
442 | if (lblTitle == null) { |
||
443 | lblTitle = new javax.swing.JLabel();
|
||
444 | lblTitle.setText("-");
|
||
445 | } |
||
446 | |||
447 | return lblTitle;
|
||
448 | } |
||
449 | |||
450 | /**
|
||
451 | * This method initializes jScrollPane
|
||
452 | *
|
||
453 | * @return javax.swing.JScrollPane
|
||
454 | */
|
||
455 | private javax.swing.JScrollPane getJScrollPane() {
|
||
456 | if (jScrollPane == null) { |
||
457 | jScrollPane = new javax.swing.JScrollPane();
|
||
458 | jScrollPane.setViewportView(getTxtAbstract()); |
||
459 | jScrollPane.setPreferredSize(new java.awt.Dimension(450, 60)); |
||
460 | jScrollPane.setBounds(10, 47, 450, 267); |
||
461 | } |
||
462 | |||
463 | return jScrollPane;
|
||
464 | } |
||
465 | |||
466 | /**
|
||
467 | * This method initializes txtAbstract
|
||
468 | *
|
||
469 | * @return javax.swing.JTextArea
|
||
470 | */
|
||
471 | private javax.swing.JTextArea getTxtAbstract() {
|
||
472 | if (txtAbstract == null) { |
||
473 | txtAbstract = new javax.swing.JTextArea();
|
||
474 | txtAbstract.setWrapStyleWord(true);
|
||
475 | txtAbstract.setColumns(30);
|
||
476 | txtAbstract.setLineWrap(true);
|
||
477 | } |
||
478 | |||
479 | return txtAbstract;
|
||
480 | } |
||
481 | |||
482 | /**
|
||
483 | * This method initializes panelPage1
|
||
484 | *
|
||
485 | * @return javax.swing.JPanel
|
||
486 | */
|
||
487 | private javax.swing.JPanel getPanelPage1() {
|
||
488 | if (panelPage1 == null) { |
||
489 | panelPage1 = new javax.swing.JPanel();
|
||
490 | panelPage1.setLayout(null);
|
||
491 | panelPage1.setPreferredSize(new java.awt.Dimension(480, 220)); |
||
492 | panelPage1.setVisible(true);
|
||
493 | panelPage1.setBounds(15, 5, 480, 427); |
||
494 | panelPage1.add(getJPanel1(), null);
|
||
495 | panelPage1.add(getJPanel(), null);
|
||
496 | } |
||
497 | |||
498 | return panelPage1;
|
||
499 | } |
||
500 | |||
501 | /**
|
||
502 | * This method initializes btnSiguiente
|
||
503 | *
|
||
504 | * @return javax.swing.JButton
|
||
505 | */
|
||
506 | private javax.swing.JButton getBtnSiguiente() {
|
||
507 | if (btnSiguiente == null) { |
||
508 | 6115 | jaume | btnSiguiente = new org.gvsig.gui.beans.swing.JButton();
|
509 | 3746 | jaume | btnSiguiente.setPreferredSize(new java.awt.Dimension(100, 30)); |
510 | btnSiguiente.setBounds(395, 444, 100, 20); |
||
511 | btnSiguiente.setText(PluginServices.getText(this, "siguiente")); |
||
512 | btnSiguiente.addActionListener(new java.awt.event.ActionListener() {
|
||
513 | 4507 | jorpiell | public void actionPerformed(java.awt.event.ActionEvent e) { |
514 | 4511 | ldiaz | if (page > firstPage) {
|
515 | 4507 | jorpiell | // si page es mayor que cero, vamos enfocando las
|
516 | // sucesivas SOLAPAS del WCSParamsPanel
|
||
517 | wmsParamsPanel.avanzaTab(); |
||
518 | page = wmsParamsPanel.currentPage(); |
||
519 | 3746 | jaume | } |
520 | 4507 | jorpiell | page++; |
521 | getPanelPage1().setVisible(false);
|
||
522 | getPanelPage2().setVisible(true);
|
||
523 | activarVisualizarBotones(); |
||
524 | } |
||
525 | }); |
||
526 | 3746 | jaume | } |
527 | return btnSiguiente;
|
||
528 | } |
||
529 | |||
530 | /**
|
||
531 | * This method initializes btnAnterior
|
||
532 | *
|
||
533 | * @return javax.swing.JButton
|
||
534 | */
|
||
535 | private javax.swing.JButton getBtnAnterior() {
|
||
536 | if (btnAnterior == null) { |
||
537 | 6115 | jaume | btnAnterior = new org.gvsig.gui.beans.swing.JButton();
|
538 | btnAnterior.setBounds(292, 444, 100, 20); |
||
539 | 6122 | jaume | btnAnterior.setPreferredSize(new java.awt.Dimension(100, 30)); |
540 | 3746 | jaume | btnAnterior.setText(PluginServices.getText(this, "anterior")); |
541 | btnAnterior.addActionListener(new java.awt.event.ActionListener() {
|
||
542 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
543 | page --; |
||
544 | 4511 | ldiaz | if (page > firstPage) {
|
545 | 3746 | jaume | // Tenemos que retroceder en el wcsParamsPanel
|
546 | wmsParamsPanel.retrocedeTab(); |
||
547 | page = wmsParamsPanel.currentPage() + 1;
|
||
548 | activarVisualizarBotones(); |
||
549 | 4511 | ldiaz | } else if (page==firstPage){ |
550 | 3746 | jaume | activarVisualizarBotones(); |
551 | 4511 | ldiaz | page = firstPage +1;
|
552 | 3746 | jaume | //wmsParamsPanel.limpiaWizard();
|
553 | getLblTitle().setText("-");
|
||
554 | getTxtAbstract().setText("");
|
||
555 | wmsParamsPanel.retrocedeTab(); |
||
556 | getPanelPage1().setVisible(true);
|
||
557 | getPanelPage2().setVisible(false);
|
||
558 | getBtnSiguiente().setEnabled(false);
|
||
559 | 6115 | jaume | connected = false;
|
560 | 3746 | jaume | } |
561 | listenerSupport.callStateChanged(wmsParamsPanel.isCorrectlyConfigured()); |
||
562 | } |
||
563 | }); |
||
564 | } |
||
565 | |||
566 | return btnAnterior;
|
||
567 | } |
||
568 | |||
569 | /**
|
||
570 | * This method initializes jPanel1
|
||
571 | *
|
||
572 | * @return javax.swing.JPanel
|
||
573 | */
|
||
574 | private javax.swing.JPanel getJPanel1() {
|
||
575 | if (jPanel1 == null) { |
||
576 | jPanel1 = new javax.swing.JPanel();
|
||
577 | jPanel1.setLayout(null);
|
||
578 | jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder( |
||
579 | 3774 | jaume | null, PluginServices.getText(this, "server"), |
580 | 3746 | jaume | javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
581 | javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); |
||
582 | jPanel1.setBounds(2, 5, 477, 85); |
||
583 | jPanel1.add(getTxtHost(), null);
|
||
584 | jPanel1.add(getBtnConnect(), null);
|
||
585 | 4501 | jaume | jPanel1.add(getChkCaching(), null);
|
586 | 3746 | jaume | } |
587 | |||
588 | return jPanel1;
|
||
589 | } |
||
590 | |||
591 | /**
|
||
592 | * DOCUMENT ME!
|
||
593 | *
|
||
594 | * @param listener
|
||
595 | */
|
||
596 | public void addWizardListener(WizardListener listener) { |
||
597 | listenerSupport.addWizardListener(listener); |
||
598 | } |
||
599 | |||
600 | /**
|
||
601 | * DOCUMENT ME!
|
||
602 | *
|
||
603 | * @param listener
|
||
604 | */
|
||
605 | public void removeWizardListener(WizardListener listener) { |
||
606 | listenerSupport.removeWizardListener(listener); |
||
607 | } |
||
608 | |||
609 | /**
|
||
610 | * DOCUMENT ME!
|
||
611 | *
|
||
612 | * @return
|
||
613 | */
|
||
614 | // public WMSWizardDataSource getDataSource() {
|
||
615 | 4507 | jorpiell | // return dataSource;
|
616 | 3746 | jaume | // }
|
617 | |||
618 | /**
|
||
619 | * DOCUMENT ME!
|
||
620 | *
|
||
621 | * @param source
|
||
622 | */
|
||
623 | // public void setDataSource(WMSWizardDataSource source) {
|
||
624 | 4507 | jorpiell | // dataSource = source;
|
625 | 3746 | jaume | // }
|
626 | |||
627 | |||
628 | /**
|
||
629 | * DOCUMENT ME!
|
||
630 | *
|
||
631 | * @return DOCUMENT ME!
|
||
632 | */
|
||
633 | public String getSRS() { |
||
634 | return wmsParamsPanel.getSRS();
|
||
635 | } |
||
636 | |||
637 | /**
|
||
638 | * DOCUMENT ME!
|
||
639 | *
|
||
640 | * @return DOCUMENT ME!
|
||
641 | */
|
||
642 | public String getFormat() { |
||
643 | return wmsParamsPanel.getFormat();
|
||
644 | } |
||
645 | |||
646 | /**
|
||
647 | * DOCUMENT ME!
|
||
648 | *
|
||
649 | * @return DOCUMENT ME!
|
||
650 | */
|
||
651 | public TreePath[] getSelectedLayers() { |
||
652 | return wmsParamsPanel.getSelectedLayers();
|
||
653 | } |
||
654 | |||
655 | /**
|
||
656 | * DOCUMENT ME!
|
||
657 | *
|
||
658 | * @return DOCUMENT ME!
|
||
659 | */
|
||
660 | 4222 | jaume | public Rectangle2D getLayersRectangle() throws CannotReprojectException{ |
661 | 3746 | jaume | return wmsParamsPanel.getLayersRectangle();
|
662 | } |
||
663 | |||
664 | |||
665 | 4501 | jaume | |
666 | 3746 | jaume | /**
|
667 | 4222 | jaume | * Devuelve el host que est? escrito en el cuadro de texto del host o null
|
668 | * en caso de que no haya nada escrito o est? mal escrito
|
||
669 | 3746 | jaume | *
|
670 | * @return URL del host
|
||
671 | */
|
||
672 | public URL getHost() { |
||
673 | try {
|
||
674 | 4513 | ldiaz | if ((cmbHost == null)|| (cmbHost.getModel().getSelectedItem() == null)) |
675 | 6115 | jaume | return new URL(dataSource.getHost()); |
676 | 4513 | ldiaz | else
|
677 | return new URL(cmbHost.getModel().getSelectedItem().toString()); |
||
678 | 3746 | jaume | } catch (MalformedURLException e) { |
679 | return null; |
||
680 | } |
||
681 | } |
||
682 | |||
683 | /**
|
||
684 | * DOCUMENT ME!
|
||
685 | *
|
||
686 | * @return Nombre de la capa que aparece en el TOC.
|
||
687 | */
|
||
688 | public String getLayerName() { |
||
689 | return wmsParamsPanel.getLayerName();
|
||
690 | } |
||
691 | |||
692 | 4501 | jaume | |
693 | 3746 | jaume | public void initWizard() { |
694 | dataSource = new WMSWizardData();
|
||
695 | } |
||
696 | |||
697 | public void execute() { |
||
698 | 4507 | jorpiell | |
699 | 3746 | jaume | } |
700 | |||
701 | /**
|
||
702 | * DOCUMENT ME!
|
||
703 | *
|
||
704 | * @return DOCUMENT ME!
|
||
705 | */
|
||
706 | 4624 | ldiaz | protected String getLayersQuery() { |
707 | 3746 | jaume | return wmsParamsPanel.getLayersQuery();
|
708 | } |
||
709 | 4501 | jaume | |
710 | 6434 | ldiaz | //gets all the layers available in the WMS
|
711 | public FLayer getAllLayers(){
|
||
712 | return wmsParamsPanel.getAllLayers();
|
||
713 | } |
||
714 | 6500 | jaume | |
715 | 4511 | ldiaz | public FLayer getLayer(){
|
716 | 6115 | jaume | |
717 | return wmsParamsPanel.getLayer();
|
||
718 | 4947 | ldiaz | // if(wmsParamsPanel.getDisagregatedLayers()){
|
719 | // return getLayerTree();
|
||
720 | // }else{
|
||
721 | // return getLayerPlain();
|
||
722 | 6115 | jaume | // }
|
723 | 4511 | ldiaz | } |
724 | 6115 | jaume | |
725 | // private Object[] getFullPath(String name){
|
||
726 | 4511 | ldiaz | // Vector path = new Vector();
|
727 | 6115 | jaume | // WMSLayerNode layerNode;
|
728 | 4511 | ldiaz | // WMSLayerNode parent;
|
729 | // for (int i = 0; i <wmsParamsPanel.getLstSelectedLayers().getModel().getSize(); i++) {
|
||
730 | // layerNode = (WMSLayerNode)wmsParamsPanel.getLstSelectedLayers().getModel().getElementAt(i);
|
||
731 | // if(layerNode.getName().compareTo( name ) == 0 ){
|
||
732 | // path.add(layerNode);
|
||
733 | // parent = (WMSLayerNode)layerNode.getParent().clone();
|
||
734 | // while ( parent != null){
|
||
735 | // path.add(parent);
|
||
736 | // parent = (WMSLayerNode)parent.getParent().clone();
|
||
737 | // }
|
||
738 | // }
|
||
739 | // }
|
||
740 | // return path.toArray();
|
||
741 | 4507 | jorpiell | // }
|
742 | 6115 | jaume | |
743 | 4511 | ldiaz | /**
|
744 | * If user does not select the chekbox Disagregate layers, will get the layer tree in WMS
|
||
745 | * @return
|
||
746 | */
|
||
747 | 6115 | jaume | protected FLayer getLayerTree() {
|
748 | LayerTree layerTree = wmsParamsPanel.getLayerStructure(); |
||
749 | 4511 | ldiaz | TreePath[] selection = (TreePath[])wmsParamsPanel.getSelectedPaths().toArray(new TreePath[0]);//layerTree.getSelectionPaths(); |
750 | 6115 | jaume | if (selection!=null){ |
751 | return getSubTree((WMSLayerNode)layerTree.getModel().getRoot(), selection);
|
||
752 | } |
||
753 | 4511 | ldiaz | return null; |
754 | } |
||
755 | 6115 | jaume | |
756 | 4624 | ldiaz | protected boolean nodeSelected(TreePath[] selection, WMSLayerNode node){ |
757 | 6115 | jaume | for (int i = 0; i < selection.length; i++) { |
758 | 4511 | ldiaz | Object[] components = selection[i].getPath(); |
759 | for (int j=0; j < components.length ; j++) |
||
760 | 6115 | jaume | { |
761 | 4511 | ldiaz | if (components[j] instanceof WMSLayerNode){ |
762 | if (((WMSLayerNode)components[j]).getTitle().compareTo(node.getTitle()) == 0){ |
||
763 | return true; |
||
764 | } |
||
765 | } |
||
766 | 6115 | jaume | } |
767 | } |
||
768 | 4511 | ldiaz | return false; |
769 | } |
||
770 | 6115 | jaume | |
771 | 8765 | jjdelcerro | /**
|
772 | * @deprecated
|
||
773 | * @param node
|
||
774 | * @param selection
|
||
775 | * @return
|
||
776 | */
|
||
777 | 4624 | ldiaz | protected FLayer getSubTree(WMSLayerNode node, TreePath[] selection) |
778 | 6115 | jaume | { |
779 | 4511 | ldiaz | if (node.getChildren().size() > 0) |
780 | 4507 | jorpiell | { |
781 | 4609 | ldiaz | //com.iver.cit.gvsig.gui.View v = (com.iver.cit.gvsig.gui.View) PluginServices.getMDIManager().getActiveView();
|
782 | 6115 | jaume | FLayers l = new FLayers(this.getMapCtrl().getMapContext(), null); |
783 | 4511 | ldiaz | l.setName(node.getTitle()); |
784 | for(int i = 0; i < node.getChildren().size(); i++ ){ |
||
785 | if (nodeSelected(selection, (WMSLayerNode)(node.getChildren().get(i))))
|
||
786 | { |
||
787 | FLayer lyr = getSubTree((WMSLayerNode)node.getChildren().get(i), selection); |
||
788 | if(lyr != null){ |
||
789 | l.addLayer(lyr); |
||
790 | } |
||
791 | } |
||
792 | } |
||
793 | return l;
|
||
794 | 4507 | jorpiell | } |
795 | 4511 | ldiaz | else{
|
796 | if (nodeSelected(selection, node))
|
||
797 | { |
||
798 | FLyrWMS layer = new FLyrWMS();
|
||
799 | layer.setHost(getHost()); |
||
800 | try {
|
||
801 | 6115 | jaume | layer.setFullExtent(getLayersRectangle()); |
802 | } catch (CannotReprojectException e) {
|
||
803 | 4511 | ldiaz | e.printStackTrace(); |
804 | 4609 | ldiaz | return null; |
805 | 6115 | jaume | } |
806 | 4511 | ldiaz | layer.setFormat(getFormat()); |
807 | 4645 | ldiaz | layer.setLayerQuery(node.getName()); |
808 | 4609 | ldiaz | layer.setInfoLayerQuery(getQueryableLayerQuery()); |
809 | layer.setSRS(getSRS()); |
||
810 | 4645 | ldiaz | layer.setName(node.getTitle()); |
811 | 4609 | ldiaz | layer.setWmsTransparency(getTransparency()); |
812 | layer.setStyles(getStyles()); |
||
813 | layer.setDimensions(getDimensions()); |
||
814 | layer.setDriver(getDriver()); |
||
815 | layer.setOnlineResources(getOnlineResources()); |
||
816 | layer.setFixedSize(getFixedSize()); |
||
817 | 8765 | jjdelcerro | layer.setQueryable(node.isQueryable()); |
818 | 6115 | jaume | |
819 | 4609 | ldiaz | return layer;
|
820 | 6115 | jaume | |
821 | 4511 | ldiaz | }else{
|
822 | return null; |
||
823 | 6115 | jaume | } |
824 | } |
||
825 | } |
||
826 | 4507 | jorpiell | |
827 | 4511 | ldiaz | /**
|
828 | 8765 | jjdelcerro | * @deprecated
|
829 | 4511 | ldiaz | * If user selects the chekbox Disagregate layers, will get the selected layers rendered in one
|
830 | * the tree structure in WMS will be lost.
|
||
831 | * @return
|
||
832 | */
|
||
833 | 4624 | ldiaz | protected FLayer getLayerPlain(){
|
834 | 4511 | ldiaz | FLyrWMS layer = new FLyrWMS();
|
835 | layer.setHost(getHost()); |
||
836 | try{
|
||
837 | layer.setFullExtent(getLayersRectangle()); |
||
838 | }catch(CannotReprojectException ex)
|
||
839 | { |
||
840 | ex.printStackTrace(); |
||
841 | JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), ex.getMessage()); |
||
842 | return null; |
||
843 | } |
||
844 | layer.setFormat(getFormat()); |
||
845 | layer.setLayerQuery(getLayersQuery()); |
||
846 | layer.setInfoLayerQuery(getQueryableLayerQuery()); |
||
847 | layer.setSRS(getSRS()); |
||
848 | layer.setName(getLayerName()); |
||
849 | layer.setWmsTransparency(getTransparency()); |
||
850 | layer.setStyles(getStyles()); |
||
851 | layer.setDimensions(getDimensions()); |
||
852 | layer.setDriver(getDriver()); |
||
853 | layer.setOnlineResources(getOnlineResources()); |
||
854 | layer.setFixedSize(getFixedSize()); |
||
855 | layer.setQueryable(isQueryable()); |
||
856 | return layer;
|
||
857 | } |
||
858 | |||
859 | 4624 | ldiaz | protected boolean isQueryable() { |
860 | 4222 | jaume | return dataSource.isQueryable();
|
861 | } |
||
862 | |||
863 | 4624 | ldiaz | protected Dimension getFixedSize() { |
864 | 4507 | jorpiell | return wmsParamsPanel.getFixedSize();
|
865 | } |
||
866 | |||
867 | 4222 | jaume | private Hashtable getOnlineResources() { |
868 | return wmsParamsPanel.getOnlineResources();
|
||
869 | } |
||
870 | |||
871 | 4624 | ldiaz | protected FMapWMSDriver getDriver() {
|
872 | 3746 | jaume | return wmsParamsPanel.getDriver();
|
873 | } |
||
874 | |||
875 | /**
|
||
876 | 4507 | jorpiell | * @return
|
877 | */
|
||
878 | 4624 | ldiaz | protected Vector getStyles() { |
879 | 4507 | jorpiell | return wmsParamsPanel.getStyles();
|
880 | } |
||
881 | 3746 | jaume | |
882 | 4624 | ldiaz | protected Vector getDimensions() { |
883 | 4507 | jorpiell | return wmsParamsPanel.getDimensions();
|
884 | } |
||
885 | 3746 | jaume | |
886 | 4507 | jorpiell | /**
|
887 | * @return
|
||
888 | */
|
||
889 | 4624 | ldiaz | protected boolean getTransparency() { |
890 | 4507 | jorpiell | return wmsParamsPanel.getTransparency();
|
891 | } |
||
892 | |||
893 | /**
|
||
894 | 3746 | jaume | * DOCUMENT ME!
|
895 | *
|
||
896 | * @return DOCUMENT ME!
|
||
897 | */
|
||
898 | public String getQueryableLayerQuery() { |
||
899 | return wmsParamsPanel.getQueryableLayerQuery();
|
||
900 | } |
||
901 | 4501 | jaume | |
902 | /**
|
||
903 | 6115 | jaume | * This method initializes chkCaching
|
904 | *
|
||
905 | * @return javax.swing.JCheckBox
|
||
906 | */
|
||
907 | 4501 | jaume | private JCheckBox getChkCaching() { |
908 | if (chkCaching == null) { |
||
909 | chkCaching = new JCheckBox(); |
||
910 | chkCaching.setBounds(7, 51, 349, 20); |
||
911 | chkCaching.setText(PluginServices.getText(this, "refresh_capabilities")); |
||
912 | chkCaching.setToolTipText(PluginServices.getText(this, "refresh_capabilities_tooltip")); |
||
913 | chkCaching.setSelected(refreshing); |
||
914 | 6115 | jaume | chkCaching.addItemListener(new java.awt.event.ItemListener() {
|
915 | 4501 | jaume | public void itemStateChanged(java.awt.event.ItemEvent e) { |
916 | refreshing = chkCaching.isSelected(); |
||
917 | } |
||
918 | }); |
||
919 | 6115 | jaume | chkCaching.addActionListener(new java.awt.event.ActionListener() {
|
920 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
921 | 4501 | jaume | fPrefs.putBoolean("refresh_capabilities", chkCaching.isSelected());
|
922 | } |
||
923 | }); |
||
924 | 4507 | jorpiell | |
925 | 4501 | jaume | } |
926 | return chkCaching;
|
||
927 | } |
||
928 | 6122 | jaume | |
929 | /**
|
||
930 | * This method initializes pnlName
|
||
931 | *
|
||
932 | * @return javax.swing.JPanel
|
||
933 | */
|
||
934 | private JPanel getPnlName() { |
||
935 | if (pnlName == null) { |
||
936 | pnlName = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 0)); |
||
937 | pnlName.setBounds(new java.awt.Rectangle(9,19,452,24)); |
||
938 | pnlName.add(getJLabel1(), null);
|
||
939 | pnlName.add(getLblTitle(), null);
|
||
940 | } |
||
941 | return pnlName;
|
||
942 | } |
||
943 | 3746 | jaume | } // @jve:decl-index=0:visual-constraint="10,10" |