svn-gvsig-desktop / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / vectorialdb / ConnectionPanel.java @ 25687
History | View | Annotate | Download (22.5 KB)
1 |
package com.iver.cit.gvsig.vectorialdb; |
---|---|
2 |
|
3 |
import java.awt.BorderLayout; |
4 |
import java.awt.Dimension; |
5 |
import java.awt.FlowLayout; |
6 |
import java.awt.Rectangle; |
7 |
import java.awt.event.ActionEvent; |
8 |
import java.awt.event.ActionListener; |
9 |
import java.util.HashMap; |
10 |
import java.util.Iterator; |
11 |
|
12 |
import javax.swing.DefaultComboBoxModel; |
13 |
import javax.swing.JLabel; |
14 |
import javax.swing.JPanel; |
15 |
import javax.swing.JPasswordField; |
16 |
import javax.swing.JTextField; |
17 |
import javax.swing.SwingConstants; |
18 |
|
19 |
import com.hardcode.driverManager.DriverLoadException; |
20 |
import com.iver.andami.PluginServices; |
21 |
import com.iver.cit.gvsig.fmap.drivers.IVectorialDatabaseDriver; |
22 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory; |
23 |
import com.iver.utiles.NotExistInXMLEntity; |
24 |
import com.iver.utiles.XMLEntity; |
25 |
import com.iver.utiles.swing.JComboBox; |
26 |
import com.iver.utiles.swing.wizard.Step; |
27 |
import com.iver.utiles.swing.wizard.WizardControl; |
28 |
|
29 |
|
30 |
/**
|
31 |
* DOCUMENT ME!
|
32 |
*
|
33 |
* @author Fernando Gonz?lez Cort?s
|
34 |
*/
|
35 |
public class ConnectionPanel extends JPanel implements Step { |
36 |
private static String passw = null; |
37 |
|
38 |
private JPanel jPanelLabels = null; |
39 |
private JLabel jLabel = null; |
40 |
private JTextField txtHost = null; |
41 |
private JPanel jPanelTexts = null; |
42 |
private JTextField txtPort = null; |
43 |
private JLabel jLabel1 = null; |
44 |
private JLabel jLabel2 = null; |
45 |
private JTextField txtUser = null; |
46 |
private JLabel jLabel3 = null; |
47 |
private JPasswordField txtPassword = null; |
48 |
private JLabel jLabel4 = null; |
49 |
private JTextField txtBD = null; |
50 |
private JLabel jLabel5 = null; |
51 |
private JComboBox cmbDriver = null; |
52 |
private JLabel jLabel6 = null; |
53 |
private com.iver.utiles.swing.JComboBox cmbName = null; |
54 |
private HashMap cs = new HashMap(); |
55 |
|
56 |
private JPanel jPanel = null; |
57 |
|
58 |
private JLabel jLabelSchema = null; |
59 |
|
60 |
private ConnectionPanel XYZ = null; |
61 |
|
62 |
private JPanel jPanel1 = null; |
63 |
|
64 |
private JPanel jPanelLabels1 = null; |
65 |
|
66 |
private JLabel jLabel61 = null; |
67 |
|
68 |
private JLabel jLabel7 = null; |
69 |
|
70 |
private JLabel jLabel11 = null; |
71 |
|
72 |
private JLabel jLabel21 = null; |
73 |
|
74 |
private JLabel jLabel31 = null; |
75 |
|
76 |
private JLabel jLabel51 = null; |
77 |
|
78 |
private JPanel jPanelTexts1 = null; |
79 |
|
80 |
private JComboBox cmbName1 = null; |
81 |
|
82 |
private JTextField txtHost1 = null; |
83 |
|
84 |
private JTextField txtPort1 = null; |
85 |
|
86 |
private JTextField txtUser1 = null; |
87 |
|
88 |
private JPasswordField txtPassword1 = null; |
89 |
|
90 |
private JTextField txtBD1 = null; |
91 |
|
92 |
private JComboBox cmbDriver1 = null; |
93 |
|
94 |
private JTextField txtSchema = null; |
95 |
|
96 |
|
97 |
|
98 |
/**
|
99 |
* This is the default constructor
|
100 |
*/
|
101 |
public ConnectionPanel() {
|
102 |
super();
|
103 |
initialize(); |
104 |
} |
105 |
|
106 |
/**
|
107 |
* This method initializes this
|
108 |
*/
|
109 |
private void initialize() { |
110 |
this.setLayout(null); |
111 |
this.setSize(335, 240); |
112 |
this.add(getJPanel(), null); |
113 |
|
114 |
if (passw != null) |
115 |
txtPassword.setText(passw); |
116 |
|
117 |
} |
118 |
|
119 |
/**
|
120 |
* This method initializes jPanel
|
121 |
*
|
122 |
* @return javax.swing.JPanel
|
123 |
*/
|
124 |
private JPanel getJPanelLabels() { |
125 |
if (jPanelLabels == null) { |
126 |
String string = PluginServices.getText(this, "schema") + ":"; |
127 |
jLabelSchema = new JLabel(); |
128 |
jLabelSchema.setName("jLabel4");
|
129 |
jLabelSchema.setHorizontalAlignment(SwingConstants.RIGHT);
|
130 |
jLabelSchema.setHorizontalTextPosition(SwingConstants.RIGHT);
|
131 |
jLabelSchema.setText(string); |
132 |
jLabelSchema.setPreferredSize(new Dimension(140, 19)); |
133 |
FlowLayout flowLayout3 = new FlowLayout(); |
134 |
flowLayout3.setVgap(15);
|
135 |
jLabel5 = new JLabel(); |
136 |
jLabel4 = new JLabel(); |
137 |
jLabel3 = new JLabel(); |
138 |
jLabel2 = new JLabel(); |
139 |
jLabel1 = new JLabel(); |
140 |
jLabel = new JLabel(); |
141 |
jPanelLabels = new JPanel(); |
142 |
jPanelLabels.setLayout(flowLayout3); |
143 |
jPanelLabels.setName("jPanelLabels");
|
144 |
jPanelLabels.setPreferredSize(new java.awt.Dimension(150,400)); |
145 |
jLabel.setText(PluginServices.getText(this, "host") + ":"); |
146 |
jLabel.setPreferredSize(new java.awt.Dimension(140,19)); |
147 |
jLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); |
148 |
jLabel.setName("jLabel");
|
149 |
jLabel1.setText(PluginServices.getText(this, "puerto")+":"); |
150 |
jLabel1.setPreferredSize(new java.awt.Dimension(140,19)); |
151 |
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); |
152 |
jLabel1.setName("jLabel1");
|
153 |
jLabel2.setText(PluginServices.getText(this, "usuario")+":"); |
154 |
jLabel2.setName("jLabel2");
|
155 |
jLabel2.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); |
156 |
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); |
157 |
jLabel2.setPreferredSize(new java.awt.Dimension(140,19)); |
158 |
jLabel3.setText(PluginServices.getText(this, "password")+":"); |
159 |
jLabel3.setName("jLabel3");
|
160 |
jLabel3.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); |
161 |
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); |
162 |
jLabel3.setPreferredSize(new java.awt.Dimension(140,19)); |
163 |
jLabel4.setText(PluginServices.getText(this, "bd")+":"); |
164 |
jLabel4.setName("jLabel4");
|
165 |
jLabel4.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); |
166 |
jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); |
167 |
jLabel4.setPreferredSize(new java.awt.Dimension(140,19)); |
168 |
jLabel5.setText(PluginServices.getText(this, "driver")+":"); |
169 |
jLabel5.setName("jLabel5");
|
170 |
jLabel5.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); |
171 |
jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); |
172 |
jLabel5.setPreferredSize(new java.awt.Dimension(140,19)); |
173 |
jPanelLabels.add(getJLabel6(), null);
|
174 |
jPanelLabels.add(jLabel, null);
|
175 |
jPanelLabels.add(jLabel1, null);
|
176 |
jPanelLabels.add(jLabel2, null);
|
177 |
jPanelLabels.add(jLabel3, null);
|
178 |
jPanelLabels.add(jLabel4, null);
|
179 |
jPanelLabels.add(jLabelSchema, null);
|
180 |
jPanelLabels.add(jLabel5, null);
|
181 |
|
182 |
} |
183 |
|
184 |
return jPanelLabels;
|
185 |
} |
186 |
|
187 |
/**
|
188 |
* This method initializes txtHost
|
189 |
*
|
190 |
* @return javax.swing.JTextField
|
191 |
*/
|
192 |
private JTextField getTxtHost() { |
193 |
if (txtHost == null) { |
194 |
txtHost = new JTextField(); |
195 |
txtHost.setPreferredSize(new java.awt.Dimension(170, 19)); |
196 |
txtHost.setName("txtHost");
|
197 |
} |
198 |
|
199 |
return txtHost;
|
200 |
} |
201 |
|
202 |
/**
|
203 |
* This method initializes jPanel1
|
204 |
*
|
205 |
* @return javax.swing.JPanel
|
206 |
*/
|
207 |
private JPanel getJPanelTexts() { |
208 |
if (jPanelTexts == null) { |
209 |
FlowLayout flowLayout2 = new FlowLayout(FlowLayout.LEFT); |
210 |
flowLayout2.setVgap(15);
|
211 |
jPanelTexts = new JPanel(); |
212 |
jPanelTexts.setLayout(flowLayout2); |
213 |
jPanelTexts.setPreferredSize(new Dimension(200, 300)); |
214 |
|
215 |
jPanelTexts.setName("jPanelText");
|
216 |
jPanelTexts.add(getCmbName(), null);
|
217 |
jPanelTexts.add(getTxtHost(), null);
|
218 |
jPanelTexts.add(getTxtPort(), null);
|
219 |
jPanelTexts.add(getTxtUser(), null);
|
220 |
jPanelTexts.add(getTxtPassword(), null);
|
221 |
jPanelTexts.add(getTxtBD(), null);
|
222 |
jPanelTexts.add(getTxtSchema(), null);
|
223 |
jPanelTexts.add(getCmbDriver(), null);
|
224 |
} |
225 |
|
226 |
return jPanelTexts;
|
227 |
} |
228 |
|
229 |
/**
|
230 |
* This method initializes txtPort
|
231 |
*
|
232 |
* @return javax.swing.JTextField
|
233 |
*/
|
234 |
private JTextField getTxtPort() { |
235 |
if (txtPort == null) { |
236 |
txtPort = new JTextField(); |
237 |
txtPort.setPreferredSize(new java.awt.Dimension(40, 19)); |
238 |
txtPort.setName("txtPort");
|
239 |
txtPort.setText("3306");
|
240 |
txtPort.setHorizontalAlignment(javax.swing.JTextField.LEFT); |
241 |
} |
242 |
|
243 |
return txtPort;
|
244 |
} |
245 |
|
246 |
/**
|
247 |
* This method initializes txtUser
|
248 |
*
|
249 |
* @return javax.swing.JTextField
|
250 |
*/
|
251 |
private JTextField getTxtUser() { |
252 |
if (txtUser == null) { |
253 |
txtUser = new JTextField(); |
254 |
txtUser.setPreferredSize(new java.awt.Dimension(170, 19)); |
255 |
txtUser.setName("txtUser");
|
256 |
} |
257 |
|
258 |
return txtUser;
|
259 |
} |
260 |
|
261 |
/**
|
262 |
* This method initializes txtPassword
|
263 |
*
|
264 |
* @return javax.swing.JTextField
|
265 |
*/
|
266 |
private JPasswordField getTxtPassword() { |
267 |
if (txtPassword == null) { |
268 |
txtPassword = new JPasswordField(); |
269 |
txtPassword.setPreferredSize(new java.awt.Dimension(170, 19)); |
270 |
txtPassword.setName("txtPassword");
|
271 |
} |
272 |
|
273 |
return txtPassword;
|
274 |
} |
275 |
|
276 |
/**
|
277 |
* This method initializes txtBD
|
278 |
*
|
279 |
* @return javax.swing.JTextField
|
280 |
*/
|
281 |
private JTextField getTxtBD() { |
282 |
if (txtBD == null) { |
283 |
txtBD = new JTextField(); |
284 |
txtBD.setPreferredSize(new java.awt.Dimension(170, 19)); |
285 |
txtBD.setName("txtBD");
|
286 |
} |
287 |
|
288 |
return txtBD;
|
289 |
} |
290 |
|
291 |
/**
|
292 |
* DOCUMENT ME!
|
293 |
*
|
294 |
* @return DOCUMENT ME!
|
295 |
*/
|
296 |
public String getHost() { |
297 |
return getTxtHost().getText();
|
298 |
} |
299 |
|
300 |
/**
|
301 |
* DOCUMENT ME!
|
302 |
*
|
303 |
* @return DOCUMENT ME!
|
304 |
*/
|
305 |
public String getPort() { |
306 |
return getTxtPort().getText();
|
307 |
} |
308 |
|
309 |
/**
|
310 |
* DOCUMENT ME!
|
311 |
*
|
312 |
* @return DOCUMENT ME!
|
313 |
*/
|
314 |
public String getUser() { |
315 |
return getTxtUser().getText();
|
316 |
} |
317 |
|
318 |
/**
|
319 |
* DOCUMENT ME!
|
320 |
*
|
321 |
* @return DOCUMENT ME!
|
322 |
*/
|
323 |
public String getSettingsName() { |
324 |
return getCmbName().getSelectedItem().toString();
|
325 |
} |
326 |
|
327 |
/**
|
328 |
* DOCUMENT ME!
|
329 |
*
|
330 |
* @return DOCUMENT ME!
|
331 |
*/
|
332 |
public String getPassword() { |
333 |
passw = String.copyValueOf(getTxtPassword().getPassword());
|
334 |
return passw;
|
335 |
} |
336 |
|
337 |
/**
|
338 |
* DOCUMENT ME!
|
339 |
*
|
340 |
* @return DOCUMENT ME!
|
341 |
*/
|
342 |
public String getDBName() { |
343 |
return getTxtBD().getText();
|
344 |
} |
345 |
|
346 |
/**
|
347 |
* DOCUMENT ME!
|
348 |
*
|
349 |
* @param drivers DOCUMENT ME!
|
350 |
*/
|
351 |
public void setDrivers(String[] drivers) { |
352 |
DefaultComboBoxModel model = new DefaultComboBoxModel(); |
353 |
|
354 |
for (int i = 0; i < drivers.length; i++) { |
355 |
model.addElement(drivers[i]); |
356 |
} |
357 |
|
358 |
getCmbDriver().setModel(model); |
359 |
|
360 |
//Para que refresque el textbox del puerto
|
361 |
if (drivers.length > 0) |
362 |
cmbDriver.setSelectedIndex(0);
|
363 |
|
364 |
} |
365 |
|
366 |
|
367 |
/**
|
368 |
* @return ConnectionSettings based on values in this panel
|
369 |
*/
|
370 |
public ConnectionSettings getConnectionSettings()
|
371 |
{ |
372 |
ConnectionSettings cs = new ConnectionSettings();
|
373 |
cs.setDb(getDBName()); |
374 |
cs.setSchema(getSchema()); |
375 |
cs.setDriver(getDriver()); |
376 |
cs.setHost(getHost()); |
377 |
cs.setPort(getPort()); |
378 |
cs.setUser(getUser()); |
379 |
cs.setPassw(getPassword()); |
380 |
cs.setName(getSettingsName()); |
381 |
return cs;
|
382 |
} |
383 |
|
384 |
public String getSchema() { |
385 |
return txtSchema.getText();
|
386 |
} |
387 |
|
388 |
/**
|
389 |
* Makes persistent the connection settings of this panel.
|
390 |
*/
|
391 |
public void saveConnectionSettings() |
392 |
{ |
393 |
ConnectionSettings cs = new ConnectionSettings();
|
394 |
cs.setDb(getDBName()); |
395 |
cs.setSchema(getSchema()); |
396 |
cs.setDriver(getDriver()); |
397 |
cs.setHost(getHost()); |
398 |
cs.setPort(getPort()); |
399 |
cs.setUser(getUser()); |
400 |
cs.setPassw(getPassword()); |
401 |
cs.setName(getSettingsName()); |
402 |
|
403 |
PluginServices ps = PluginServices.getPluginServices(this);
|
404 |
XMLEntity xml = ps.getPersistentXML(); |
405 |
|
406 |
try {
|
407 |
String[] connections = xml.getStringArrayProperty("jdbc-connections"); |
408 |
String[] newConnections = new String[connections.length + 1]; |
409 |
System.arraycopy(connections, 0, newConnections, 0, connections.length); |
410 |
newConnections[connections.length] = cs.toString(); |
411 |
xml.putProperty("jdbc-connections", newConnections);
|
412 |
} catch (NotExistInXMLEntity e) {
|
413 |
xml.putProperty("jdbc-connections", new String[] { cs.toString() }); |
414 |
} |
415 |
|
416 |
|
417 |
} |
418 |
|
419 |
/**
|
420 |
* DOCUMENT ME!
|
421 |
*
|
422 |
* @return DOCUMENT ME!
|
423 |
*/
|
424 |
public String getDriver() { |
425 |
return cmbDriver.getSelectedItem().toString();
|
426 |
} |
427 |
|
428 |
/**
|
429 |
* DOCUMENT ME!
|
430 |
*
|
431 |
* @param cs DOCUMENT ME!
|
432 |
*/
|
433 |
public void setSettings(HashMap cs) { |
434 |
this.cs = cs;
|
435 |
((DefaultComboBoxModel) getCmbName().getModel()).removeAllElements();
|
436 |
|
437 |
Iterator i = cs.keySet().iterator();
|
438 |
|
439 |
while (i.hasNext()) {
|
440 |
String item = (String) i.next(); |
441 |
((DefaultComboBoxModel) getCmbName().getModel()).addElement(item);
|
442 |
} |
443 |
} |
444 |
|
445 |
/**
|
446 |
* @see com.iver.utiles.swing.wizard.Step#init(com.iver.utiles.swing.wizard.WizardControl)
|
447 |
*/
|
448 |
public void init(WizardControl w) { |
449 |
} |
450 |
|
451 |
/**
|
452 |
* This method initializes cmbDriver
|
453 |
*
|
454 |
* @return com.iver.utiles.swing.JComboBox
|
455 |
*/
|
456 |
private JComboBox getCmbDriver() { |
457 |
if (cmbDriver == null) { |
458 |
cmbDriver = new JComboBox(); |
459 |
cmbDriver.setPreferredSize(new java.awt.Dimension(170, 19)); |
460 |
cmbDriver.setName("cmbDriver");
|
461 |
cmbDriver.addActionListener(new ActionListener() { |
462 |
public void actionPerformed(ActionEvent e) { |
463 |
String driverName = cmbDriver.getSelectedItem().toString();
|
464 |
IVectorialDatabaseDriver driver; |
465 |
try {
|
466 |
driver = (IVectorialDatabaseDriver) LayerFactory.getDM().getDriver(driverName); |
467 |
getTxtPort().setText(Integer.toString(driver.getDefaultPort()));
|
468 |
} catch (DriverLoadException e1) {
|
469 |
getTxtPort().setText("");
|
470 |
} |
471 |
} |
472 |
}); |
473 |
} |
474 |
|
475 |
return cmbDriver;
|
476 |
} |
477 |
|
478 |
/**
|
479 |
* DOCUMENT ME!
|
480 |
*
|
481 |
* @return
|
482 |
*/
|
483 |
public boolean done() { |
484 |
return (getTxtBD().getText().length() > 0) && |
485 |
(getTxtHost().getText().length() > 0) &&
|
486 |
(getCmbName().getSelectedItem() != null) &&
|
487 |
(getCmbName().getSelectedItem().toString().length() > 0);
|
488 |
} |
489 |
|
490 |
/**
|
491 |
* This method initializes jLabel6
|
492 |
*
|
493 |
* @return javax.swing.JLabel
|
494 |
*/
|
495 |
private JLabel getJLabel6() { |
496 |
if (jLabel6 == null) { |
497 |
jLabel6 = new JLabel(); |
498 |
jLabel6.setText(PluginServices.getText(this, "connection_name")+":"); |
499 |
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); |
500 |
jLabel6.setPreferredSize(new java.awt.Dimension(140,19)); |
501 |
} |
502 |
|
503 |
return jLabel6;
|
504 |
} |
505 |
|
506 |
/**
|
507 |
* This method initializes jComboBox
|
508 |
*
|
509 |
* @return com.iver.utiles.swing.JComboBox
|
510 |
*/
|
511 |
private com.iver.utiles.swing.JComboBox getCmbName() {
|
512 |
if (cmbName == null) { |
513 |
cmbName = new com.iver.utiles.swing.JComboBox();
|
514 |
cmbName.setEditable(true);
|
515 |
cmbName.setPreferredSize(new java.awt.Dimension(170, 19)); |
516 |
cmbName.setModel(new DefaultComboBoxModel()); |
517 |
cmbName.addActionListener(new ActionListener() { |
518 |
public void actionPerformed(ActionEvent e) { |
519 |
Object item = cmbName.getSelectedItem();
|
520 |
|
521 |
if (item == null) { |
522 |
return;
|
523 |
} |
524 |
|
525 |
ConnectionSettings c = (ConnectionSettings) cs.get(item.toString()); |
526 |
|
527 |
if (c != null) { |
528 |
getTxtHost().setText(c.getHost()); |
529 |
getTxtPort().setText(c.getPort()); |
530 |
getTxtBD().setText(c.getDb()); |
531 |
getTxtUser().setText(c.getUser()); |
532 |
if (c.getPassw() != null) |
533 |
getTxtPassword().setText(c.getPassw()); |
534 |
getCmbDriver().setSelectedItem(c.getDriver()); |
535 |
} |
536 |
} |
537 |
}); |
538 |
} |
539 |
|
540 |
return cmbName;
|
541 |
} |
542 |
|
543 |
/**
|
544 |
* This method initializes jPanel
|
545 |
*
|
546 |
* @return javax.swing.JPanel
|
547 |
*/
|
548 |
private JPanel getJPanel() { |
549 |
if (jPanel == null) { |
550 |
jPanel = new JPanel(); |
551 |
jPanel.setLayout(new BorderLayout()); |
552 |
jPanel.setBounds(0, 0, 363, 240); |
553 |
jPanel.add(getJPanelLabels(), java.awt.BorderLayout.WEST); |
554 |
jPanel.add(getJPanelTexts(), java.awt.BorderLayout.EAST); |
555 |
} |
556 |
return jPanel;
|
557 |
} |
558 |
|
559 |
/**
|
560 |
* This method initializes XYZ
|
561 |
*
|
562 |
* @return com.iver.cit.gvsig.jdbc_spatial.gui.jdbcwizard.ConnectionPanel
|
563 |
*/
|
564 |
private ConnectionPanel getXYZ() {
|
565 |
if (XYZ == null) { |
566 |
XYZ = new ConnectionPanel();
|
567 |
XYZ.setLayout(null);
|
568 |
XYZ.setSize(new java.awt.Dimension(335,240)); |
569 |
XYZ.add(getJPanel1(), null);
|
570 |
} |
571 |
return XYZ;
|
572 |
} |
573 |
|
574 |
/**
|
575 |
* This method initializes jPanel1
|
576 |
*
|
577 |
* @return javax.swing.JPanel
|
578 |
*/
|
579 |
private JPanel getJPanel1() { |
580 |
if (jPanel1 == null) { |
581 |
jPanel1 = new JPanel(); |
582 |
jPanel1.setLayout(new BorderLayout()); |
583 |
jPanel1.setBounds(new Rectangle(0, 0, 363, 240)); |
584 |
jPanel1.add(getJPanelLabels1(), java.awt.BorderLayout.WEST); |
585 |
jPanel1.add(getJPanelTexts1(), java.awt.BorderLayout.EAST); |
586 |
} |
587 |
return jPanel1;
|
588 |
} |
589 |
|
590 |
/**
|
591 |
* This method initializes jPanelLabels1
|
592 |
*
|
593 |
* @return javax.swing.JPanel
|
594 |
*/
|
595 |
private JPanel getJPanelLabels1() { |
596 |
if (jPanelLabels1 == null) { |
597 |
jLabel51 = new JLabel(); |
598 |
jLabel51.setName("jLabel5");
|
599 |
jLabel51.setHorizontalAlignment(SwingConstants.RIGHT);
|
600 |
jLabel51.setHorizontalTextPosition(SwingConstants.RIGHT);
|
601 |
jLabel51.setText(PluginServices.getText(getXYZ(), "driver") + ":"); |
602 |
jLabel51.setPreferredSize(new Dimension(140, 19)); |
603 |
jLabel31 = new JLabel(); |
604 |
jLabel31.setName("jLabel3");
|
605 |
jLabel31.setHorizontalAlignment(SwingConstants.RIGHT);
|
606 |
jLabel31.setHorizontalTextPosition(SwingConstants.RIGHT);
|
607 |
jLabel31.setText(PluginServices.getText(getXYZ(), "password") + ":"); |
608 |
jLabel31.setPreferredSize(new Dimension(140, 19)); |
609 |
jLabel21 = new JLabel(); |
610 |
jLabel21.setName("jLabel2");
|
611 |
jLabel21.setHorizontalAlignment(SwingConstants.RIGHT);
|
612 |
jLabel21.setHorizontalTextPosition(SwingConstants.RIGHT);
|
613 |
jLabel21.setText(PluginServices.getText(getXYZ(), "usuario") + ":"); |
614 |
jLabel21.setPreferredSize(new Dimension(140, 19)); |
615 |
jLabel11 = new JLabel(); |
616 |
jLabel11.setName("jLabel1");
|
617 |
jLabel11.setHorizontalAlignment(SwingConstants.TRAILING);
|
618 |
jLabel11.setText(PluginServices.getText(getXYZ(), "puerto") + ":"); |
619 |
jLabel11.setPreferredSize(new Dimension(140, 19)); |
620 |
jLabel7 = new JLabel(); |
621 |
jLabel7.setName("jLabel");
|
622 |
jLabel7.setHorizontalAlignment(SwingConstants.RIGHT);
|
623 |
jLabel7.setText(PluginServices.getText(getXYZ(), "host") + ":"); |
624 |
jLabel7.setPreferredSize(new Dimension(140, 19)); |
625 |
jLabel61 = new JLabel(); |
626 |
jLabel61.setPreferredSize(new Dimension(140, 19)); |
627 |
jLabel61.setText(PluginServices.getText(getXYZ(), "connection_name") + ":"); |
628 |
jLabel61.setHorizontalAlignment(SwingConstants.RIGHT);
|
629 |
FlowLayout flowLayout31 = new FlowLayout(); |
630 |
flowLayout31.setVgap(15);
|
631 |
jPanelLabels1 = new JPanel(); |
632 |
jPanelLabels1.setPreferredSize(new Dimension(150, 400)); |
633 |
jPanelLabels1.setLayout(flowLayout31); |
634 |
jPanelLabels1.setName("jPanelLabels");
|
635 |
jPanelLabels1.add(jLabel61, null);
|
636 |
jPanelLabels1.add(jLabel7, null);
|
637 |
jPanelLabels1.add(jLabel11, null);
|
638 |
jPanelLabels1.add(jLabel21, null);
|
639 |
jPanelLabels1.add(jLabel31, null);
|
640 |
jPanelLabels1.add(jLabelSchema, jLabelSchema.getName()); |
641 |
jPanelLabels1.add(jLabel51, null);
|
642 |
} |
643 |
return jPanelLabels1;
|
644 |
} |
645 |
|
646 |
/**
|
647 |
* This method initializes jPanelTexts1
|
648 |
*
|
649 |
* @return javax.swing.JPanel
|
650 |
*/
|
651 |
private JPanel getJPanelTexts1() { |
652 |
if (jPanelTexts1 == null) { |
653 |
FlowLayout flowLayout21 = new FlowLayout(FlowLayout.LEFT); |
654 |
flowLayout21.setVgap(15);
|
655 |
jPanelTexts1 = new JPanel(); |
656 |
jPanelTexts1.setPreferredSize(new Dimension(200, 300)); |
657 |
jPanelTexts1.setLayout(flowLayout21); |
658 |
jPanelTexts1.setName("jPanelText");
|
659 |
jPanelTexts1.add(getCmbName1(), null);
|
660 |
jPanelTexts1.add(getTxtHost1(), null);
|
661 |
jPanelTexts1.add(getTxtPort1(), null);
|
662 |
jPanelTexts1.add(getTxtUser1(), null);
|
663 |
jPanelTexts1.add(getTxtPassword1(), null);
|
664 |
jPanelTexts1.add(getTxtBD1(), null);
|
665 |
jPanelTexts1.add(getCmbDriver1(), null);
|
666 |
} |
667 |
return jPanelTexts1;
|
668 |
} |
669 |
|
670 |
/**
|
671 |
* This method initializes cmbName1
|
672 |
*
|
673 |
* @return com.iver.utiles.swing.JComboBox
|
674 |
*/
|
675 |
private JComboBox getCmbName1() { |
676 |
if (cmbName1 == null) { |
677 |
cmbName1 = new JComboBox(); |
678 |
cmbName1.setPreferredSize(new Dimension(170, 19)); |
679 |
cmbName1.setModel(new DefaultComboBoxModel()); |
680 |
cmbName1.setEditable(true);
|
681 |
} |
682 |
return cmbName1;
|
683 |
} |
684 |
|
685 |
/**
|
686 |
* This method initializes txtHost1
|
687 |
*
|
688 |
* @return javax.swing.JTextField
|
689 |
*/
|
690 |
private JTextField getTxtHost1() { |
691 |
if (txtHost1 == null) { |
692 |
txtHost1 = new JTextField(); |
693 |
txtHost1.setName("txtHost");
|
694 |
txtHost1.setPreferredSize(new Dimension(170, 19)); |
695 |
} |
696 |
return txtHost1;
|
697 |
} |
698 |
|
699 |
/**
|
700 |
* This method initializes txtPort1
|
701 |
*
|
702 |
* @return javax.swing.JTextField
|
703 |
*/
|
704 |
private JTextField getTxtPort1() { |
705 |
if (txtPort1 == null) { |
706 |
txtPort1 = new JTextField(); |
707 |
txtPort1.setName("txtPort");
|
708 |
txtPort1.setText("3306");
|
709 |
txtPort1.setHorizontalAlignment(JTextField.LEFT);
|
710 |
txtPort1.setPreferredSize(new Dimension(40, 19)); |
711 |
} |
712 |
return txtPort1;
|
713 |
} |
714 |
|
715 |
/**
|
716 |
* This method initializes txtUser1
|
717 |
*
|
718 |
* @return javax.swing.JTextField
|
719 |
*/
|
720 |
private JTextField getTxtUser1() { |
721 |
if (txtUser1 == null) { |
722 |
txtUser1 = new JTextField(); |
723 |
txtUser1.setName("txtUser");
|
724 |
txtUser1.setPreferredSize(new Dimension(170, 19)); |
725 |
} |
726 |
return txtUser1;
|
727 |
} |
728 |
|
729 |
/**
|
730 |
* This method initializes txtPassword1
|
731 |
*
|
732 |
* @return javax.swing.JPasswordField
|
733 |
*/
|
734 |
private JPasswordField getTxtPassword1() { |
735 |
if (txtPassword1 == null) { |
736 |
txtPassword1 = new JPasswordField(); |
737 |
txtPassword1.setName("txtPassword");
|
738 |
txtPassword1.setPreferredSize(new Dimension(170, 19)); |
739 |
} |
740 |
return txtPassword1;
|
741 |
} |
742 |
|
743 |
/**
|
744 |
* This method initializes txtBD1
|
745 |
*
|
746 |
* @return javax.swing.JTextField
|
747 |
*/
|
748 |
private JTextField getTxtBD1() { |
749 |
if (txtBD1 == null) { |
750 |
txtBD1 = new JTextField(); |
751 |
txtBD1.setName("txtBD");
|
752 |
txtBD1.setPreferredSize(new Dimension(170, 19)); |
753 |
} |
754 |
return txtBD1;
|
755 |
} |
756 |
|
757 |
/**
|
758 |
* This method initializes cmbDriver1
|
759 |
*
|
760 |
* @return com.iver.utiles.swing.JComboBox
|
761 |
*/
|
762 |
private JComboBox getCmbDriver1() { |
763 |
if (cmbDriver1 == null) { |
764 |
cmbDriver1 = new JComboBox(); |
765 |
cmbDriver1.setName("cmbDriver");
|
766 |
cmbDriver1.setPreferredSize(new Dimension(170, 19)); |
767 |
} |
768 |
return cmbDriver1;
|
769 |
} |
770 |
|
771 |
/**
|
772 |
* This method initializes txtSchema
|
773 |
*
|
774 |
* @return javax.swing.JTextField
|
775 |
*/
|
776 |
private JTextField getTxtSchema() { |
777 |
if (txtSchema == null) { |
778 |
txtSchema = new JTextField(); |
779 |
txtSchema.setName("txtBD");
|
780 |
txtSchema.setPreferredSize(new Dimension(170, 19)); |
781 |
} |
782 |
return txtSchema;
|
783 |
} |
784 |
} // @jve:decl-index=0:visual-constraint="7,3"
|