Revision 26594

View differences:

tmp/trunk/cliente/WorkSpace_WPSClient/extWPSCallejero/src/es/logex/gvsig/streetsmap/ui/PanelConnectionWPS.java
24 24
import javax.swing.ImageIcon;
25 25
import javax.swing.JButton;
26 26
import javax.swing.JComboBox;
27
import javax.swing.JEditorPane;
27 28
import javax.swing.JOptionPane;
28 29

  
29 30
import javax.swing.WindowConstants;
......
46 47
import es.logex.gvsig.streetsmap.ui.events.ConnectionSucceedProducer;
47 48
import es.logex.gvsig.streetsmap.ui.events.ConnectionSucceedEvent;
48 49
import es.logex.gvsig.wps.client.WPSClient;
50
import es.logex.gvsig.wps.client.WPSProtocolHandler;
49 51

  
50 52
/**
51 53
 * This code was edited or generated using CloudGarden's Jigloo SWT/Swing GUI
......
67 69
	private JButton btnConnect;
68 70
	private JComboServer cmbHost;
69 71
	private JPanel panelHeader;
70
	private JTextArea txtAbstract;
72
	private javax.swing.JEditorPane txtAbstract;
71 73
	private JLabel lblIconSearch;
72 74
	private JLabel lblBuscar;
73 75
	private JPanel jPanel2;
74 76
	private List<ConnectionSucceedListener> connectRequestsListeners = new ArrayList<ConnectionSucceedListener>();
77
	
78
	 private final String bgColor0 = "\"#FEEDD6\""; // light salmon
79
	    private final String bgColor1 = "\"#EAEAEA\""; // light grey
80
	    private final String bgColor2 = "\"#F2FEFF\""; // light blue
81
	    private final String bgColor3 = "\"#FBFFE1\""; // light yellow
82
	    private final String service_title       = PluginServices.getText(this, "service_info");
83
	    private final String server              = PluginServices.getText(this, "server");
84
	    private final String server_type         = PluginServices.getText(this, "server_type");
85
	    private final String server_abstract     = PluginServices.getText(this, "server_abstract");
86
	    private final String server_title        = PluginServices.getText(this, "server_title");
75 87
	/**
76 88
	 * Auto-generated main method to display this JPanel inside a new JFrame.
77 89
	 */
......
112 124
					btnConnect.setText("Conectar");
113 125
					btnConnect.addActionListener(new ActionListener() {
114 126
						public void actionPerformed(ActionEvent evt) {
127
							
115 128
							btnConnectActionPerformed(evt);
116 129
						}
117 130
					});
......
168 181
				this.add(panelServerAbstract, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
169 182
				panelServerAbstract.setLayout(panelServerAbstractLayout);
170 183
				{
171
					txtAbstract = new JTextArea();
184
					txtAbstract =  new JEditorPane();
185
					txtAbstract.setEditable(false);
172 186
					panelServerAbstract.add(txtAbstract, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
173 187
					txtAbstract.setBorder(BorderFactory.createTitledBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false), "Información servidor", TitledBorder.LEADING, TitledBorder.TOP));
174 188
					txtAbstract.setEditable(false);
......
176 190
			}
