root / trunk / extensions / extPublish / src / com / iver / cit / gvsig / publish / gui / SelectServerPanel.java @ 6956
History | View | Annotate | Download (8.55 KB)
1 |
package com.iver.cit.gvsig.publish.gui; |
---|---|
2 |
|
3 |
import javax.swing.DefaultComboBoxModel; |
4 |
import javax.swing.JPanel; |
5 |
import java.awt.GridBagLayout; |
6 |
import java.awt.GridBagConstraints; |
7 |
import java.awt.Insets; |
8 |
|
9 |
import javax.swing.JComboBox; |
10 |
|
11 |
import com.iver.andami.PluginServices; |
12 |
import com.iver.andami.persistence.serverData.ServerDataPersistence; |
13 |
import com.iver.utiles.NotExistInXMLEntity; |
14 |
import com.iver.utiles.XMLEntity; |
15 |
import com.iver.utiles.swing.jcomboServer.JComboServer; |
16 |
import com.iver.utiles.swing.jcomboServer.ServerData; |
17 |
import javax.swing.JLabel; |
18 |
import javax.swing.JTextField; |
19 |
import java.awt.FlowLayout; |
20 |
|
21 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
22 |
*
|
23 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
24 |
*
|
25 |
* This program is free software; you can redistribute it and/or
|
26 |
* modify it under the terms of the GNU General Public License
|
27 |
* as published by the Free Software Foundation; either version 2
|
28 |
* of the License, or (at your option) any later version.
|
29 |
*
|
30 |
* This program is distributed in the hope that it will be useful,
|
31 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
32 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
33 |
* GNU General Public License for more details.
|
34 |
*
|
35 |
* You should have received a copy of the GNU General Public License
|
36 |
* along with this program; if not, write to the Free Software
|
37 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
38 |
*
|
39 |
* For more information, contact:
|
40 |
*
|
41 |
* Generalitat Valenciana
|
42 |
* Conselleria d'Infraestructures i Transport
|
43 |
* Av. Blasco Ib??ez, 50
|
44 |
* 46010 VALENCIA
|
45 |
* SPAIN
|
46 |
*
|
47 |
* +34 963862235
|
48 |
* gvsig@gva.es
|
49 |
* www.gvsig.gva.es
|
50 |
*
|
51 |
* or
|
52 |
*
|
53 |
* IVER T.I. S.A
|
54 |
* Salamanca 50
|
55 |
* 46005 Valencia
|
56 |
* Spain
|
57 |
*
|
58 |
* +34 963163400
|
59 |
* dac@iver.es
|
60 |
*/
|
61 |
/* CVS MESSAGES:
|
62 |
*
|
63 |
* $Id: SelectServerPanel.java 6956 2006-08-31 19:19:38Z jorpiell $
|
64 |
* $Log$
|
65 |
* Revision 1.1 2006-08-31 19:19:04 jorpiell
|
66 |
* *** empty log message ***
|
67 |
*
|
68 |
*
|
69 |
*/
|
70 |
/**
|
71 |
* @author Jorge Piera Llodr? (piera_jor@gva.es)
|
72 |
*/
|
73 |
public class SelectServerPanel extends JPanel{ |
74 |
|
75 |
private JPanel serverNamePanel = null; |
76 |
private JPanel serverOptionsPanel = null; |
77 |
private JComboServer cmbServer = null; |
78 |
private JComboBox cmbServerName = null; |
79 |
private JComboBox cmbServerType = null; |
80 |
private JLabel lbUrl = null; |
81 |
private JLabel lbServerName = null; |
82 |
private JLabel lbServerType = null; |
83 |
private JPanel serverPathPanel = null; |
84 |
private JLabel lbPath = null; |
85 |
private JTextField tbPath = null; |
86 |
|
87 |
/**
|
88 |
* This method initializes
|
89 |
*
|
90 |
*/
|
91 |
public SelectServerPanel() {
|
92 |
super();
|
93 |
initialize(); |
94 |
} |
95 |
|
96 |
/**
|
97 |
* This method initializes this
|
98 |
*
|
99 |
*/
|
100 |
private void initialize() { |
101 |
this.setLayout(new FlowLayout()); |
102 |
this.setPreferredSize(new java.awt.Dimension(400,90)); |
103 |
this.setSize(new java.awt.Dimension(400,90)); |
104 |
this.add(getServerNamePanel(), null); |
105 |
this.add(getServerOptionsPanel(), null); |
106 |
this.add(getServerPathPanel(), null); |
107 |
|
108 |
} |
109 |
|
110 |
/**
|
111 |
* This method initializes serverNamePanel
|
112 |
*
|
113 |
* @return javax.swing.JPanel
|
114 |
*/
|
115 |
private JPanel getServerNamePanel() { |
116 |
if (serverNamePanel == null) { |
117 |
GridBagConstraints gridBagConstraints3 = new GridBagConstraints(); |
118 |
gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL; |
119 |
gridBagConstraints3.gridx = 1;
|
120 |
gridBagConstraints3.gridy = 0;
|
121 |
gridBagConstraints3.insets = new Insets(0,5,0,5); |
122 |
gridBagConstraints3.weightx = 1.0;
|
123 |
GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); |
124 |
gridBagConstraints2.gridy = 0;
|
125 |
gridBagConstraints2.gridx = 0;
|
126 |
gridBagConstraints2.insets = new Insets(0,5,0,5); |
127 |
lbUrl = new JLabel(); |
128 |
lbUrl.setText(PluginServices.getText(this, "url")); |
129 |
serverNamePanel = new JPanel(); |
130 |
serverNamePanel.setLayout(new GridBagLayout()); |
131 |
serverNamePanel.setPreferredSize(new java.awt.Dimension(400,22)); |
132 |
serverNamePanel.setSize(new java.awt.Dimension(400,22)); |
133 |
serverNamePanel.add(lbUrl, gridBagConstraints2); |
134 |
serverNamePanel.add(getServerCombo(), gridBagConstraints3); |
135 |
} |
136 |
return serverNamePanel;
|
137 |
} |
138 |
|
139 |
/**
|
140 |
* This method initializes rerverOptionsPanel
|
141 |
*
|
142 |
* @return javax.swing.JPanel
|
143 |
*/
|
144 |
private JPanel getServerOptionsPanel() { |
145 |
if (serverOptionsPanel == null) { |
146 |
lbServerType = new JLabel(); |
147 |
lbServerType.setText(PluginServices.getText(this, "serverName")); |
148 |
lbServerType.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); |
149 |
lbServerName = new JLabel(); |
150 |
lbServerName.setText(PluginServices.getText(this, "serverType")); |
151 |
lbServerName.setPreferredSize(new java.awt.Dimension(45,16)); |
152 |
GridBagConstraints gridBagConstraints7 = new GridBagConstraints(); |
153 |
gridBagConstraints7.fill = java.awt.GridBagConstraints.HORIZONTAL; |
154 |
gridBagConstraints7.gridx = 3;
|
155 |
gridBagConstraints7.gridy = 0;
|
156 |
gridBagConstraints7.weightx = 1.0;
|
157 |
gridBagConstraints7.insets = new java.awt.Insets(5,5,5,5); |
158 |
GridBagConstraints gridBagConstraints6 = new GridBagConstraints(); |
159 |
gridBagConstraints6.fill = java.awt.GridBagConstraints.HORIZONTAL; |
160 |
gridBagConstraints6.gridx = 2;
|
161 |
gridBagConstraints6.gridy = 0;
|
162 |
gridBagConstraints6.weightx = 1.0;
|
163 |
gridBagConstraints6.insets = new java.awt.Insets(5,5,5,5); |
164 |
GridBagConstraints gridBagConstraints5 = new GridBagConstraints(); |
165 |
gridBagConstraints5.fill = java.awt.GridBagConstraints.HORIZONTAL; |
166 |
gridBagConstraints5.gridx = 1;
|
167 |
gridBagConstraints5.gridy = 0;
|
168 |
gridBagConstraints5.insets = new java.awt.Insets(5,5,5,5); |
169 |
gridBagConstraints5.weightx = 1.0;
|
170 |
GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); |
171 |
gridBagConstraints4.fill = java.awt.GridBagConstraints.HORIZONTAL; |
172 |
gridBagConstraints4.gridx = 0;
|
173 |
gridBagConstraints4.gridy = 0;
|
174 |
gridBagConstraints4.insets = new java.awt.Insets(5,5,5,5); |
175 |
gridBagConstraints4.weightx = 0.5;
|
176 |
serverOptionsPanel = new JPanel(); |
177 |
serverOptionsPanel.setLayout(new GridBagLayout()); |
178 |
serverOptionsPanel.setPreferredSize(new java.awt.Dimension(400,22)); |
179 |
serverOptionsPanel.setSize(new java.awt.Dimension(400,22)); |
180 |
serverOptionsPanel.add(lbServerName, gridBagConstraints4); |
181 |
serverOptionsPanel.add(getCmbServerName(), gridBagConstraints5); |
182 |
serverOptionsPanel.add(lbServerType, gridBagConstraints6); |
183 |
serverOptionsPanel.add(getCmbServerType(), gridBagConstraints7); |
184 |
} |
185 |
return serverOptionsPanel;
|
186 |
} |
187 |
|
188 |
/**
|
189 |
* This method initializes serverCombo
|
190 |
*
|
191 |
* @return javax.swing.JComboBox
|
192 |
*/
|
193 |
protected JComboServer getServerCombo() {
|
194 |
if (cmbServer == null) { |
195 |
cmbServer = new JComboServer();
|
196 |
cmbServer.setModel(new DefaultComboBoxModel()); |
197 |
cmbServer.setPreferredSize(new java.awt.Dimension(350, 20)); |
198 |
cmbServer.setEditable(true);
|
199 |
} |
200 |
return cmbServer;
|
201 |
} |
202 |
|
203 |
/**
|
204 |
* This method initializes serverNameCombo
|
205 |
*
|
206 |
* @return javax.swing.JComboBox
|
207 |
*/
|
208 |
protected JComboBox getCmbServerName() { |
209 |
if (cmbServerName == null) { |
210 |
cmbServerName = new JComboBox(); |
211 |
cmbServerName.setModel(new DefaultComboBoxModel()); |
212 |
cmbServerName.setPreferredSize(new java.awt.Dimension(295, 20)); |
213 |
} |
214 |
return cmbServerName;
|
215 |
} |
216 |
|
217 |
/**
|
218 |
* This method initializes serverTypeCombo
|
219 |
*
|
220 |
* @return javax.swing.JComboBox
|
221 |
*/
|
222 |
protected JComboBox getCmbServerType() { |
223 |
if (cmbServerType == null) { |
224 |
cmbServerType = new JComboBox(); |
225 |
cmbServerType.setModel(new DefaultComboBoxModel()); |
226 |
cmbServerType.setPreferredSize(new java.awt.Dimension(50, 20)); |
227 |
} |
228 |
return cmbServerType;
|
229 |
} |
230 |
|
231 |
/**
|
232 |
* This method initializes serverPathPanel
|
233 |
*
|
234 |
* @return javax.swing.JPanel
|
235 |
*/
|
236 |
private JPanel getServerPathPanel() { |
237 |
if (serverPathPanel == null) { |
238 |
GridBagConstraints gridBagConstraints10 = new GridBagConstraints(); |
239 |
gridBagConstraints10.fill = java.awt.GridBagConstraints.HORIZONTAL; |
240 |
gridBagConstraints10.gridx = 1;
|
241 |
gridBagConstraints10.gridy = 0;
|
242 |
gridBagConstraints10.weightx = 1.0;
|
243 |
gridBagConstraints10.insets = new java.awt.Insets(5,5,5,5); |
244 |
GridBagConstraints gridBagConstraints9 = new GridBagConstraints(); |
245 |
gridBagConstraints9.insets = new java.awt.Insets(5,5,5,5); |
246 |
gridBagConstraints9.gridy = 0;
|
247 |
gridBagConstraints9.gridx = 0;
|
248 |
lbPath = new JLabel(); |
249 |
lbPath.setText(PluginServices.getText(this, "server_path")); |
250 |
serverPathPanel = new JPanel(); |
251 |
serverPathPanel.setLayout(new GridBagLayout()); |
252 |
serverPathPanel.setPreferredSize(new java.awt.Dimension(400,22)); |
253 |
serverPathPanel.add(lbPath, gridBagConstraints9); |
254 |
serverPathPanel.add(getTbPath(), gridBagConstraints10); |
255 |
} |
256 |
return serverPathPanel;
|
257 |
} |
258 |
|
259 |
/**
|
260 |
* This method initializes tbPath
|
261 |
*
|
262 |
* @return javax.swing.JTextField
|
263 |
*/
|
264 |
private JTextField getTbPath() { |
265 |
if (tbPath == null) { |
266 |
tbPath = new JTextField(); |
267 |
} |
268 |
return tbPath;
|
269 |
} |
270 |
|
271 |
} // @jve:decl-index=0:visual-constraint="10,10"
|