gvsig-raster / org.gvsig.raster.wmts / trunk / org.gvsig.raster.wmts / org.gvsig.raster.wmts.swing / org.gvsig.raster.wmts.swing.impl / src / main / java / org / gvsig / raster / wmts / swing / impl / panel / main / ConnectPanel.java @ 2613
History | View | Annotate | Download (4.87 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
package org.gvsig.raster.wmts.swing.impl.panel.main; |
23 |
|
24 |
import java.awt.GridBagConstraints; |
25 |
import java.awt.GridBagLayout; |
26 |
|
27 |
import javax.swing.DefaultComboBoxModel; |
28 |
import javax.swing.JButton; |
29 |
import javax.swing.JCheckBox; |
30 |
import javax.swing.JPanel; |
31 |
|
32 |
import org.gvsig.i18n.Messages; |
33 |
import org.gvsig.utils.swing.jcomboServer.JComboServer; |
34 |
|
35 |
/**
|
36 |
* Connect panel
|
37 |
*
|
38 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
39 |
*/
|
40 |
public class ConnectPanel extends JPanel { |
41 |
private static final long serialVersionUID = 1L; |
42 |
private JButton btnConnect = null; |
43 |
private JButton btnCancel = null; |
44 |
private JComboServer cmbHost = null; |
45 |
private JCheckBox chkCaching = null; |
46 |
private JPanel pSouth = null; |
47 |
private JPanel pMain = null; |
48 |
|
49 |
public ConnectPanel() {
|
50 |
init(); |
51 |
} |
52 |
|
53 |
public void init() { |
54 |
setLayout(new GridBagLayout()); |
55 |
setBorder(javax.swing.BorderFactory.createTitledBorder( |
56 |
null, Messages.getText("server"), |
57 |
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
58 |
javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); |
59 |
|
60 |
GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); |
61 |
gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
|
62 |
gridBagConstraints1.anchor = GridBagConstraints.WEST;
|
63 |
gridBagConstraints1.gridx = 0;
|
64 |
gridBagConstraints1.gridy = 0;
|
65 |
gridBagConstraints1.weightx = 1.0;
|
66 |
gridBagConstraints1.insets = new java.awt.Insets(0, 2, 2, 0); |
67 |
add(getTxtHost(), gridBagConstraints1); |
68 |
|
69 |
gridBagConstraints1.gridy = 1;
|
70 |
add(getJPanelSouth(), gridBagConstraints1); |
71 |
} |
72 |
|
73 |
public JPanel getJPanelSouth() { |
74 |
if(pSouth == null) { |
75 |
pSouth = new JPanel(); |
76 |
pSouth.setLayout(new GridBagLayout()); |
77 |
GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); |
78 |
gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
|
79 |
gridBagConstraints1.anchor = GridBagConstraints.WEST;
|
80 |
gridBagConstraints1.gridx = 0;
|
81 |
gridBagConstraints1.gridy = 0;
|
82 |
gridBagConstraints1.weightx = 1.0;
|
83 |
gridBagConstraints1.insets = new java.awt.Insets(0, 2, 0, 0); |
84 |
pSouth.add(getChkCaching(), gridBagConstraints1); |
85 |
|
86 |
gridBagConstraints1.anchor = GridBagConstraints.EAST;
|
87 |
gridBagConstraints1.gridx = 1;
|
88 |
gridBagConstraints1.gridy = 0;
|
89 |
gridBagConstraints1.weightx = 0;
|
90 |
pSouth.add(getBtnConnect(), gridBagConstraints1); |
91 |
|
92 |
gridBagConstraints1.anchor = GridBagConstraints.EAST;
|
93 |
gridBagConstraints1.gridx = 2;
|
94 |
gridBagConstraints1.gridy = 0;
|
95 |
pSouth.add(getBtnCancel(), gridBagConstraints1); |
96 |
|
97 |
|
98 |
} |
99 |
return pSouth;
|
100 |
} |
101 |
|
102 |
public JPanel getJPanelMain() { |
103 |
if(pMain == null) |
104 |
pMain = new JPanel(); |
105 |
return pMain;
|
106 |
} |
107 |
|
108 |
/**
|
109 |
* This method initializes btnConnect
|
110 |
* @return javax.swing.JButton
|
111 |
*/
|
112 |
public JButton getBtnConnect() { |
113 |
if (btnConnect == null) { |
114 |
btnConnect = new JButton(); |
115 |
btnConnect.setPreferredSize(new java.awt.Dimension(110, 20)); |
116 |
btnConnect.setText(Messages.getText("conectar"));
|
117 |
} |
118 |
return btnConnect;
|
119 |
} |
120 |
|
121 |
/**
|
122 |
* This method initializes btnCancel
|
123 |
* @return javax.swing.JButton
|
124 |
*/
|
125 |
public JButton getBtnCancel() { |
126 |
if (btnCancel == null) { |
127 |
btnCancel = new JButton(); |
128 |
btnCancel.setEnabled(false);
|
129 |
btnCancel.setPreferredSize(new java.awt.Dimension(110, 20)); |
130 |
btnCancel.setText(Messages.getText("cancel"));
|
131 |
} |
132 |
return btnCancel;
|
133 |
} |
134 |
|
135 |
/**
|
136 |
* This method initializes txtHost
|
137 |
*
|
138 |
* @return javax.swing.JTextField
|
139 |
*/
|
140 |
public JComboServer getTxtHost() {
|
141 |
if (cmbHost == null) { |
142 |
cmbHost = new JComboServer();
|
143 |
cmbHost.setModel(new DefaultComboBoxModel()); |
144 |
cmbHost.setPreferredSize(new java.awt.Dimension(350, 20)); |
145 |
cmbHost.setEditable(true);
|
146 |
} |
147 |
|
148 |
return cmbHost;
|
149 |
} |
150 |
|
151 |
/**
|
152 |
* This method initializes chkCaching
|
153 |
*
|
154 |
* @return javax.swing.JCheckBox
|
155 |
*/
|
156 |
public JCheckBox getChkCaching() { |
157 |
if (chkCaching == null) { |
158 |
chkCaching = new JCheckBox(); |
159 |
chkCaching.setText(Messages.getText("refresh_capabilities"));
|
160 |
chkCaching.setToolTipText(Messages.getText("refresh_capabilities_tooltip"));
|
161 |
} |
162 |
return chkCaching;
|
163 |
} |
164 |
} |