Revision 1222
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectProperties.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
package com.iver.cit.gvsig.project; |
|
42 |
|
|
43 |
|
|
44 |
import java.awt.Color; |
|
45 |
import java.io.File; |
|
46 |
|
|
47 |
import javax.swing.JColorChooser; |
|
48 |
import javax.swing.JPanel; |
|
49 |
|
|
50 |
import com.iver.andami.PluginServices; |
|
51 |
import com.iver.andami.Utilities; |
|
52 |
import com.iver.andami.ui.mdiManager.View; |
|
53 |
import com.iver.andami.ui.mdiManager.ViewInfo; |
|
54 |
import com.iver.cit.gvsig.project.castor.Project; |
|
55 |
|
|
56 |
|
|
57 |
/** |
|
58 |
* Propiedades del proyecto |
|
59 |
* |
|
60 |
* @author Fernando Gonz?lez Cort?s |
|
61 |
*/ |
|
62 |
public class ProjectProperties extends JPanel implements View { |
|
63 |
private Project project = null; |
|
64 |
private javax.swing.JPanel pane = null; |
|
65 |
private javax.swing.JPanel jPanel = null; |
|
66 |
private javax.swing.JLabel jLabel = null; |
|
67 |
private javax.swing.JLabel jLabel1 = null; |
|
68 |
private javax.swing.JLabel jLabel2 = null; |
|
69 |
private javax.swing.JLabel jLabel3 = null; |
|
70 |
private javax.swing.JLabel jLabel4 = null; |
|
71 |
private javax.swing.JTextField txtName = null; |
|
72 |
private javax.swing.JTextField txtPath = null; |
|
73 |
private javax.swing.JTextField txtCreationDate = null; |
|
74 |
private javax.swing.JTextField txtModificationDate = null; |
|
75 |
private javax.swing.JTextField txtOwner = null; |
|
76 |
private javax.swing.JLabel jLabel5 = null; |
|
77 |
private javax.swing.JTextArea txtComments = null; |
|
78 |
private javax.swing.JButton btnOk = null; |
|
79 |
private javax.swing.JButton btnCancel = null; |
|
80 |
private javax.swing.JLabel jLabel6 = null; |
|
81 |
private javax.swing.JLabel lblColor = null; |
|
82 |
private javax.swing.JButton btnColor = null; |
|
83 |
private javax.swing.JScrollPane jScrollPane = null; |
|
84 |
private ViewInfo m_viewinfo = null; |
|
85 |
/** |
|
86 |
* This is the default constructor |
|
87 |
* |
|
88 |
* @param owner Frame padre del di?logo |
|
89 |
* @param p Proyecto cuyos datos se muestran en el di?logo |
|
90 |
*/ |
|
91 |
public ProjectProperties(Project p) { |
|
92 |
project = p; |
|
93 |
initialize(); |
|
94 |
} |
|
95 |
|
|
96 |
/** |
|
97 |
* This method initializes this |
|
98 |
*/ |
|
99 |
private void initialize() { |
|
100 |
setLayout(new java.awt.BorderLayout()); |
|
101 |
add(getJPanel(), java.awt.BorderLayout.CENTER); |
|
102 |
|
|
103 |
getTxtName().setText(project.getName()); |
|
104 |
|
|
105 |
String path = project.getPath(); |
|
106 |
|
|
107 |
if (path != null) { |
|
108 |
File f = new File(path); |
|
109 |
getTxtPath().setText(f.toString()); |
|
110 |
} else { |
|
111 |
getTxtPath().setText(""); |
|
112 |
} |
|
113 |
|
|
114 |
getTxtOwner().setText(project.getOwner()); |
|
115 |
getTxtComments().setText(project.getComments()); |
|
116 |
getTxtCreationDate().setText(project.getCreationDate()); |
|
117 |
getTxtModificationDate().setText(project.getModificationDate()); |
|
118 |
|
|
119 |
getLblColor().setBackground(project.getSelectionColor()); |
|
120 |
} |
|
121 |
|
|
122 |
/** |
|
123 |
* This method initializes jPanel |
|
124 |
* |
|
125 |
* @return javax.swing.JPanel |
|
126 |
*/ |
|
127 |
private javax.swing.JPanel getJPanel() { |
|
128 |
if (jPanel == null) { |
|
129 |
jPanel = new javax.swing.JPanel(); |
|
130 |
jPanel.add(getJLabel(), null); |
|
131 |
jPanel.add(getTxtName(), null); |
|
132 |
jPanel.add(getJLabel1(), null); |
|
133 |
jPanel.add(getTxtPath(), null); |
|
134 |
jPanel.add(getJLabel2(), null); |
|
135 |
jPanel.add(getTxtCreationDate(), null); |
|
136 |
jPanel.add(getJLabel3(), null); |
|
137 |
jPanel.add(getTxtModificationDate(), null); |
|
138 |
jPanel.add(getJLabel4(), null); |
|
139 |
jPanel.add(getTxtOwner(), null); |
|
140 |
jPanel.add(getJLabel5(), null); |
|
141 |
jPanel.add(getJScrollPane(), null); |
|
142 |
jPanel.add(getJLabel6(), null); |
|
143 |
jPanel.add(getLblColor(), null); |
|
144 |
jPanel.add(getBtnColor(), null); |
|
145 |
jPanel.add(getBtnOk(), null); |
|
146 |
jPanel.add(getBtnCancel(), null); |
|
147 |
jPanel.setPreferredSize(new java.awt.Dimension(150, 10)); |
|
148 |
} |
|
149 |
|
|
150 |
return jPanel; |
|
151 |
} |
|
152 |
|
|
153 |
/** |
|
154 |
* This method initializes jLabel |
|
155 |
* |
|
156 |
* @return javax.swing.JLabel |
|
157 |
*/ |
|
158 |
private javax.swing.JLabel getJLabel() { |
|
159 |
if (jLabel == null) { |
|
160 |
jLabel = new javax.swing.JLabel(); |
|
161 |
jLabel.setText(PluginServices.getText(this, "nombre_sesion") + ":"); |
|
162 |
jLabel.setPreferredSize(new java.awt.Dimension(149, 16)); |
|
163 |
} |
|
164 |
|
|
165 |
return jLabel; |
|
166 |
} |
|
167 |
|
|
168 |
/** |
|
169 |
* This method initializes jLabel1 |
|
170 |
* |
|
171 |
* @return javax.swing.JLabel |
|
172 |
*/ |
|
173 |
private javax.swing.JLabel getJLabel1() { |
|
174 |
if (jLabel1 == null) { |
|
175 |
jLabel1 = new javax.swing.JLabel(); |
|
176 |
jLabel1.setText(PluginServices.getText(this, "path") + ":"); |
|
177 |
jLabel1.setPreferredSize(new java.awt.Dimension(149, 16)); |
|
178 |
} |
|
179 |
|
|
180 |
return jLabel1; |
|
181 |
} |
|
182 |
|
|
183 |
/** |
|
184 |
* This method initializes jLabel2 |
|
185 |
* |
|
186 |
* @return javax.swing.JLabel |
|
187 |
*/ |
|
188 |
private javax.swing.JLabel getJLabel2() { |
|
189 |
if (jLabel2 == null) { |
|
190 |
jLabel2 = new javax.swing.JLabel(); |
|
191 |
jLabel2.setText(PluginServices.getText(this, "creation_date") + ":"); |
|
192 |
jLabel2.setPreferredSize(new java.awt.Dimension(149, 16)); |
|
193 |
} |
|
194 |
|
|
195 |
return jLabel2; |
|
196 |
} |
|
197 |
|
|
198 |
/** |
|
199 |
* This method initializes jLabel3 |
|
200 |
* |
|
201 |
* @return javax.swing.JLabel |
|
202 |
*/ |
|
203 |
private javax.swing.JLabel getJLabel3() { |
|
204 |
if (jLabel3 == null) { |
|
205 |
jLabel3 = new javax.swing.JLabel(); |
|
206 |
jLabel3.setText(PluginServices.getText(this, "modification_date") + |
|
207 |
":"); |
|
208 |
jLabel3.setPreferredSize(new java.awt.Dimension(149, 16)); |
|
209 |
} |
|
210 |
|
|
211 |
return jLabel3; |
|
212 |
} |
|
213 |
|
|
214 |
/** |
|
215 |
* This method initializes jLabel4 |
|
216 |
* |
|
217 |
* @return javax.swing.JLabel |
|
218 |
*/ |
|
219 |
private javax.swing.JLabel getJLabel4() { |
|
220 |
if (jLabel4 == null) { |
|
221 |
jLabel4 = new javax.swing.JLabel(); |
|
222 |
jLabel4.setText(PluginServices.getText(this, "owner") + ":"); |
|
223 |
jLabel4.setPreferredSize(new java.awt.Dimension(149, 16)); |
|
224 |
} |
|
225 |
|
|
226 |
return jLabel4; |
|
227 |
} |
|
228 |
|
|
229 |
/** |
|
230 |
* This method initializes txtName |
|
231 |
* |
|
232 |
* @return javax.swing.JTextField |
|
233 |
*/ |
|
234 |
private javax.swing.JTextField getTxtName() { |
|
235 |
if (txtName == null) { |
|
236 |
txtName = new javax.swing.JTextField(); |
|
237 |
txtName.setPreferredSize(new java.awt.Dimension(160, 20)); |
|
238 |
} |
|
239 |
|
|
240 |
return txtName; |
|
241 |
} |
|
242 |
|
|
243 |
/** |
|
244 |
* This method initializes txtPath |
|
245 |
* |
|
246 |
* @return javax.swing.JTextField |
|
247 |
*/ |
|
248 |
private javax.swing.JTextField getTxtPath() { |
|
249 |
if (txtPath == null) { |
|
250 |
txtPath = new javax.swing.JTextField(); |
|
251 |
txtPath.setPreferredSize(new java.awt.Dimension(160, 20)); |
|
252 |
txtPath.setEditable(false); |
|
253 |
txtPath.setBackground(java.awt.Color.white); |
|
254 |
} |
|
255 |
|
|
256 |
return txtPath; |
|
257 |
} |
|
258 |
|
|
259 |
/** |
|
260 |
* This method initializes txtCreationDate |
|
261 |
* |
|
262 |
* @return javax.swing.JTextField |
|
263 |
*/ |
|
264 |
private javax.swing.JTextField getTxtCreationDate() { |
|
265 |
if (txtCreationDate == null) { |
|
266 |
txtCreationDate = new javax.swing.JTextField(); |
|
267 |
txtCreationDate.setPreferredSize(new java.awt.Dimension(160, 20)); |
|
268 |
txtCreationDate.setEditable(false); |
|
269 |
txtCreationDate.setBackground(java.awt.Color.white); |
|
270 |
} |
|
271 |
|
|
272 |
return txtCreationDate; |
|
273 |
} |
|
274 |
|
|
275 |
/** |
|
276 |
* This method initializes txtModificationDate |
|
277 |
* |
|
278 |
* @return javax.swing.JTextField |
|
279 |
*/ |
|
280 |
private javax.swing.JTextField getTxtModificationDate() { |
|
281 |
if (txtModificationDate == null) { |
|
282 |
txtModificationDate = new javax.swing.JTextField(); |
|
283 |
txtModificationDate.setPreferredSize(new java.awt.Dimension(160, 20)); |
|
284 |
txtModificationDate.setEditable(false); |
|
285 |
txtModificationDate.setBackground(java.awt.Color.white); |
|
286 |
} |
|
287 |
|
|
288 |
return txtModificationDate; |
|
289 |
} |
|
290 |
|
|
291 |
/** |
|
292 |
* This method initializes txtOwner |
|
293 |
* |
|
294 |
* @return javax.swing.JTextField |
|
295 |
*/ |
|
296 |
private javax.swing.JTextField getTxtOwner() { |
|
297 |
if (txtOwner == null) { |
|
298 |
txtOwner = new javax.swing.JTextField(); |
|
299 |
txtOwner.setPreferredSize(new java.awt.Dimension(160, 20)); |
|
300 |
} |
|
301 |
|
|
302 |
return txtOwner; |
|
303 |
} |
|
304 |
|
|
305 |
/** |
|
306 |
* This method initializes jLabel5 |
|
307 |
* |
|
308 |
* @return javax.swing.JLabel |
|
309 |
*/ |
|
310 |
private javax.swing.JLabel getJLabel5() { |
|
311 |
if (jLabel5 == null) { |
|
312 |
jLabel5 = new javax.swing.JLabel(); |
|
313 |
jLabel5.setText(PluginServices.getText(this, "comentarios") + ":"); |
|
314 |
jLabel5.setPreferredSize(new java.awt.Dimension(119, 16)); |
|
315 |
jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); |
|
316 |
} |
|
317 |
|
|
318 |
return jLabel5; |
|
319 |
} |
|
320 |
|
|
321 |
/** |
|
322 |
* This method initializes txtComments |
|
323 |
* |
|
324 |
* @return javax.swing.JTextArea |
|
325 |
*/ |
|
326 |
private javax.swing.JTextArea getTxtComments() { |
|
327 |
if (txtComments == null) { |
|
328 |
txtComments = new javax.swing.JTextArea(); |
|
329 |
txtComments.setRows(1); |
|
330 |
txtComments.setColumns(20); |
|
331 |
} |
|
332 |
|
|
333 |
return txtComments; |
|
334 |
} |
|
335 |
|
|
336 |
/** |
|
337 |
* This method initializes btnOk |
|
338 |
* |
|
339 |
* @return javax.swing.JButton |
|
340 |
*/ |
|
341 |
private javax.swing.JButton getBtnOk() { |
|
342 |
if (btnOk == null) { |
|
343 |
btnOk = new javax.swing.JButton(); |
|
344 |
btnOk.setPreferredSize(new java.awt.Dimension(100, 30)); |
|
345 |
btnOk.setText(PluginServices.getText(this, "ok") + ":"); |
|
346 |
|
|
347 |
btnOk.addActionListener(new java.awt.event.ActionListener() { |
|
348 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
349 |
project.setName(txtName.getText()); |
|
350 |
project.setOwner(txtOwner.getText()); |
|
351 |
project.setComments(txtComments.getText()); |
|
352 |
project.setSelectionColor(lblColor.getBackground()); |
|
353 |
PluginServices.getMDIManager().closeView(ProjectProperties.this); |
|
354 |
} |
|
355 |
}); |
|
356 |
} |
|
357 |
|
|
358 |
return btnOk; |
|
359 |
} |
|
360 |
|
|
361 |
/** |
|
362 |
* This method initializes btnCancel |
|
363 |
* |
|
364 |
* @return javax.swing.JButton |
|
365 |
*/ |
|
366 |
private javax.swing.JButton getBtnCancel() { |
|
367 |
if (btnCancel == null) { |
|
368 |
btnCancel = new javax.swing.JButton(); |
|
369 |
btnCancel.setPreferredSize(new java.awt.Dimension(100, 30)); |
|
370 |
btnCancel.setText(PluginServices.getText(this, "cancel") + ":"); |
|
371 |
|
|
372 |
btnCancel.addActionListener(new java.awt.event.ActionListener() { |
|
373 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
374 |
PluginServices.getMDIManager().closeView(ProjectProperties.this); |
|
375 |
} |
|
376 |
}); |
|
377 |
} |
|
378 |
|
|
379 |
return btnCancel; |
|
380 |
} |
|
381 |
|
|
382 |
/** |
|
383 |
* This method initializes jLabel6 |
|
384 |
* |
|
385 |
* @return javax.swing.JLabel |
|
386 |
*/ |
|
387 |
private javax.swing.JLabel getJLabel6() { |
|
388 |
if (jLabel6 == null) { |
|
389 |
jLabel6 = new javax.swing.JLabel(); |
|
390 |
jLabel6.setText(PluginServices.getText(this, "selection_color") + |
|
391 |
":"); |
|
392 |
jLabel6.setPreferredSize(new java.awt.Dimension(190, 16)); |
|
393 |
} |
|
394 |
|
|
395 |
return jLabel6; |
|
396 |
} |
|
397 |
|
|
398 |
/** |
|
399 |
* This method initializes lblColor |
|
400 |
* |
|
401 |
* @return javax.swing.JLabel |
|
402 |
*/ |
|
403 |
private javax.swing.JLabel getLblColor() { |
|
404 |
if (lblColor == null) { |
|
405 |
lblColor = new javax.swing.JLabel(); |
|
406 |
|
|
407 |
// lblColor.setText(""); |
|
408 |
lblColor.setPreferredSize(new java.awt.Dimension(30, 16)); |
|
409 |
lblColor.setOpaque(true); |
|
410 |
} |
|
411 |
|
|
412 |
return lblColor; |
|
413 |
} |
|
414 |
|
|
415 |
/** |
|
416 |
* This method initializes btnColor |
|
417 |
* |
|
418 |
* @return javax.swing.JButton |
|
419 |
*/ |
|
420 |
private javax.swing.JButton getBtnColor() { |
|
421 |
if (btnColor == null) { |
|
422 |
btnColor = new javax.swing.JButton(); |
|
423 |
btnColor.setPreferredSize(new java.awt.Dimension(34, 16)); |
|
424 |
btnColor.setText("..."); |
|
425 |
|
|
426 |
btnColor.addActionListener(new java.awt.event.ActionListener() { |
|
427 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
428 |
Color ret = JColorChooser.showDialog(ProjectProperties.this, |
|
429 |
PluginServices.getText(this, "selection_color"), |
|
430 |
lblColor.getBackground()); |
|
431 |
|
|
432 |
if (ret != null) { |
|
433 |
lblColor.setBackground(ret); |
|
434 |
} |
|
435 |
} |
|
436 |
}); |
|
437 |
} |
|
438 |
|
|
439 |
return btnColor; |
|
440 |
} |
|
441 |
|
|
442 |
/** |
|
443 |
* This method initializes jScrollPane |
|
444 |
* |
|
445 |
* @return javax.swing.JScrollPane |
|
446 |
*/ |
|
447 |
private javax.swing.JScrollPane getJScrollPane() { |
|
448 |
if (jScrollPane == null) { |
|
449 |
jScrollPane = new javax.swing.JScrollPane(); |
|
450 |
jScrollPane.setViewportView(getTxtComments()); |
|
451 |
jScrollPane.setPreferredSize(new java.awt.Dimension(310, 70)); |
|
452 |
} |
|
453 |
|
|
454 |
return jScrollPane; |
|
455 |
} |
|
456 |
|
|
457 |
/** |
|
458 |
* @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo() |
|
459 |
*/ |
|
460 |
public ViewInfo getViewInfo() { |
|
461 |
ViewInfo m_viewinfo=new ViewInfo(ViewInfo.MODALDIALOG); |
|
462 |
m_viewinfo.setWidth(341); |
|
463 |
m_viewinfo.setHeight(311); |
|
464 |
m_viewinfo.setTitle(PluginServices.getText(this, "propiedades_sesion")); |
|
465 |
return m_viewinfo; |
|
466 |
} |
|
467 |
|
|
468 |
/** |
|
469 |
* @see com.iver.mdiApp.ui.MDIManager.View#viewActivated() |
|
470 |
*/ |
|
471 |
public void viewActivated() { |
|
472 |
} |
|
473 |
} |
|
474 |
|
|
475 |
|
|
476 |
// @jve:visual-info decl-index=0 visual-constraint="10,10" |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/TableProperties.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
package com.iver.cit.gvsig.project; |
|
42 |
|
|
43 |
|
|
44 |
import javax.swing.JPanel; |
|
45 |
|
|
46 |
import com.iver.andami.PluginServices; |
|
47 |
import com.iver.andami.Utilities; |
|
48 |
import com.iver.andami.ui.mdiManager.View; |
|
49 |
import com.iver.andami.ui.mdiManager.ViewInfo; |
|
50 |
import com.iver.cit.gvsig.project.castor.ProjectTable; |
|
51 |
|
|
52 |
|
|
53 |
/** |
|
54 |
* Dialogo de propiedades de la tabla |
|
55 |
* |
|
56 |
* @author Fernando Gonz?lez Cort?s |
|
57 |
*/ |
|
58 |
public class TableProperties extends JPanel implements View { |
|
59 |
private javax.swing.JPanel jContentPane = null; |
|
60 |
private javax.swing.JLabel jLabel = null; |
|
61 |
private javax.swing.JTextField txtName = null; |
|
62 |
private javax.swing.JLabel jLabel1 = null; |
|
63 |
private javax.swing.JTextField txtDate = null; |
|
64 |
private javax.swing.JTextField txtOwner = null; |
|
65 |
private javax.swing.JLabel jLabel2 = null; |
|
66 |
private javax.swing.JLabel jLabel3 = null; |
|
67 |
private javax.swing.JScrollPane jScrollPane = null; |
|
68 |
private javax.swing.JTextArea txtComments = null; |
|
69 |
private javax.swing.JScrollPane jScrollPane1 = null; |
|
70 |
private javax.swing.JTable tabla = null; |
|
71 |
private ProjectTable table; |
|
72 |
private javax.swing.JButton btnOk = null; |
|
73 |
private javax.swing.JButton btnCancel = null; |
|
74 |
private javax.swing.JPanel jPanel = null; |
|
75 |
private javax.swing.JPanel jPanel1 = null; |
|
76 |
private javax.swing.JLabel jLabel4 = null; |
|
77 |
private ViewInfo m_viewinfo = null; |
|
78 |
/** |
|
79 |
* This is the default constructor |
|
80 |
* |
|
81 |
* @param f Frame padre del di?logo |
|
82 |
* @param t Tabla que se representa en el di?logo |
|
83 |
*/ |
|
84 |
public TableProperties(ProjectTable t) { |
|
85 |
table = t; |
|
86 |
|
|
87 |
initialize(); |
|
88 |
} |
|
89 |
|
|
90 |
/** |
|
91 |
* This method initializes this |
|
92 |
*/ |
|
93 |
private void initialize() { |
|
94 |
|
|
95 |
java.awt.FlowLayout layFlowLayout7 = new java.awt.FlowLayout(); |
|
96 |
layFlowLayout7.setHgap(0); |
|
97 |
setLayout(layFlowLayout7); |
|
98 |
add(getJPanel(), null); |
|
99 |
add(getJPanel1(), null); |
|
100 |
add(getJLabel3(), null); |
|
101 |
add(getJScrollPane(), null); |
|
102 |
add(getJScrollPane1(), null); |
|
103 |
add(getBtnOk(), null); |
|
104 |
add(getJLabel4(), null); |
|
105 |
add(getBtnCancel(), null); |
|
106 |
|
|
107 |
txtName.setText(table.getName()); |
|
108 |
txtDate.setText(table.getCreationDate()); |
|
109 |
txtOwner.setText(table.getOwner()); |
|
110 |
txtComments.setText(table.getComment()); |
|
111 |
|
|
112 |
tabla.setModel(new MyTableModel(table)); |
|
113 |
} |
|
114 |
|
|
115 |
/** |
|
116 |
* This method initializes jLabel |
|
117 |
* |
|
118 |
* @return javax.swing.JLabel |
|
119 |
*/ |
|
120 |
private javax.swing.JLabel getJLabel() { |
|
121 |
if (jLabel == null) { |
|
122 |
jLabel = new javax.swing.JLabel(); |
|
123 |
jLabel.setText(PluginServices.getText(this, "nombre") + ":"); |
|
124 |
} |
|
125 |
|
|
126 |
return jLabel; |
|
127 |
} |
|
128 |
|
|
129 |
/** |
|
130 |
* This method initializes txtName |
|
131 |
* |
|
132 |
* @return javax.swing.JTextField |
|
133 |
*/ |
|
134 |
private javax.swing.JTextField getTxtName() { |
|
135 |
if (txtName == null) { |
|
136 |
txtName = new javax.swing.JTextField(); |
|
137 |
txtName.setPreferredSize(new java.awt.Dimension(220, 20)); |
|
138 |
} |
|
139 |
|
|
140 |
return txtName; |
|
141 |
} |
|
142 |
|
|
143 |
/** |
|
144 |
* This method initializes jLabel1 |
|
145 |
* |
|
146 |
* @return javax.swing.JLabel |
|
147 |
*/ |
|
148 |
private javax.swing.JLabel getJLabel1() { |
|
149 |
if (jLabel1 == null) { |
|
150 |
jLabel1 = new javax.swing.JLabel(); |
|
151 |
jLabel1.setText(PluginServices.getText(this, "creation_date") + ":"); |
|
152 |
} |
|
153 |
|
|
154 |
return jLabel1; |
|
155 |
} |
|
156 |
|
|
157 |
/** |
|
158 |
* This method initializes txtDate |
|
159 |
* |
|
160 |
* @return javax.swing.JTextField |
|
161 |
*/ |
|
162 |
private javax.swing.JTextField getTxtDate() { |
|
163 |
if (txtDate == null) { |
|
164 |
txtDate = new javax.swing.JTextField(); |
|
165 |
txtDate.setPreferredSize(new java.awt.Dimension(220, 20)); |
|
166 |
txtDate.setEditable(false); |
|
167 |
txtDate.setBackground(java.awt.Color.white); |
|
168 |
} |
|
169 |
|
|
170 |
return txtDate; |
|
171 |
} |
|
172 |
|
|
173 |
/** |
|
174 |
* This method initializes txtOwner |
|
175 |
* |
|
176 |
* @return javax.swing.JTextField |
|
177 |
*/ |
|
178 |
private javax.swing.JTextField getTxtOwner() { |
|
179 |
if (txtOwner == null) { |
|
180 |
txtOwner = new javax.swing.JTextField(); |
|
181 |
txtOwner.setPreferredSize(new java.awt.Dimension(220, 20)); |
|
182 |
} |
|
183 |
|
|
184 |
return txtOwner; |
|
185 |
} |
|
186 |
|
|
187 |
/** |
|
188 |
* This method initializes jLabel2 |
|
189 |
* |
|
190 |
* @return javax.swing.JLabel |
|
191 |
*/ |
|
192 |
private javax.swing.JLabel getJLabel2() { |
|
193 |
if (jLabel2 == null) { |
|
194 |
jLabel2 = new javax.swing.JLabel(); |
|
195 |
jLabel2.setText(PluginServices.getText(this, "owner") + ":"); |
|
196 |
} |
|
197 |
|
|
198 |
return jLabel2; |
|
199 |
} |
|
200 |
|
|
201 |
/** |
|
202 |
* This method initializes jLabel3 |
|
203 |
* |
|
204 |
* @return javax.swing.JLabel |
|
205 |
*/ |
|
206 |
private javax.swing.JLabel getJLabel3() { |
|
207 |
if (jLabel3 == null) { |
|
208 |
jLabel3 = new javax.swing.JLabel(); |
|
209 |
jLabel3.setText(PluginServices.getText(this, "comentarios") + ":"); |
|
210 |
} |
|
211 |
|
|
212 |
return jLabel3; |
|
213 |
} |
|
214 |
|
|
215 |
/** |
|
216 |
* This method initializes jScrollPane |
|
217 |
* |
|
218 |
* @return javax.swing.JScrollPane |
|
219 |
*/ |
|
220 |
private javax.swing.JScrollPane getJScrollPane() { |
|
221 |
if (jScrollPane == null) { |
|
222 |
jScrollPane = new javax.swing.JScrollPane(); |
|
223 |
jScrollPane.setViewportView(getTxtComments()); |
|
224 |
jScrollPane.setPreferredSize(new java.awt.Dimension(320, 70)); |
|
225 |
} |
|
226 |
|
|
227 |
return jScrollPane; |
|
228 |
} |
|
229 |
|
|
230 |
/** |
|
231 |
* This method initializes txtComments |
|
232 |
* |
|
233 |
* @return javax.swing.JTextArea |
|
234 |
*/ |
|
235 |
private javax.swing.JTextArea getTxtComments() { |
|
236 |
if (txtComments == null) { |
|
237 |
txtComments = new javax.swing.JTextArea(); |
|
238 |
} |
|
239 |
|
|
240 |
return txtComments; |
|
241 |
} |
|
242 |
|
|
243 |
/** |
|
244 |
* This method initializes jTable |
|
245 |
* |
|
246 |
* @return javax.swing.JTable |
|
247 |
*/ |
|
248 |
private javax.swing.JTable getJTable() { |
|
249 |
if (tabla == null) { |
|
250 |
tabla = new javax.swing.JTable(); |
|
251 |
} |
|
252 |
|
|
253 |
return tabla; |
|
254 |
} |
|
255 |
|
|
256 |
/** |
|
257 |
* This method initializes jScrollPane1 |
|
258 |
* |
|
259 |
* @return javax.swing.JScrollPane |
|
260 |
*/ |
|
261 |
private javax.swing.JScrollPane getJScrollPane1() { |
|
262 |
if (jScrollPane1 == null) { |
|
263 |
jScrollPane1 = new javax.swing.JScrollPane(); |
|
264 |
jScrollPane1.setViewportView(getJTable()); |
|
265 |
jScrollPane1.setPreferredSize(new java.awt.Dimension(320, 160)); |
|
266 |
} |
|
267 |
|
|
268 |
return jScrollPane1; |
|
269 |
} |
|
270 |
|
|
271 |
/** |
|
272 |
* This method initializes btnOk |
|
273 |
* |
|
274 |
* @return javax.swing.JButton |
|
275 |
*/ |
|
276 |
private javax.swing.JButton getBtnOk() { |
|
277 |
if (btnOk == null) { |
|
278 |
btnOk = new javax.swing.JButton(); |
|
279 |
btnOk.setPreferredSize(new java.awt.Dimension(90, 30)); |
|
280 |
btnOk.setText(PluginServices.getText(this, "ok")); |
|
281 |
|
|
282 |
btnOk.addActionListener(new java.awt.event.ActionListener() { |
|
283 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
284 |
table.setName(txtName.getText()); |
|
285 |
table.setCreationDate(txtDate.getText()); |
|
286 |
table.setOwner(txtOwner.getText()); |
|
287 |
table.setComment(txtComments.getText()); |
|
288 |
|
|
289 |
PluginServices.getMDIManager().closeView(TableProperties.this); |
|
290 |
} |
|
291 |
}); |
|
292 |
} |
|
293 |
|
|
294 |
return btnOk; |
|
295 |
} |
|
296 |
|
|
297 |
/** |
|
298 |
* This method initializes btnCancel |
|
299 |
* |
|
300 |
* @return javax.swing.JButton |
|
301 |
*/ |
|
302 |
private javax.swing.JButton getBtnCancel() { |
|
303 |
if (btnCancel == null) { |
|
304 |
btnCancel = new javax.swing.JButton(); |
|
305 |
btnCancel.setPreferredSize(new java.awt.Dimension(90, 30)); |
|
306 |
btnCancel.setText(PluginServices.getText(this, "cancel")); |
|
307 |
|
|
308 |
btnCancel.addActionListener(new java.awt.event.ActionListener() { |
|
309 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
310 |
PluginServices.getMDIManager().closeView(TableProperties.this); |
|
311 |
} |
|
312 |
}); |
|
313 |
} |
|
314 |
|
|
315 |
return btnCancel; |
|
316 |
} |
|
317 |
|
|
318 |
/** |
|
319 |
* This method initializes jPanel |
|
320 |
* |
|
321 |
* @return javax.swing.JPanel |
|
322 |
*/ |
|
323 |
private javax.swing.JPanel getJPanel() { |
|
324 |
if (jPanel == null) { |
|
325 |
jPanel = new javax.swing.JPanel(); |
|
326 |
|
|
327 |
java.awt.FlowLayout layFlowLayout9 = new java.awt.FlowLayout(); |
|
328 |
layFlowLayout9.setAlignment(java.awt.FlowLayout.RIGHT); |
|
329 |
layFlowLayout9.setVgap(9); |
|
330 |
jPanel.setLayout(layFlowLayout9); |
|
331 |
jPanel.add(getJLabel(), null); |
|
332 |
jPanel.add(getJLabel1(), null); |
|
333 |
jPanel.add(getJLabel2(), null); |
|
334 |
jPanel.setPreferredSize(new java.awt.Dimension(100, 80)); |
|
335 |
} |
|
336 |
|
|
337 |
return jPanel; |
|
338 |
} |
|
339 |
|
|
340 |
/** |
|
341 |
* This method initializes jPanel1 |
|
342 |
* |
|
343 |
* @return javax.swing.JPanel |
|
344 |
*/ |
|
345 |
private javax.swing.JPanel getJPanel1() { |
|
346 |
if (jPanel1 == null) { |
|
347 |
jPanel1 = new javax.swing.JPanel(); |
|
348 |
|
|
349 |
java.awt.FlowLayout layFlowLayout8 = new java.awt.FlowLayout(); |
|
350 |
layFlowLayout8.setAlignment(java.awt.FlowLayout.LEFT); |
|
351 |
jPanel1.setLayout(layFlowLayout8); |
|
352 |
jPanel1.add(getTxtName(), null); |
|
353 |
jPanel1.add(getTxtDate(), null); |
|
354 |
jPanel1.add(getTxtOwner(), null); |
|
355 |
jPanel1.setPreferredSize(new java.awt.Dimension(230, 80)); |
|
356 |
} |
|
357 |
|
|
358 |
return jPanel1; |
|
359 |
} |
|
360 |
|
|
361 |
/** |
|
362 |
* This method initializes jLabel4 |
|
363 |
* |
|
364 |
* @return javax.swing.JLabel |
|
365 |
*/ |
|
366 |
private javax.swing.JLabel getJLabel4() { |
|
367 |
if (jLabel4 == null) { |
|
368 |
jLabel4 = new javax.swing.JLabel(); |
|
369 |
jLabel4.setText(""); |
|
370 |
jLabel4.setPreferredSize(new java.awt.Dimension(30, 0)); |
|
371 |
} |
|
372 |
|
|
373 |
return jLabel4; |
|
374 |
} |
|
375 |
|
|
376 |
/** |
|
377 |
* @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo() |
|
378 |
*/ |
|
379 |
public ViewInfo getViewInfo() { |
|
380 |
ViewInfo m_viewinfo=new ViewInfo(ViewInfo.MODALDIALOG); |
|
381 |
m_viewinfo.setTitle(PluginServices.getText(this, "propiedades_tabla")); |
|
382 |
m_viewinfo.setWidth(349); |
|
383 |
m_viewinfo.setHeight(400); |
|
384 |
|
|
385 |
return m_viewinfo; |
|
386 |
} |
|
387 |
|
|
388 |
/** |
|
389 |
* @see com.iver.mdiApp.ui.MDIManager.View#viewActivated() |
|
390 |
*/ |
|
391 |
public void viewActivated() { |
|
392 |
} |
|
393 |
} |
|
394 |
|
|
395 |
|
|
396 |
// @jve:visual-info decl-index=0 visual-constraint="10,10" |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/ViewProperties.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
package com.iver.cit.gvsig.project; |
|
42 |
|
|
43 |
|
|
44 |
import java.awt.Color; |
|
45 |
|
|
46 |
import javax.swing.JButton; |
|
47 |
import javax.swing.JColorChooser; |
|
48 |
import javax.swing.JLabel; |
|
49 |
import javax.swing.JPanel; |
|
50 |
|
|
51 |
import com.iver.andami.PluginServices; |
|
52 |
import com.iver.andami.ui.mdiManager.View; |
|
53 |
import com.iver.andami.ui.mdiManager.ViewInfo; |
|
54 |
import com.iver.cit.gvsig.gui.layout.Attributes; |
|
55 |
import com.iver.cit.gvsig.project.castor.ProjectView; |
|
56 |
/** |
|
57 |
* Dialogo donde se muestran las propiedades de una vista |
|
58 |
* |
|
59 |
* @author Fernando Gonz?lez Cort?s |
|
60 |
*/ |
|
61 |
public class ViewProperties extends JPanel implements View{ |
|
62 |
/*private String[] units = new String[] { |
|
63 |
PluginServices.getText(this, "metros"), |
|
64 |
PluginServices.getText(this, "kilometros"), |
|
65 |
}; |
|
66 |
*/ |
|
67 |
private javax.swing.JPanel jContentPane = null; |
|
68 |
private javax.swing.JLabel jLabel = null; |
|
69 |
private javax.swing.JTextField txtName = null; |
|
70 |
private javax.swing.JLabel jLabel1 = null; |
|
71 |
private javax.swing.JTextField txtDate = null; |
|
72 |
private javax.swing.JLabel jLabel2 = null; |
|
73 |
private javax.swing.JTextField txtOwner = null; |
|
74 |
private javax.swing.JLabel jLabel4 = null; |
|
75 |
private javax.swing.JComboBox cmbMapUnits = null; |
|
76 |
private javax.swing.JLabel jLabel5 = null; |
|
77 |
private javax.swing.JComboBox cmbDistanceUnits = null; |
|
78 |
private javax.swing.JLabel jLabel6 = null; |
|
79 |
private javax.swing.JTextArea txtComments = null; |
|
80 |
private javax.swing.JLabel jLabel7 = null; |
|
81 |
private javax.swing.JLabel lblColor = null; |
|
82 |
private javax.swing.JButton btnColor = null; |
|
83 |
private javax.swing.JButton btnOk = null; |
|
84 |
private javax.swing.JButton btnCancel = null; |
|
85 |
private ProjectView view=null; |
|
86 |
private javax.swing.JScrollPane jScrollPane = null; |
|
87 |
private javax.swing.JPanel jPanel = null; |
|
88 |
private javax.swing.JPanel jPanel1 = null; |
|
89 |
private javax.swing.JPanel jPanel2 = null; |
|
90 |
private javax.swing.JPanel jPanel3 = null; |
|
91 |
private javax.swing.JLabel jLabel3 = null; |
|
92 |
private ViewInfo m_viewinfo = null; |
|
93 |
private JLabel jLblProj = null; |
|
94 |
private JLabel jLblProjName = null; |
|
95 |
private JButton jBtnChangeProj = null; |
|
96 |
private JPanel jPanelProj = null; |
|
97 |
/** |
|
98 |
* This is the default constructor |
|
99 |
* |
|
100 |
* @param f Frame padre del dialogo |
|
101 |
* @param v Vista que se representa |
|
102 |
*/ |
|
103 |
public ViewProperties(ProjectView v) { |
|
104 |
view = v; |
|
105 |
initialize(); |
|
106 |
} |
|
107 |
|
|
108 |
/** |
|
109 |
* This method initializes this |
|
110 |
*/ |
|
111 |
private void initialize() { |
|
112 |
jLblProjName = new JLabel(); |
|
113 |
jLblProj = new JLabel(); |
|
114 |
this.setSize(365, 343); |
|
115 |
java.awt.FlowLayout layFlowLayout3 = new java.awt.FlowLayout(); |
|
116 |
layFlowLayout3.setHgap(0); |
|
117 |
setLayout(layFlowLayout3); |
|
118 |
jLblProj.setText(view.getProjection().getAbrev()); |
|
119 |
jLblProj.setPreferredSize(new java.awt.Dimension(180,20)); |
|
120 |
jLblProjName.setText("Proyecci?n actual:"); |
|
121 |
jLblProjName.setPreferredSize(new java.awt.Dimension(95,15)); |
|
122 |
this.setPreferredSize(new java.awt.Dimension(365,343)); |
|
123 |
add(getJPanel(), null); |
|
124 |
add(getJPanel1(), null); |
|
125 |
add(getJPanel2(), null); |
|
126 |
add(getJPanel3(), null); |
|
127 |
this.add(getJPanelProj(), null); |
|
128 |
this.add(getJLabel6(), null); |
|
129 |
add(getJScrollPane(), null); |
|
130 |
this.add(getJLabel7(), null); |
|
131 |
this.add(getLblColor(), null); |
|
132 |
this.add(getBtnColor(), null); |
|
133 |
add(getJLabel3(), null); |
|
134 |
this.add(getBtnOk(), null); |
|
135 |
this.add(getBtnCancel(), null); |
|
136 |
txtName.setText(view.getName()); |
|
137 |
txtDate.setText(view.getCreationDate()); |
|
138 |
txtOwner.setText(view.getOwner()); |
|
139 |
|
|
140 |
cmbMapUnits.setSelectedIndex(view.getMapContext().getViewPort().getMapUnits()); |
|
141 |
cmbDistanceUnits.setSelectedIndex(view.getMapContext().getViewPort().getDistanceUnits()); |
|
142 |
|
|
143 |
txtComments.setText(view.getComment()); |
|
144 |
|
|
145 |
lblColor.setBackground(view.getMapContext().getViewPort().getBackColor()); |
|
146 |
} |
|
147 |
|
|
148 |
/** |
|
149 |
* This method initializes jLabel |
|
150 |
* |
|
151 |
* @return javax.swing.JLabel |
|
152 |
*/ |
|
153 |
private javax.swing.JLabel getJLabel() { |
|
154 |
if (jLabel == null) { |
|
155 |
jLabel = new javax.swing.JLabel(); |
|
156 |
jLabel.setText(PluginServices.getText(this, "nombre") + ":"); |
|
157 |
} |
|
158 |
|
|
159 |
return jLabel; |
|
160 |
} |
|
161 |
|
|
162 |
/** |
|
163 |
* This method initializes txtName |
|
164 |
* |
|
165 |
* @return javax.swing.JTextField |
|
166 |
*/ |
|
167 |
private javax.swing.JTextField getTxtName() { |
|
168 |
if (txtName == null) { |
|
169 |
txtName = new javax.swing.JTextField(); |
|
170 |
txtName.setPreferredSize(new java.awt.Dimension(220, 20)); |
|
171 |
} |
|
172 |
|
|
173 |
return txtName; |
|
174 |
} |
|
175 |
|
|
176 |
/** |
|
177 |
* This method initializes jLabel1 |
|
178 |
* |
|
179 |
* @return javax.swing.JLabel |
|
180 |
*/ |
|
181 |
private javax.swing.JLabel getJLabel1() { |
|
182 |
if (jLabel1 == null) { |
|
183 |
jLabel1 = new javax.swing.JLabel(); |
|
184 |
jLabel1.setText(PluginServices.getText(this, "creation_date") + ":"); |
|
185 |
} |
|
186 |
|
|
187 |
return jLabel1; |
|
188 |
} |
|
189 |
|
|
190 |
/** |
|
191 |
* This method initializes txtDate |
|
192 |
* |
|
193 |
* @return javax.swing.JTextField |
|
194 |
*/ |
|
195 |
private javax.swing.JTextField getTxtDate() { |
|
196 |
if (txtDate == null) { |
|
197 |
txtDate = new javax.swing.JTextField(); |
|
198 |
txtDate.setPreferredSize(new java.awt.Dimension(220, 20)); |
|
199 |
txtDate.setEditable(false); |
|
200 |
txtDate.setBackground(java.awt.Color.white); |
|
201 |
} |
|
202 |
|
|
203 |
return txtDate; |
|
204 |
} |
|
205 |
|
|
206 |
/** |
|
207 |
* This method initializes jLabel2 |
|
208 |
* |
|
209 |
* @return javax.swing.JLabel |
|
210 |
*/ |
|
211 |
private javax.swing.JLabel getJLabel2() { |
|
212 |
if (jLabel2 == null) { |
|
213 |
jLabel2 = new javax.swing.JLabel(); |
|
214 |
jLabel2.setText(PluginServices.getText(this, "owner") + ":"); |
|
215 |
} |
|
216 |
|
|
217 |
return jLabel2; |
|
218 |
} |
|
219 |
|
|
220 |
/** |
|
221 |
* This method initializes txtOwner |
|
222 |
* |
|
223 |
* @return javax.swing.JTextField |
|
224 |
*/ |
|
225 |
private javax.swing.JTextField getTxtOwner() { |
|
226 |
if (txtOwner == null) { |
|
227 |
txtOwner = new javax.swing.JTextField(); |
|
228 |
txtOwner.setPreferredSize(new java.awt.Dimension(220, 20)); |
|
229 |
} |
|
230 |
|
|
231 |
return txtOwner; |
|
232 |
} |
|
233 |
|
|
234 |
/** |
|
235 |
* This method initializes jLabel4 |
|
236 |
* |
|
237 |
* @return javax.swing.JLabel |
|
238 |
*/ |
|
239 |
private javax.swing.JLabel getJLabel4() { |
|
240 |
if (jLabel4 == null) { |
|
241 |
jLabel4 = new javax.swing.JLabel(); |
|
242 |
jLabel4.setText(PluginServices.getText(this, "map_units") + ":"); |
|
243 |
} |
|
244 |
|
|
245 |
return jLabel4; |
|
246 |
} |
|
247 |
|
|
248 |
/** |
|
249 |
* This method initializes cmbMapUnits |
|
250 |
* |
|
251 |
* @return javax.swing.JComboBox |
|
252 |
*/ |
|
253 |
private javax.swing.JComboBox getCmbMapUnits() { |
|
254 |
if (cmbMapUnits == null) { |
|
255 |
cmbMapUnits = new javax.swing.JComboBox(Attributes.NAMES); |
|
256 |
cmbMapUnits.setPreferredSize(new java.awt.Dimension(160, 20)); |
|
257 |
cmbMapUnits.setSelectedIndex(view.getMapContext().getViewPort().getMapUnits()); |
|
258 |
cmbMapUnits.addActionListener(new java.awt.event.ActionListener() { |
|
259 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
260 |
view.getMapContext().getViewPort().setMapUnits(cmbMapUnits.getSelectedIndex()); |
|
261 |
} |
|
262 |
}); |
|
263 |
} |
|
264 |
|
|
265 |
return cmbMapUnits; |
|
266 |
} |
|
267 |
|
|
268 |
/** |
|
269 |
* This method initializes jLabel5 |
|
270 |
* |
|
271 |
* @return javax.swing.JLabel |
|
272 |
*/ |
|
273 |
private javax.swing.JLabel getJLabel5() { |
|
274 |
if (jLabel5 == null) { |
|
275 |
jLabel5 = new javax.swing.JLabel(); |
|
276 |
jLabel5.setText(PluginServices.getText(this, "distance_units") + ":"); |
|
277 |
} |
|
278 |
|
|
279 |
return jLabel5; |
|
280 |
} |
|
281 |
|
|
282 |
/** |
|
283 |
* This method initializes cmbDistanceUnits |
|
284 |
* |
|
285 |
* @return javax.swing.JComboBox |
|
286 |
*/ |
|
287 |
private javax.swing.JComboBox getCmbDistanceUnits() { |
|
288 |
if (cmbDistanceUnits == null) { |
|
289 |
cmbDistanceUnits = new javax.swing.JComboBox(Attributes.NAMES); |
|
290 |
cmbDistanceUnits.setPreferredSize(new java.awt.Dimension(160, 20)); |
|
291 |
cmbDistanceUnits.setEditable(false); |
|
292 |
cmbDistanceUnits.setSelectedIndex(view.getMapContext().getViewPort().getDistanceUnits()); |
|
293 |
cmbDistanceUnits.addActionListener(new java.awt.event.ActionListener() { |
|
294 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
295 |
view.getMapContext().getViewPort().setDistanceUnits(cmbDistanceUnits.getSelectedIndex()); |
|
296 |
} |
|
297 |
}); |
|
298 |
} |
|
299 |
|
|
300 |
return cmbDistanceUnits; |
|
301 |
} |
|
302 |
|
|
303 |
/** |
|
304 |
* This method initializes jLabel6 |
|
305 |
* |
|
306 |
* @return javax.swing.JLabel |
|
307 |
*/ |
|
308 |
private javax.swing.JLabel getJLabel6() { |
|
309 |
if (jLabel6 == null) { |
|
310 |
jLabel6 = new javax.swing.JLabel(); |
|
311 |
jLabel6.setText(PluginServices.getText(this, "comentarios") + ":"); |
|
312 |
jLabel6.setPreferredSize(new java.awt.Dimension(330,15)); |
|
313 |
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); |
|
314 |
jLabel6.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); |
|
315 |
} |
|
316 |
|
|
317 |
return jLabel6; |
|
318 |
} |
|
319 |
|
|
320 |
/** |
|
321 |
* This method initializes txtComments |
|
322 |
* |
|
323 |
* @return javax.swing.JTextArea |
|
324 |
*/ |
|
325 |
private javax.swing.JTextArea getTxtComments() { |
|
326 |
if (txtComments == null) { |
|
327 |
txtComments = new javax.swing.JTextArea(); |
|
328 |
txtComments.setRows(1); |
|
329 |
txtComments.setColumns(28); |
|
330 |
} |
|
331 |
|
|
332 |
return txtComments; |
|
333 |
} |
|
334 |
|
|
335 |
/** |
|
336 |
* This method initializes jLabel7 |
|
337 |
* |
|
338 |
* @return javax.swing.JLabel |
|
339 |
*/ |
|
340 |
private javax.swing.JLabel getJLabel7() { |
|
341 |
if (jLabel7 == null) { |
|
342 |
jLabel7 = new javax.swing.JLabel(); |
|
343 |
jLabel7.setText(PluginServices.getText(this, "background_color") + |
|
344 |
":"); |
|
345 |
jLabel7.setPreferredSize(new java.awt.Dimension(240,16)); |
|
346 |
} |
|
347 |
|
|
348 |
return jLabel7; |
|
349 |
} |
|
350 |
|
|
351 |
/** |
|
352 |
* This method initializes lblColor |
|
353 |
* |
|
354 |
* @return javax.swing.JLabel |
|
355 |
*/ |
|
356 |
private javax.swing.JLabel getLblColor() { |
|
357 |
if (lblColor == null) { |
|
358 |
lblColor = new javax.swing.JLabel(); |
|
359 |
lblColor.setText(""); |
|
360 |
lblColor.setPreferredSize(new java.awt.Dimension(30, 16)); |
|
361 |
lblColor.setBackground(view.getMapContext().getViewPort().getBackColor()); |
|
362 |
lblColor.setOpaque(true); |
|
363 |
} |
|
364 |
|
|
365 |
return lblColor; |
|
366 |
} |
|
367 |
|
|
368 |
/** |
|
369 |
* This method initializes btnColor |
|
370 |
* |
|
371 |
* @return javax.swing.JButton |
|
372 |
*/ |
|
373 |
private javax.swing.JButton getBtnColor() { |
|
374 |
if (btnColor == null) { |
|
375 |
btnColor = new javax.swing.JButton(); |
|
376 |
btnColor.setPreferredSize(new java.awt.Dimension(34, 16)); |
|
377 |
btnColor.setText("..."); |
|
378 |
|
|
379 |
btnColor.addActionListener(new java.awt.event.ActionListener() { |
|
380 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
381 |
Color ret = JColorChooser.showDialog(ViewProperties.this, |
|
382 |
PluginServices.getText(this, "background_color"), |
|
383 |
lblColor.getBackground()); |
|
384 |
|
|
385 |
if (ret != null) { |
|
386 |
lblColor.setBackground(ret); |
|
387 |
} |
|
388 |
} |
|
389 |
}); |
|
390 |
} |
|
391 |
|
|
392 |
return btnColor; |
|
393 |
} |
|
394 |
|
|
395 |
/** |
|
396 |
* This method initializes btnOk |
|
397 |
* |
|
398 |
* @return javax.swing.JButton |
|
399 |
*/ |
|
400 |
private javax.swing.JButton getBtnOk() { |
|
401 |
if (btnOk == null) { |
|
402 |
btnOk = new javax.swing.JButton(); |
|
403 |
btnOk.setPreferredSize(new java.awt.Dimension(100, 30)); |
|
404 |
btnOk.setText(PluginServices.getText(this, "ok")); |
|
405 |
|
|
406 |
btnOk.addActionListener(new java.awt.event.ActionListener() { |
|
407 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
408 |
view.setName(txtName.getText()); |
|
409 |
view.setCreationDate(txtDate.getText()); |
|
410 |
view.setOwner(txtOwner.getText()); |
|
411 |
view.setComment(txtComments.getText()); |
|
412 |
view.getMapContext().getViewPort().setMapUnits(cmbMapUnits.getSelectedIndex()); |
|
413 |
view.getMapContext().getViewPort().setDistanceUnits(cmbDistanceUnits.getSelectedIndex()); |
|
414 |
view.setBackColor(lblColor.getBackground()); |
|
415 |
|
|
416 |
PluginServices.getMDIManager().closeView(ViewProperties.this); |
|
417 |
} |
|
418 |
}); |
|
419 |
} |
|
420 |
|
|
421 |
return btnOk; |
|
422 |
} |
|
423 |
|
|
424 |
/** |
|
425 |
* This method initializes btnCancel |
|
426 |
* |
|
427 |
* @return javax.swing.JButton |
|
428 |
*/ |
|
429 |
private javax.swing.JButton getBtnCancel() { |
|
430 |
if (btnCancel == null) { |
|
431 |
btnCancel = new javax.swing.JButton(); |
|
432 |
btnCancel.setPreferredSize(new java.awt.Dimension(100, 30)); |
|
433 |
btnCancel.setText(PluginServices.getText(this, "cancel")); |
|
434 |
|
|
435 |
btnCancel.addActionListener(new java.awt.event.ActionListener() { |
|
436 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
437 |
PluginServices.getMDIManager().closeView(ViewProperties.this); |
|
438 |
} |
|
439 |
}); |
|
440 |
} |
|
441 |
|
|
442 |
return btnCancel; |
|
443 |
} |
|
444 |
|
|
445 |
/** |
|
446 |
* This method initializes jScrollPane |
|
447 |
* |
|
448 |
* @return javax.swing.JScrollPane |
|
449 |
*/ |
|
450 |
private javax.swing.JScrollPane getJScrollPane() { |
|
451 |
if (jScrollPane == null) { |
|
452 |
jScrollPane = new javax.swing.JScrollPane(); |
|
453 |
jScrollPane.setViewportView(getTxtComments()); |
|
454 |
jScrollPane.setPreferredSize(new java.awt.Dimension(320, 70)); |
|
455 |
} |
|
456 |
|
|
457 |
return jScrollPane; |
|
458 |
} |
|
459 |
|
|
460 |
/** |
|
461 |
* This method initializes jPanel |
|
462 |
* |
|
463 |
* @return javax.swing.JPanel |
|
464 |
*/ |
|
465 |
private javax.swing.JPanel getJPanel() { |
|
466 |
if (jPanel == null) { |
|
467 |
jPanel = new javax.swing.JPanel(); |
|
468 |
|
|
469 |
java.awt.FlowLayout layFlowLayout4 = new java.awt.FlowLayout(); |
|
470 |
layFlowLayout4.setAlignment(java.awt.FlowLayout.RIGHT); |
|
471 |
layFlowLayout4.setVgap(9); |
|
472 |
jPanel.setLayout(layFlowLayout4); |
|
473 |
jPanel.add(getJLabel(), null); |
|
474 |
jPanel.add(getJLabel1(), null); |
|
475 |
jPanel.add(getJLabel2(), null); |
|
476 |
jPanel.setPreferredSize(new java.awt.Dimension(100, 80)); |
|
477 |
} |
|
478 |
|
|
479 |
return jPanel; |
|
480 |
} |
|
481 |
|
|
482 |
/** |
|
483 |
* This method initializes jPanel1 |
|
484 |
* |
|
485 |
* @return javax.swing.JPanel |
|
486 |
*/ |
|
487 |
private javax.swing.JPanel getJPanel1() { |
|
488 |
if (jPanel1 == null) { |
|
489 |
jPanel1 = new javax.swing.JPanel(); |
|
490 |
|
|
491 |
java.awt.FlowLayout layFlowLayout2 = new java.awt.FlowLayout(); |
|
492 |
layFlowLayout2.setHgap(5); |
|
493 |
layFlowLayout2.setAlignment(java.awt.FlowLayout.LEFT); |
|
494 |
jPanel1.setLayout(layFlowLayout2); |
|
495 |
jPanel1.add(getTxtName(), null); |
|
496 |
jPanel1.add(getTxtDate(), null); |
|
497 |
jPanel1.add(getTxtOwner(), null); |
|
498 |
jPanel1.setPreferredSize(new java.awt.Dimension(230, 80)); |
|
499 |
} |
|
500 |
|
|
501 |
return jPanel1; |
|
502 |
} |
|
503 |
|
|
504 |
/** |
|
505 |
* This method initializes jPanel2 |
|
506 |
* |
|
507 |
* @return javax.swing.JPanel |
|
508 |
*/ |
|
509 |
private javax.swing.JPanel getJPanel2() { |
|
510 |
if (jPanel2 == null) { |
|
511 |
jPanel2 = new javax.swing.JPanel(); |
|
512 |
|
|
513 |
java.awt.FlowLayout layFlowLayout5 = new java.awt.FlowLayout(); |
|
514 |
layFlowLayout5.setAlignment(java.awt.FlowLayout.RIGHT); |
|
515 |
layFlowLayout5.setVgap(9); |
|
516 |
jPanel2.setLayout(layFlowLayout5); |
|
517 |
jPanel2.add(getJLabel4(), null); |
|
518 |
jPanel2.add(getJLabel5(), null); |
|
519 |
jPanel2.setPreferredSize(new java.awt.Dimension(100, 50)); |
|
520 |
} |
|
521 |
|
|
522 |
return jPanel2; |
|
523 |
} |
|
524 |
|
|
525 |
/** |
|
526 |
* This method initializes jPanel3 |
|
527 |
* |
|
528 |
* @return javax.swing.JPanel |
|
529 |
*/ |
|
530 |
private javax.swing.JPanel getJPanel3() { |
|
531 |
if (jPanel3 == null) { |
|
532 |
jPanel3 = new javax.swing.JPanel(); |
|
533 |
|
|
534 |
java.awt.FlowLayout layFlowLayout6 = new java.awt.FlowLayout(); |
|
535 |
layFlowLayout6.setAlignment(java.awt.FlowLayout.LEFT); |
|
536 |
jPanel3.setLayout(layFlowLayout6); |
|
537 |
jPanel3.add(getCmbMapUnits(), null); |
|
538 |
jPanel3.add(getCmbDistanceUnits(), null); |
|
539 |
jPanel3.setPreferredSize(new java.awt.Dimension(230, 50)); |
|
540 |
} |
|
541 |
|
|
542 |
return jPanel3; |
|
543 |
} |
|
544 |
|
|
545 |
/** |
|
546 |
* This method initializes jLabel3 |
|
547 |
* |
|
548 |
* @return javax.swing.JLabel |
|
549 |
*/ |
|
550 |
private javax.swing.JLabel getJLabel3() { |
|
551 |
if (jLabel3 == null) { |
|
552 |
jLabel3 = new javax.swing.JLabel(); |
|
553 |
jLabel3.setText(""); |
|
554 |
jLabel3.setPreferredSize(new java.awt.Dimension(30, 0)); |
|
555 |
} |
|
556 |
|
|
557 |
return jLabel3; |
|
558 |
} |
|
559 |
|
|
560 |
/** |
|
561 |
* @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo() |
|
562 |
*/ |
|
563 |
public ViewInfo getViewInfo() { |
|
564 |
ViewInfo m_viewinfo=new ViewInfo(ViewInfo.MODALDIALOG); |
|
565 |
m_viewinfo.setTitle(PluginServices.getText(this, "propiedades_vista")); |
|
566 |
return m_viewinfo; |
|
567 |
} |
|
568 |
|
|
569 |
/** |
|
570 |
* @see com.iver.mdiApp.ui.MDIManager.View#viewActivated() |
|
571 |
*/ |
|
572 |
public void viewActivated() { |
|
573 |
} |
|
574 |
/** |
|
575 |
* This method initializes jButton |
|
576 |
* |
|
577 |
* @return javax.swing.JButton |
|
578 |
*/ |
|
579 |
private JButton getJBtnChangeProj() { |
|
580 |
if (jBtnChangeProj == null) { |
|
581 |
jBtnChangeProj = new JButton(); |
|
582 |
jBtnChangeProj.setText("..."); |
|
583 |
jBtnChangeProj.setPreferredSize(new java.awt.Dimension(34,16)); |
|
584 |
} |
|
585 |
return jBtnChangeProj; |
|
586 |
} |
|
587 |
/** |
|
588 |
* This method initializes jPanel4 |
|
589 |
* |
|
590 |
* @return javax.swing.JPanel |
|
591 |
*/ |
|
592 |
private JPanel getJPanelProj() { |
|
593 |
if (jPanelProj == null) { |
|
594 |
jPanelProj = new JPanel(); |
|
595 |
jPanelProj.setPreferredSize(new java.awt.Dimension(330,35)); |
|
596 |
jPanelProj.add(jLblProjName, null); |
|
597 |
jPanelProj.add(jLblProj, null); |
|
598 |
jPanelProj.add(getJBtnChangeProj(), null); |
|
599 |
} |
|
600 |
return jPanelProj; |
|
601 |
} |
|
602 |
} // @jve:visual-info decl-index=0 visual-constraint="10,10" |
|
603 |
|
|
604 |
|
|
605 |
// @jve:visual-info decl-index=0 visual-constraint="10,10" |
|
606 |
|
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/MapProperties.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
Also available in: Unified diff