Revision 11867 branches/v10/extensions/extJDBC/src/com/iver/cit/gvsig/jdbc_spatial/gui/jdbcwizard/ConnectionPanel.java
ConnectionPanel.java | ||
---|---|---|
22 | 22 |
import com.iver.utiles.swing.JComboBox; |
23 | 23 |
import com.iver.utiles.swing.wizard.Step; |
24 | 24 |
import com.iver.utiles.swing.wizard.WizardControl; |
25 |
import java.awt.Rectangle; |
|
26 |
import java.awt.Dimension; |
|
27 |
import javax.swing.SwingConstants; |
|
28 |
import java.lang.String; |
|
25 | 29 |
|
26 | 30 |
|
27 | 31 |
/** |
... | ... | |
52 | 56 |
|
53 | 57 |
private JPanel jPanel = null; |
54 | 58 |
|
59 |
private JLabel jLabelSchema = null; |
|
55 | 60 |
|
61 |
private ConnectionPanel XYZ = null; |
|
56 | 62 |
|
63 |
private JPanel jPanel1 = null; |
|
64 |
|
|
65 |
private JPanel jPanelLabels1 = null; |
|
66 |
|
|
67 |
private JLabel jLabel61 = null; |
|
68 |
|
|
69 |
private JLabel jLabel7 = null; |
|
70 |
|
|
71 |
private JLabel jLabel11 = null; |
|
72 |
|
|
73 |
private JLabel jLabel21 = null; |
|
74 |
|
|
75 |
private JLabel jLabel31 = null; |
|
76 |
|
|
77 |
private JLabel jLabel51 = null; |
|
78 |
|
|
79 |
private JPanel jPanelTexts1 = null; |
|
80 |
|
|
81 |
private JComboBox cmbName1 = null; |
|
82 |
|
|
83 |
private JTextField txtHost1 = null; |
|
84 |
|
|
85 |
private JTextField txtPort1 = null; |
|
86 |
|
|
87 |
private JTextField txtUser1 = null; |
|
88 |
|
|
89 |
private JPasswordField txtPassword1 = null; |
|
90 |
|
|
91 |
private JTextField txtBD1 = null; |
|
92 |
|
|
93 |
private JComboBox cmbDriver1 = null; |
|
94 |
|
|
95 |
private JTextField txtSchema = null; |
|
96 |
|
|
97 |
|
|
98 |
|
|
57 | 99 |
/** |
58 | 100 |
* This is the default constructor |
59 | 101 |
*/ |
... | ... | |
82 | 124 |
*/ |
83 | 125 |
private JPanel getJPanelLabels() { |
84 | 126 |
if (jPanelLabels == null) { |
127 |
String string = PluginServices.getText(getXYZ(), "schema") + ":"; |
|
128 |
jLabelSchema = new JLabel(); |
|
129 |
jLabelSchema.setName("jLabel4"); |
|
130 |
jLabelSchema.setHorizontalAlignment(SwingConstants.RIGHT); |
|
131 |
jLabelSchema.setHorizontalTextPosition(SwingConstants.RIGHT); |
|
132 |
jLabelSchema.setText(string); |
|
133 |
jLabelSchema.setPreferredSize(new Dimension(140, 19)); |
|
85 | 134 |
FlowLayout flowLayout3 = new FlowLayout(); |
86 | 135 |
flowLayout3.setVgap(15); |
87 | 136 |
jLabel5 = new JLabel(); |
... | ... | |
128 | 177 |
jPanelLabels.add(jLabel2, null); |
129 | 178 |
jPanelLabels.add(jLabel3, null); |
130 | 179 |
jPanelLabels.add(jLabel4, null); |
180 |
jPanelLabels.add(jLabelSchema, null); |
|
131 | 181 |
jPanelLabels.add(jLabel5, null); |
132 | 182 |
|
133 | 183 |
} |
... | ... | |
161 | 211 |
flowLayout2.setVgap(15); |
162 | 212 |
jPanelTexts = new JPanel(); |
163 | 213 |
jPanelTexts.setLayout(flowLayout2); |
164 |
jPanelTexts.setPreferredSize(new java.awt.Dimension(200,400));
|
|
214 |
jPanelTexts.setPreferredSize(new Dimension(200, 300));
|
|
165 | 215 |
|
166 | 216 |
jPanelTexts.setName("jPanelText"); |
167 | 217 |
jPanelTexts.add(getCmbName(), null); |
... | ... | |
170 | 220 |
jPanelTexts.add(getTxtUser(), null); |
171 | 221 |
jPanelTexts.add(getTxtPassword(), null); |
172 | 222 |
jPanelTexts.add(getTxtBD(), null); |
223 |
jPanelTexts.add(getTxtSchema(), null); |
|
173 | 224 |
jPanelTexts.add(getCmbDriver(), null); |
174 | 225 |
} |
175 | 226 |
|
... | ... | |
321 | 372 |
{ |
322 | 373 |
ConnectionSettings cs = new ConnectionSettings(); |
323 | 374 |
cs.setDb(getDBName()); |
375 |
cs.setSchema(getSchema()); |
|
324 | 376 |
cs.setDriver(getDriver()); |
325 | 377 |
cs.setHost(getHost()); |
326 | 378 |
cs.setPort(getPort()); |
... | ... | |
329 | 381 |
cs.setName(getSettingsName()); |
330 | 382 |
return cs; |
331 | 383 |
} |
384 |
|
|
385 |
public String getSchema() { |
|
386 |
return txtSchema.getText(); |
|
387 |
} |
|
332 | 388 |
|
333 | 389 |
/** |
334 | 390 |
* Makes persistent the connection settings of this panel. |
... | ... | |
337 | 393 |
{ |
338 | 394 |
ConnectionSettings cs = new ConnectionSettings(); |
339 | 395 |
cs.setDb(getDBName()); |
396 |
cs.setSchema(getSchema()); |
|
340 | 397 |
cs.setDriver(getDriver()); |
341 | 398 |
cs.setHost(getHost()); |
342 | 399 |
cs.setPort(getPort()); |
... | ... | |
493 | 550 |
if (jPanel == null) { |
494 | 551 |
jPanel = new JPanel(); |
495 | 552 |
jPanel.setLayout(new BorderLayout()); |
496 |
jPanel.setBounds(0, 0, 400, 240);
|
|
553 |
jPanel.setBounds(0, 0, 363, 240);
|
|
497 | 554 |
jPanel.add(getJPanelLabels(), java.awt.BorderLayout.WEST); |
498 | 555 |
jPanel.add(getJPanelTexts(), java.awt.BorderLayout.EAST); |
499 | 556 |
} |
500 | 557 |
return jPanel; |
501 | 558 |
} |
559 |
|
|
560 |
/** |
|
561 |
* This method initializes XYZ |
|
562 |
* |
|
563 |
* @return com.iver.cit.gvsig.jdbc_spatial.gui.jdbcwizard.ConnectionPanel |
|
564 |
*/ |
|
565 |
private ConnectionPanel getXYZ() { |
|
566 |
if (XYZ == null) { |
|
567 |
XYZ = new ConnectionPanel(); |
|
568 |
XYZ.setLayout(null); |
|
569 |
XYZ.setSize(new java.awt.Dimension(335,240)); |
|
570 |
XYZ.add(getJPanel1(), null); |
|
571 |
} |
|
572 |
return XYZ; |
|
573 |
} |
|
574 |
|
|
575 |
/** |
|
576 |
* This method initializes jPanel1 |
|
577 |
* |
|
578 |
* @return javax.swing.JPanel |
|
579 |
*/ |
|
580 |
private JPanel getJPanel1() { |
|
581 |
if (jPanel1 == null) { |
|
582 |
jPanel1 = new JPanel(); |
|
583 |
jPanel1.setLayout(new BorderLayout()); |
|
584 |
jPanel1.setBounds(new Rectangle(0, 0, 363, 240)); |
|
585 |
jPanel1.add(getJPanelLabels1(), java.awt.BorderLayout.WEST); |
|
586 |
jPanel1.add(getJPanelTexts1(), java.awt.BorderLayout.EAST); |
|
587 |
} |
|
588 |
return jPanel1; |
|
589 |
} |
|
590 |
|
|
591 |
/** |
|
592 |
* This method initializes jPanelLabels1 |
|
593 |
* |
|
594 |
* @return javax.swing.JPanel |
|
595 |
*/ |
|
596 |
private JPanel getJPanelLabels1() { |
|
597 |
if (jPanelLabels1 == null) { |
|
598 |
jLabel51 = new JLabel(); |
|
599 |
jLabel51.setName("jLabel5"); |
|
600 |
jLabel51.setHorizontalAlignment(SwingConstants.RIGHT); |
|
601 |
jLabel51.setHorizontalTextPosition(SwingConstants.RIGHT); |
|
602 |
jLabel51.setText(PluginServices.getText(getXYZ(), "driver") + ":"); |
|
603 |
jLabel51.setPreferredSize(new Dimension(140, 19)); |
|
604 |
jLabel31 = new JLabel(); |
|
605 |
jLabel31.setName("jLabel3"); |
|
606 |
jLabel31.setHorizontalAlignment(SwingConstants.RIGHT); |
|
607 |
jLabel31.setHorizontalTextPosition(SwingConstants.RIGHT); |
|
608 |
jLabel31.setText(PluginServices.getText(getXYZ(), "password") + ":"); |
|
609 |
jLabel31.setPreferredSize(new Dimension(140, 19)); |
|
610 |
jLabel21 = new JLabel(); |
|
611 |
jLabel21.setName("jLabel2"); |
|
612 |
jLabel21.setHorizontalAlignment(SwingConstants.RIGHT); |
|
613 |
jLabel21.setHorizontalTextPosition(SwingConstants.RIGHT); |
|
614 |
jLabel21.setText(PluginServices.getText(getXYZ(), "usuario") + ":"); |
|
615 |
jLabel21.setPreferredSize(new Dimension(140, 19)); |
|
616 |
jLabel11 = new JLabel(); |
|
617 |
jLabel11.setName("jLabel1"); |
|
618 |
jLabel11.setHorizontalAlignment(SwingConstants.TRAILING); |
|
619 |
jLabel11.setText(PluginServices.getText(getXYZ(), "puerto") + ":"); |
|
620 |
jLabel11.setPreferredSize(new Dimension(140, 19)); |
|
621 |
jLabel7 = new JLabel(); |
|
622 |
jLabel7.setName("jLabel"); |
|
623 |
jLabel7.setHorizontalAlignment(SwingConstants.RIGHT); |
|
624 |
jLabel7.setText(PluginServices.getText(getXYZ(), "host") + ":"); |
|
625 |
jLabel7.setPreferredSize(new Dimension(140, 19)); |
|
626 |
jLabel61 = new JLabel(); |
|
627 |
jLabel61.setPreferredSize(new Dimension(140, 19)); |
|
628 |
jLabel61.setText(PluginServices.getText(getXYZ(), "connection_name") + ":"); |
|
629 |
jLabel61.setHorizontalAlignment(SwingConstants.RIGHT); |
|
630 |
FlowLayout flowLayout31 = new FlowLayout(); |
|
631 |
flowLayout31.setVgap(15); |
|
632 |
jPanelLabels1 = new JPanel(); |
|
633 |
jPanelLabels1.setPreferredSize(new Dimension(150, 400)); |
|
634 |
jPanelLabels1.setLayout(flowLayout31); |
|
635 |
jPanelLabels1.setName("jPanelLabels"); |
|
636 |
jPanelLabels1.add(jLabel61, null); |
|
637 |
jPanelLabels1.add(jLabel7, null); |
|
638 |
jPanelLabels1.add(jLabel11, null); |
|
639 |
jPanelLabels1.add(jLabel21, null); |
|
640 |
jPanelLabels1.add(jLabel31, null); |
|
641 |
jPanelLabels1.add(jLabelSchema, jLabelSchema.getName()); |
|
642 |
jPanelLabels1.add(jLabel51, null); |
|
643 |
} |
|
644 |
return jPanelLabels1; |
|
645 |
} |
|
646 |
|
|
647 |
/** |
|
648 |
* This method initializes jPanelTexts1 |
|
649 |
* |
|
650 |
* @return javax.swing.JPanel |
|
651 |
*/ |
|
652 |
private JPanel getJPanelTexts1() { |
|
653 |
if (jPanelTexts1 == null) { |
|
654 |
FlowLayout flowLayout21 = new FlowLayout(FlowLayout.LEFT); |
|
655 |
flowLayout21.setVgap(15); |
|
656 |
jPanelTexts1 = new JPanel(); |
|
657 |
jPanelTexts1.setPreferredSize(new Dimension(200, 300)); |
|
658 |
jPanelTexts1.setLayout(flowLayout21); |
|
659 |
jPanelTexts1.setName("jPanelText"); |
|
660 |
jPanelTexts1.add(getCmbName1(), null); |
|
661 |
jPanelTexts1.add(getTxtHost1(), null); |
|
662 |
jPanelTexts1.add(getTxtPort1(), null); |
|
663 |
jPanelTexts1.add(getTxtUser1(), null); |
|
664 |
jPanelTexts1.add(getTxtPassword1(), null); |
|
665 |
jPanelTexts1.add(getTxtBD1(), null); |
|
666 |
jPanelTexts1.add(getCmbDriver1(), null); |
|
667 |
} |
|
668 |
return jPanelTexts1; |
|
669 |
} |
|
670 |
|
|
671 |
/** |
|
672 |
* This method initializes cmbName1 |
|
673 |
* |
|
674 |
* @return com.iver.utiles.swing.JComboBox |
|
675 |
*/ |
|
676 |
private JComboBox getCmbName1() { |
|
677 |
if (cmbName1 == null) { |
|
678 |
cmbName1 = new JComboBox(); |
|
679 |
cmbName1.setPreferredSize(new Dimension(170, 19)); |
|
680 |
cmbName1.setModel(new DefaultComboBoxModel()); |
|
681 |
cmbName1.setEditable(true); |
|
682 |
} |
|
683 |
return cmbName1; |
|
684 |
} |
|
685 |
|
|
686 |
/** |
|
687 |
* This method initializes txtHost1 |
|
688 |
* |
|
689 |
* @return javax.swing.JTextField |
|
690 |
*/ |
|
691 |
private JTextField getTxtHost1() { |
|
692 |
if (txtHost1 == null) { |
|
693 |
txtHost1 = new JTextField(); |
|
694 |
txtHost1.setName("txtHost"); |
|
695 |
txtHost1.setPreferredSize(new Dimension(170, 19)); |
|
696 |
} |
|
697 |
return txtHost1; |
|
698 |
} |
|
699 |
|
|
700 |
/** |
|
701 |
* This method initializes txtPort1 |
|
702 |
* |
|
703 |
* @return javax.swing.JTextField |
|
704 |
*/ |
|
705 |
private JTextField getTxtPort1() { |
|
706 |
if (txtPort1 == null) { |
|
707 |
txtPort1 = new JTextField(); |
|
708 |
txtPort1.setName("txtPort"); |
|
709 |
txtPort1.setText("3306"); |
|
710 |
txtPort1.setHorizontalAlignment(JTextField.LEFT); |
|
711 |
txtPort1.setPreferredSize(new Dimension(40, 19)); |
|
712 |
} |
|
713 |
return txtPort1; |
|
714 |
} |
|
715 |
|
|
716 |
/** |
|
717 |
* This method initializes txtUser1 |
|
718 |
* |
|
719 |
* @return javax.swing.JTextField |
|
720 |
*/ |
|
721 |
private JTextField getTxtUser1() { |
|
722 |
if (txtUser1 == null) { |
|
723 |
txtUser1 = new JTextField(); |
|
724 |
txtUser1.setName("txtUser"); |
|
725 |
txtUser1.setPreferredSize(new Dimension(170, 19)); |
|
726 |
} |
|
727 |
return txtUser1; |
|
728 |
} |
|
729 |
|
|
730 |
/** |
|
731 |
* This method initializes txtPassword1 |
|
732 |
* |
|
733 |
* @return javax.swing.JPasswordField |
|
734 |
*/ |
|
735 |
private JPasswordField getTxtPassword1() { |
|
736 |
if (txtPassword1 == null) { |
|
737 |
txtPassword1 = new JPasswordField(); |
|
738 |
txtPassword1.setName("txtPassword"); |
|
739 |
txtPassword1.setPreferredSize(new Dimension(170, 19)); |
|
740 |
} |
|
741 |
return txtPassword1; |
|
742 |
} |
|
743 |
|
|
744 |
/** |
|
745 |
* This method initializes txtBD1 |
|
746 |
* |
|
747 |
* @return javax.swing.JTextField |
|
748 |
*/ |
|
749 |
private JTextField getTxtBD1() { |
|
750 |
if (txtBD1 == null) { |
|
751 |
txtBD1 = new JTextField(); |
|
752 |
txtBD1.setName("txtBD"); |
|
753 |
txtBD1.setPreferredSize(new Dimension(170, 19)); |
|
754 |
} |
|
755 |
return txtBD1; |
|
756 |
} |
|
757 |
|
|
758 |
/** |
|
759 |
* This method initializes cmbDriver1 |
|
760 |
* |
|
761 |
* @return com.iver.utiles.swing.JComboBox |
|
762 |
*/ |
|
763 |
private JComboBox getCmbDriver1() { |
|
764 |
if (cmbDriver1 == null) { |
|
765 |
cmbDriver1 = new JComboBox(); |
|
766 |
cmbDriver1.setName("cmbDriver"); |
|
767 |
cmbDriver1.setPreferredSize(new Dimension(170, 19)); |
|
768 |
} |
|
769 |
return cmbDriver1; |
|
770 |
} |
|
771 |
|
|
772 |
/** |
|
773 |
* This method initializes txtSchema |
|
774 |
* |
|
775 |
* @return javax.swing.JTextField |
|
776 |
*/ |
|
777 |
private JTextField getTxtSchema() { |
|
778 |
if (txtSchema == null) { |
|
779 |
txtSchema = new JTextField(); |
|
780 |
txtSchema.setName("txtBD"); |
|
781 |
txtSchema.setPreferredSize(new Dimension(170, 19)); |
|
782 |
} |
|
783 |
return txtSchema; |
|
784 |
} |
|
502 | 785 |
} // @jve:decl-index=0:visual-constraint="7,3" |
Also available in: Unified diff