177 191
			{
178 192
				panelHeader = new JPanel();
193

  
179 194
				this.add(panelHeader, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
180 195
				GridBagLayout jPanel1Layout = new GridBagLayout();
181 196
				jPanel1Layout.columnWidths = new int[] {7, 20};
......
238 253
		try {
239 254
			if(wpsClient.connect())
240 255
			{
241
				this.txtAbstract.setText(wpsClient.getServiceAbstract());
242

  
256
				this.txtAbstract.setContentType("text/html");
257
				this.txtAbstract.setText(formatWpsInfo(wpsClient.getWPSProtocolHandler()));
243 258
				
259
				
244 260
				// Avisar a los clientes de que ha habido una conexion
245 261
				ConnectionSucceedEvent connRequest = new ConnectionSucceedEvent(this,url,wpsClient);
246 262
				for(ConnectionSucceedListener connListener : connectRequestsListeners)
......
272 288
		}
273 289
	}
274 290
	
291
	private String formatWpsInfo(WPSProtocolHandler protocolHandler) {
292
        String font = "Arial";
293
		String html =
294
            "<html>" +
295
            "<body>" +
296
            "<table align=\"center\" width=\"437\" height=\"156\" border=\"0\" cellpadding=\"4\" cellspacing=\"4\">" +
297
            "  <tr valign=\"top\" bgcolor=\"#FFFFFF\">" +
298
            "    <td width=\"92\" height=\"18\" bgcolor="+bgColor3+" colspan=\"2\"><font face=\""+font+"\" size=\"4\"><b>"+service_title+"</font></b></td>" +
299
            "  </tr>" +
300
            "  <tr valign=\"top\" bgcolor="+bgColor0+">" +
301
            "    <td width=\"92\" height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\""+font+"\" size=\"3\"><b>"+server+"</font></b></td>" +
302
            "    <td width=\"268\"><font face=\""+font+"\" size=\"3\">"+protocolHandler.getHost()+"</font></td>" +
303
            "  </tr>" +
304
            "  <tr valign=\"top\" bgcolor="+bgColor1+">" +
305
            "    <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\""+font+"\" size=\"3\"><b>"+server_type+"</b></font></td>" +
306
            "    <td><font face=\""+font+"\" size=\"3\">"+ protocolHandler.getDiscoveryConnector().getServiceName()  +"</font></td>" +
307
            "  </tr>" +
308
            "  <tr valign=\"top\" bgcolor="+bgColor0+">" +
309
            "    <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\""+font+"\" size=\"3\"><b>"+server_title+"</b></font></td>" +
310
            "    <td><font face=\""+font+"\" size=\"3\"><font face=\""+font+"\" size=\"3\">"+protocolHandler.getServiceIdentification().getOwsAbstract()+"</font></td>" +
311
            "  </tr>" +
312
            "  <tr valign=\"top\" bgcolor="+bgColor1+">" +
313
            "    <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\""+font+"\" size=\"3\"><b>"+server_abstract+"</font></b></td>" +
314
            "    <td><font face=\""+font+"\" size=\"3\">"+ protocolHandler.getServiceIdentification().getTitle()  +"</font></td>" +
315
            "  </tr>" +
316

  
317
            "  <tr>" +
318
            "  </tr>" +
319
            "</table>" +
320
            "</body>" +
321
            "</html>";
322
		return html;
323
	}
324

  
275 325
	public void setAbstract(String abstractString)
276 326
	{
277 327
		this.txtAbstract.setText(abstractString);
tmp/trunk/cliente/WorkSpace_WPSClient/extWPSCallejero/src/es/logex/gvsig/streetsmap/ui/PanelQuerysBuilder.java
1 1
package es.logex.gvsig.streetsmap.ui;
2
import com.cloudgarden.resource.ArrayFocusTraversalPolicy;
3 2

  
3
import java.awt.Component;
4
import java.awt.Container;
4 5
import java.awt.Dimension;
6
import java.awt.FocusTraversalPolicy;
5 7
import java.awt.GridBagConstraints;
6 8
import java.awt.GridBagLayout;
7 9
import java.awt.Insets;
......
26 28
import javax.swing.JTextField;
27 29
import javax.swing.ListModel;
28 30
import javax.swing.SwingConstants;
31
import javax.swing.SwingUtilities;
29 32
import javax.swing.event.DocumentEvent;
30 33
import javax.swing.event.DocumentListener;
31 34
import javax.swing.event.ListDataEvent;
......
139 142
	public PanelQuerysBuilder(PanelQuerysActionsDelegate queryClient) {
140 143
		this();
141 144
		panelQuerysClient = queryClient;
145
		//SwingUtilities.getWindowAncestor(this).pack();
142 146
	}
143 147
	
144 148
	private void initGUI() {
145 149
		try {
146 150
			GridBagLayout thisLayout = new GridBagLayout();
147 151
			setPreferredSize(new Dimension(400, 300));
148
			thisLayout.rowWeights = new double[] {0.0, 0.0, 0.0, 0.2, 0.0, 0.7, 0.0, 0.1};
152
			thisLayout.rowWeights = new double[] {0.0, 0.0, 0.0, 0.4, 0.0, 0.6, 0.0, 0.1};
149 153
			thisLayout.rowHeights = new int[] {7, 45, 7, 7, 7, 7, 7, 7};
150 154
			thisLayout.columnWeights = new double[] {0.0, 0.1, 0.0};
151 155
			thisLayout.columnWidths = new int[] {7, 7, 7};
......
258 262
			}
259 263
			{
260 264
				PanelItemsQuery = new JPanel();
261
				this.add(PanelItemsQuery, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
265
				this.add(PanelItemsQuery, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
262 266
				this.add(getPanelHeader(), new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
263 267
				GridBagLayout PanelItemsQueryLayout = new GridBagLayout();
264 268
				PanelItemsQueryLayout.columnWidths = new int[] {7, 7, 20, 7, 7};
265
				PanelItemsQueryLayout.rowHeights = new int[] {7, 7};
269
				PanelItemsQueryLayout.rowHeights = new int[] {7, 7, 7, 7};
266 270
				PanelItemsQueryLayout.columnWeights = new double[] {0.1, 2.0, 0.1, 0.1, 0.0};
267
				PanelItemsQueryLayout.rowWeights = new double[] {0.1, 0.1};
271
				PanelItemsQueryLayout.rowWeights = new double[] {0.5, 0.0, 0.5, 0.0};
268 272
				PanelItemsQuery.setPreferredSize(new java.awt.Dimension(400,38));
269 273
				PanelItemsQuery.setLayout(PanelItemsQueryLayout);
270 274
				PanelItemsQuery.setSize(400, 32);
271 275
				{
272 276
					Municipio = new JLabel();
273
					PanelItemsQuery.add(Municipio, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
277
					PanelItemsQuery.add(Municipio, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
274 278
					Municipio.setText("Municipio");
275 279
				}
276 280
				{
277 281
					lblCalleVia = new JLabel();
278
					PanelItemsQuery.add(lblCalleVia, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
282
					PanelItemsQuery.add(lblCalleVia, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
279 283
					lblCalleVia.setText("Calle o Via");
280 284
				}
281 285
				{
282 286
					lblNumero = new JLabel();
283
					PanelItemsQuery.add(lblNumero, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
287
					PanelItemsQuery.add(lblNumero, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
284 288
					lblNumero.setText("Nº");
285 289
				}
286 290
				{
287 291
					txtNumeroPol = new JTextField();
288
					PanelItemsQuery.add(txtNumeroPol, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
292
					PanelItemsQuery.add(txtNumeroPol, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
289 293
					txtNumeroPol.setToolTipText("Introduce el numero de patio a localizar");
290 294
				}
291 295
				{
292 296
					txtCalleVia = new JTextField();
293 297
					txtCalleVia.getDocument().addDocumentListener(new SyncButtonsQueryDocumentListener());
294
					PanelItemsQuery.add(txtCalleVia, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
298
					PanelItemsQuery.add(txtCalleVia, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
295 299
					txtCalleVia.setToolTipText("Introduce el nombre de la calle o via a buscar");
296 300
				}
297 301
				{
298 302
					txtMunicipio = new JTextField();
299 303
					txtMunicipio.getDocument().addDocumentListener(new SyncButtonsQueryDocumentListener());
300
					PanelItemsQuery.add(txtMunicipio, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
304
					PanelItemsQuery.add(txtMunicipio, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
301 305
					txtMunicipio.setToolTipText("Introduce el nombre del municipio a buscar");
302 306
				}
303 307
				PanelItemsQuery.setFocusCycleRoot(true);
304
				PanelItemsQuery.setFocusTraversalPolicy(new ArrayFocusTraversalPolicy(new java.awt.Component[] {txtMunicipio, txtCalleVia, txtNumeroPol}));
308
				PanelItemsQuery.setFocusTraversalPolicy(new FocusTraversalPolicy()
309
						{
310

  
311
							@Override
312
							public Component getComponentAfter(
313
									Container container, Component component) {
314
								if(component == txtMunicipio)
315
								{
316
									return txtCalleVia;
317
								}
318
								if(component == txtCalleVia)
319
								{
320
									return txtNumeroPol;
321
								}
322
								if(component == txtNumeroPol)
323
								{
324
									return txtMunicipio;
325
								}
326
								return component;
327
							}
328

  
329
							@Override
330
							public Component getComponentBefore(
331
									Container container, Component component) {
332
								if(component == txtMunicipio)
333
								{
334
									return txtNumeroPol;
335
								}
336
								if(component == txtCalleVia)
337
								{
338
									return txtMunicipio;
339
								}
340
								if(component == txtNumeroPol)
341
								{
342
									return txtCalleVia;
343
								}
344
								return component;
345
							}
346

  
347
							@Override
348
							public Component getDefaultComponent(
349
									Container container) {
350
								return txtMunicipio;
351
							}
352

  
353
							@Override
354
							public Component getFirstComponent(
355
									Container container) {
356
								return txtMunicipio;
357
							}
358

  
359
							@Override
360
							public Component getLastComponent(
361
									Container container) {
362
								return txtNumeroPol;
363
							}
364
					
365
						}
366
				);
367
			
305 368
			}
306 369
			((DefaultComboBoxModel)listResultsQuery.getModel()).removeAllElements();
307 370
		} catch (Exception e) {
tmp/trunk/cliente/WorkSpace_WPSClient/extWPSCallejero/src/es/logex/gvsig/wps/wps_0_4_0/WPSProtocolHandler0_4_0.java
40 40

  
41 41
	private static Logger logger = Logger
42 42
			.getLogger(WPSProtocolHandler0_4_0.class.getName());
43
	DiscoveryConnector discoveryConnector;
43
	private DiscoveryConnector discoveryConnector;
44 44
	ProcessDeclarationRunnable process = null;
45 45
	DiscoveryRequest discoveryRequest;
46 46

  
......
361 361
		return false;
362 362
	}
363 363

  
364

  
365

  
366
	
367
	public DiscoveryConnector getDiscoveryConnector() {
368
		return discoveryConnector;
369
	}
370

  
364 371
}
tmp/trunk/cliente/WorkSpace_WPSClient/extWPSCallejero/src/es/logex/gvsig/wps/client/WPSClient.java
131 131
		return handler.executeProcessGetCandidates(town, street, number);
132 132
	}
133 133

  
134

  
135
	public WPSProtocolHandler getWPSProtocolHandler() {
136
		return handler;
137
	}
138

  
134 139
	
135 140
}
136 141
			
tmp/trunk/cliente/WorkSpace_WPSClient/extWPSCallejero/src/es/logex/gvsig/wps/client/WPSProtocolHandler.java
23 23
import org.tigris.frogs.plugin.wpsint.impl_0_4_0.ExecuteLiteralData;
24 24
import org.tigris.frogs.plugin.wpsint.impl_0_4_0.ExecuteRequest;
25 25
import org.tigris.frogs.plugin.wpsint.impl_0_4_0.DataInputsType.ValueFormChoice;
26
import org.tigris.frogs.plugin.wpsint.impl_0_4_0.client.DiscoveryConnector;
26 27
import org.tigris.frogs.plugin.wpsint.impl_0_4_0.client.DiscoveryRequest;
27 28

  
28 29
/*import org.tigris.frogs.plugin.wpsint.impl_0_4_0.ProcessDeclarationRunnable;
......
79 80
	public abstract File executeProcessGetLayer(BoundingBox bbox, String layerName, String detailLevel );
80 81
	
81 82
	public abstract List<String> executeProcessGetCandidates(String town, String street, String number);
83
	
84
	public abstract DiscoveryConnector getDiscoveryConnector();
82 85
}
tmp/trunk/cliente/WorkSpace_WPSClient/extWPSCallejero/src/es/logex/gvsig/wps/WPSCallejeroClientExtension.java
48 48
		}
49 49
		if (!found) {
50 50
			StreetsMapsPaletteDialog em = new StreetsMapsPaletteDialog((BaseView)f);
51
			listManagers.add(em);
51
			listManagers.add(em);			
52 52
			PluginServices.getMDIManager().addWindow(em);
53 53
		}
54 54
	}

Also available in: Unified diff