Revision 26594 tmp/trunk/cliente/WorkSpace_WPSClient/extWPSCallejero/src/es/logex/gvsig/streetsmap/ui/PanelConnectionWPS.java
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); |
Also available in: Unified diff