svn-gvsig-desktop / branches / CqCMSDvp / libraries / libCq CMS for java.old / src / org / cresques / ui / raster / DataInputSaveRaster.java @ 2170
History | View | Annotate | Download (12.3 KB)
1 |
/*
|
---|---|
2 |
* Created on 17-feb-2004
|
3 |
*
|
4 |
* To change the template for this generated file go to
|
5 |
* Window>Preferences>Java>Code Generation>Code and Comments
|
6 |
*/
|
7 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
8 |
*
|
9 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
10 |
*
|
11 |
* This program is free software; you can redistribute it and/or
|
12 |
* modify it under the terms of the GNU General Public License
|
13 |
* as published by the Free Software Foundation; either version 2
|
14 |
* of the License, or (at your option) any later version.
|
15 |
*
|
16 |
* This program is distributed in the hope that it will be useful,
|
17 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
19 |
* GNU General Public License for more details.
|
20 |
*
|
21 |
* You should have received a copy of the GNU General Public License
|
22 |
* along with this program; if not, write to the Free Software
|
23 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
24 |
*
|
25 |
* For more information, contact:
|
26 |
*
|
27 |
* Generalitat Valenciana
|
28 |
* Conselleria d'Infraestructures i Transport
|
29 |
* Av. Blasco Ib??ez, 50
|
30 |
* 46010 VALENCIA
|
31 |
* SPAIN
|
32 |
*
|
33 |
* +34 963862235
|
34 |
* gvsig@gva.es
|
35 |
* www.gvsig.gva.es
|
36 |
*
|
37 |
* or
|
38 |
*
|
39 |
* IVER T.I. S.A
|
40 |
* Salamanca 50
|
41 |
* 46005 Valencia
|
42 |
* Spain
|
43 |
*
|
44 |
* +34 963163400
|
45 |
* dac@iver.es
|
46 |
*/
|
47 |
package org.cresques.ui.raster; |
48 |
|
49 |
import java.awt.BorderLayout; |
50 |
import java.awt.FlowLayout; |
51 |
|
52 |
import javax.swing.DefaultComboBoxModel; |
53 |
import javax.swing.JButton; |
54 |
import javax.swing.JComboBox; |
55 |
import javax.swing.JLabel; |
56 |
import javax.swing.JPanel; |
57 |
import javax.swing.JTextField; |
58 |
import javax.swing.plaf.basic.BasicComboBoxEditor; |
59 |
/*
|
60 |
* Created on 04-mar-2005
|
61 |
*
|
62 |
*/
|
63 |
|
64 |
/**
|
65 |
* @author Nacho Brodin <brodin_ign@gva.es>
|
66 |
*
|
67 |
*/
|
68 |
public class DataInputSaveRaster extends JPanel{ |
69 |
|
70 |
private JPanel jPanel = null; |
71 |
private JPanel coordenadas = null; |
72 |
private JPanel psup_izq = null; |
73 |
private JPanel pinf_der = null; |
74 |
public JLabel lsup_izq = null; |
75 |
private JTextField tsup_izqX = null; |
76 |
private JTextField tsup_izqY = null; |
77 |
public JLabel linf_der = null; |
78 |
public JLabel y = null; |
79 |
private JTextField tinf_derX = null; |
80 |
private JTextField tinf_derY = null; |
81 |
private JPanel datosImagen = null; |
82 |
private JPanel datosFichero = null; |
83 |
private JPanel pescalaRes = null; |
84 |
private JPanel pnombre = null; |
85 |
public JLabel lescala = null; |
86 |
private JTextField tescala = null; |
87 |
public JLabel lfile = null; |
88 |
public JLabel lresolucion = null; |
89 |
public JLabel lppp = null; |
90 |
private DefaultComboBoxModel defaultComboBoxModel = null; |
91 |
private BasicComboBoxEditor basicComboBoxEditor = null; |
92 |
private String string = null; |
93 |
private JComboBox jComboBox = null; |
94 |
public JButton bseleccion = null; |
95 |
private JPanel panchoAlto = null; |
96 |
public JLabel lancho = null; |
97 |
public JLabel jLabel2 = null; |
98 |
private JTextField tancho = null; |
99 |
private JTextField talto = null; |
100 |
public JButton bpropiedades = null; |
101 |
|
102 |
|
103 |
public DataInputSaveRaster() {
|
104 |
super();
|
105 |
initialize(); |
106 |
} |
107 |
|
108 |
private void initialize() { |
109 |
this.setLayout(new BorderLayout()); |
110 |
this.setSize(350, 208); //AnchoxAlto panel interior |
111 |
this.add(getJPanel(), java.awt.BorderLayout.CENTER);
|
112 |
} |
113 |
|
114 |
|
115 |
/**
|
116 |
* This method initializes jPanel
|
117 |
*
|
118 |
* @return javax.swing.JPanel
|
119 |
*/
|
120 |
private JPanel getJPanel() { |
121 |
if (jPanel == null) { |
122 |
jPanel = new JPanel(); |
123 |
jPanel.setLayout(new BorderLayout()); |
124 |
jPanel.add(getCoordenadas(), java.awt.BorderLayout.NORTH); |
125 |
jPanel.add(getDatosImagen(), java.awt.BorderLayout.CENTER); |
126 |
jPanel.add(getDatosFichero(), java.awt.BorderLayout.SOUTH); |
127 |
} |
128 |
return jPanel;
|
129 |
} |
130 |
/**
|
131 |
* This method initializes jPanel1
|
132 |
*
|
133 |
* @return javax.swing.JPanel
|
134 |
*/
|
135 |
private JPanel getCoordenadas() { |
136 |
if (coordenadas == null) { |
137 |
coordenadas = new JPanel(); |
138 |
coordenadas.setLayout(new BorderLayout()); |
139 |
coordenadas.setBorder(javax.swing.BorderFactory.createEmptyBorder(0,0,0,0)); |
140 |
coordenadas.add(getPsup_izq(), java.awt.BorderLayout.NORTH); |
141 |
coordenadas.add(getPinf_der(), java.awt.BorderLayout.SOUTH); |
142 |
} |
143 |
return coordenadas;
|
144 |
} |
145 |
/**
|
146 |
* This method initializes jPanel2
|
147 |
*
|
148 |
* @return javax.swing.JPanel
|
149 |
*/
|
150 |
private JPanel getPsup_izq() { |
151 |
if (psup_izq == null) { |
152 |
lsup_izq = new JLabel(); |
153 |
y = new JLabel(); |
154 |
psup_izq = new JPanel(); |
155 |
FlowLayout flowLayout1 = new FlowLayout(); |
156 |
psup_izq.setLayout(flowLayout1); |
157 |
lsup_izq.setText("Sup. izq. X:");
|
158 |
y.setText(" Y:");
|
159 |
flowLayout1.setAlignment(java.awt.FlowLayout.LEFT); |
160 |
flowLayout1.setHgap(5);
|
161 |
psup_izq.setAlignmentY(0.5F);
|
162 |
psup_izq.add(lsup_izq, null);
|
163 |
psup_izq.add(getTsup_izqX(), null);
|
164 |
psup_izq.add(y,null);
|
165 |
psup_izq.add(getTsup_izqY(), null);
|
166 |
} |
167 |
return psup_izq;
|
168 |
} |
169 |
/**
|
170 |
* This method initializes jPanel3
|
171 |
*
|
172 |
* @return javax.swing.JPanel
|
173 |
*/
|
174 |
private JPanel getPinf_der() { |
175 |
if (pinf_der == null) { |
176 |
linf_der = new JLabel(); |
177 |
pinf_der = new JPanel(); |
178 |
y = new JLabel(); |
179 |
FlowLayout flowLayout2 = new FlowLayout(); |
180 |
pinf_der.setLayout(flowLayout2); |
181 |
y.setText(" Y:");
|
182 |
linf_der.setText("Inf. der. X:");
|
183 |
flowLayout2.setAlignment(java.awt.FlowLayout.LEFT); |
184 |
pinf_der.add(linf_der, null);
|
185 |
pinf_der.add(getTinf_derX(), null);
|
186 |
pinf_der.add(y,null);
|
187 |
pinf_der.add(getTinf_derY(), null);
|
188 |
} |
189 |
return pinf_der;
|
190 |
} |
191 |
/**
|
192 |
* This method initializes jTextField
|
193 |
*
|
194 |
* @return javax.swing.JTextField
|
195 |
*/
|
196 |
public JTextField getTsup_izqX() { |
197 |
if (tsup_izqX == null) { |
198 |
tsup_izqX = new JTextField(); |
199 |
tsup_izqX.setPreferredSize(new java.awt.Dimension(110,19)); |
200 |
tsup_izqX.setText("0");
|
201 |
tsup_izqX.setMinimumSize(new java.awt.Dimension(110,19)); |
202 |
} |
203 |
return tsup_izqX;
|
204 |
} |
205 |
/**
|
206 |
* This method initializes jTextField
|
207 |
*
|
208 |
* @return javax.swing.JTextField
|
209 |
*/
|
210 |
public JTextField getTsup_izqY() { |
211 |
if (tsup_izqY == null) { |
212 |
tsup_izqY = new JTextField(); |
213 |
tsup_izqY.setMinimumSize(new java.awt.Dimension(110,19)); |
214 |
tsup_izqY.setPreferredSize(new java.awt.Dimension(110,19)); |
215 |
tsup_izqY.setText("0");
|
216 |
} |
217 |
return tsup_izqY;
|
218 |
} |
219 |
/**
|
220 |
* This method initializes jTextField
|
221 |
*
|
222 |
* @return javax.swing.JTextField
|
223 |
*/
|
224 |
public JTextField getTinf_derX() { |
225 |
if (tinf_derX == null) { |
226 |
tinf_derX = new JTextField(); |
227 |
tinf_derX.setMinimumSize(new java.awt.Dimension(110,19)); |
228 |
tinf_derX.setPreferredSize(new java.awt.Dimension(110,19)); |
229 |
tinf_derX.setText("0");
|
230 |
} |
231 |
return tinf_derX;
|
232 |
} |
233 |
/**
|
234 |
* This method initializes jTextField1
|
235 |
*
|
236 |
* @return javax.swing.JTextField
|
237 |
*/
|
238 |
public JTextField getTinf_derY() { |
239 |
if (tinf_derY == null) { |
240 |
tinf_derY = new JTextField(); |
241 |
tinf_derY.setMinimumSize(new java.awt.Dimension(110,19)); |
242 |
tinf_derY.setPreferredSize(new java.awt.Dimension(110,19)); |
243 |
tinf_derY.setText("0");
|
244 |
} |
245 |
return tinf_derY;
|
246 |
} |
247 |
/**
|
248 |
* This method initializes jPanel1
|
249 |
*
|
250 |
* @return javax.swing.JPanel
|
251 |
*/
|
252 |
private JPanel getDatosImagen() { |
253 |
if (datosImagen == null) { |
254 |
BorderLayout borderLayout1 = new BorderLayout(); |
255 |
datosImagen = new JPanel(); |
256 |
datosImagen.setLayout(borderLayout1); |
257 |
datosImagen.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray,1));
|
258 |
datosImagen.setAlignmentY(0.5F);
|
259 |
borderLayout1.setHgap(0);
|
260 |
borderLayout1.setVgap(0);
|
261 |
datosImagen.add(getPescalaRes(), java.awt.BorderLayout.NORTH); |
262 |
datosImagen.add(getPanchoAlto(), java.awt.BorderLayout.SOUTH); |
263 |
} |
264 |
return datosImagen;
|
265 |
} |
266 |
/**
|
267 |
* This method initializes jPanel2
|
268 |
*
|
269 |
* @return javax.swing.JPanel
|
270 |
*/
|
271 |
private JPanel getDatosFichero() { |
272 |
if (datosFichero == null) { |
273 |
datosFichero = new JPanel(); |
274 |
datosFichero.setLayout(new BorderLayout()); |
275 |
datosFichero.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
|
276 |
datosFichero.setBorder(javax.swing.BorderFactory.createEmptyBorder(0,0,0,0)); |
277 |
datosFichero.add(getPnombre(), java.awt.BorderLayout.CENTER); |
278 |
} |
279 |
return datosFichero;
|
280 |
} |
281 |
/**
|
282 |
* This method initializes jPanel1
|
283 |
*
|
284 |
* @return javax.swing.JPanel
|
285 |
*/
|
286 |
private JPanel getPescalaRes() { |
287 |
if (pescalaRes == null) { |
288 |
lescala = new JLabel(); |
289 |
lresolucion = new JLabel(); |
290 |
lppp = new JLabel(); |
291 |
FlowLayout flowLayout3 = new FlowLayout(); |
292 |
pescalaRes = new JPanel(); |
293 |
pescalaRes.setLayout(flowLayout3); |
294 |
lescala.setText("Escala 1:");
|
295 |
lresolucion.setText("Resoluci?n");
|
296 |
lppp.setText("ppp");
|
297 |
lresolucion.setName("");
|
298 |
flowLayout3.setAlignment(java.awt.FlowLayout.LEFT); |
299 |
flowLayout3.setVgap(20);
|
300 |
pescalaRes.add(lescala, null);
|
301 |
pescalaRes.add(getTescala(), null);
|
302 |
pescalaRes.add(lresolucion, null);
|
303 |
pescalaRes.add(getJComboBox(), null);
|
304 |
pescalaRes.add(lppp, null);
|
305 |
} |
306 |
return pescalaRes;
|
307 |
} |
308 |
/**
|
309 |
* This method initializes jPanel3
|
310 |
*
|
311 |
* @return javax.swing.JPanel
|
312 |
*/
|
313 |
private JPanel getPnombre() { |
314 |
if (pnombre == null) { |
315 |
lfile = new JLabel(); |
316 |
pnombre = new JPanel(); |
317 |
FlowLayout flowLayout4 = new FlowLayout(); |
318 |
pnombre.setLayout(flowLayout4); |
319 |
lfile.setText("Fichero");
|
320 |
flowLayout4.setAlignment(java.awt.FlowLayout.LEFT); |
321 |
pnombre.add(lfile, null);
|
322 |
pnombre.add(getBseleccion(), null);
|
323 |
pnombre.add(this.getBPropiedades(), null); |
324 |
this.getBPropiedades().setText("Propiedades GeoTiff"); |
325 |
} |
326 |
return pnombre;
|
327 |
} |
328 |
/**
|
329 |
* This method initializes jTextField
|
330 |
*
|
331 |
* @return javax.swing.JTextField
|
332 |
*/
|
333 |
public JTextField getTescala() { |
334 |
if (tescala == null) { |
335 |
tescala = new JTextField(); |
336 |
tescala.setMinimumSize(new java.awt.Dimension(70,19)); |
337 |
tescala.setPreferredSize(new java.awt.Dimension(80,19)); |
338 |
tescala.setText("0");
|
339 |
} |
340 |
return tescala;
|
341 |
} |
342 |
|
343 |
private Object makeObj(final String item) { |
344 |
return new Object() { public String toString() { return item; } }; |
345 |
} |
346 |
|
347 |
/**
|
348 |
* This method initializes defaultComboBoxModel
|
349 |
*
|
350 |
* @return javax.swing.DefaultComboBoxModel
|
351 |
*/
|
352 |
private DefaultComboBoxModel getDefaultComboBoxModel() { |
353 |
if (defaultComboBoxModel == null) { |
354 |
defaultComboBoxModel = new DefaultComboBoxModel(); |
355 |
} |
356 |
return defaultComboBoxModel;
|
357 |
} |
358 |
/**
|
359 |
* This method initializes basicComboBoxEditor
|
360 |
*
|
361 |
* @return javax.swing.plaf.basic.BasicComboBoxEditor
|
362 |
*/
|
363 |
private BasicComboBoxEditor getBasicComboBoxEditor() { |
364 |
if (basicComboBoxEditor == null) { |
365 |
basicComboBoxEditor = new BasicComboBoxEditor(); |
366 |
basicComboBoxEditor.setItem(getString()); |
367 |
} |
368 |
return basicComboBoxEditor;
|
369 |
} |
370 |
/**
|
371 |
* This method initializes string
|
372 |
*
|
373 |
* @return java.lang.String
|
374 |
*/
|
375 |
private String getString() { |
376 |
if (string == null) { |
377 |
string = new String(); |
378 |
} |
379 |
return string;
|
380 |
} |
381 |
/**
|
382 |
* This method initializes jComboBox
|
383 |
*
|
384 |
* @return javax.swing.JComboBox
|
385 |
*/
|
386 |
public JComboBox getJComboBox() { |
387 |
if (jComboBox == null) { |
388 |
String[] lista={"75","150","300"}; |
389 |
jComboBox = new JComboBox(lista); |
390 |
jComboBox.setPreferredSize(new java.awt.Dimension(70,24)); |
391 |
} |
392 |
return jComboBox;
|
393 |
} |
394 |
|
395 |
/**
|
396 |
* This method initializes jComboBox
|
397 |
*
|
398 |
* @return javax.swing.JComboBox
|
399 |
*/
|
400 |
public JButton getBPropiedades() { |
401 |
if (bpropiedades == null) { |
402 |
bpropiedades = new JButton(); |
403 |
} |
404 |
return bpropiedades;
|
405 |
} |
406 |
|
407 |
/**
|
408 |
* This method initializes jButton
|
409 |
*
|
410 |
* @return javax.swing.JButton
|
411 |
*/
|
412 |
public JButton getBseleccion() { |
413 |
if (bseleccion == null) { |
414 |
bseleccion = new JButton(); |
415 |
bseleccion.setText("Seleccionar");
|
416 |
} |
417 |
return bseleccion;
|
418 |
} |
419 |
/**
|
420 |
* This method initializes jPanel1
|
421 |
*
|
422 |
* @return javax.swing.JPanel
|
423 |
*/
|
424 |
private JPanel getPanchoAlto() { |
425 |
if (panchoAlto == null) { |
426 |
jLabel2 = new JLabel(); |
427 |
lancho = new JLabel(); |
428 |
FlowLayout flowLayout5 = new FlowLayout(); |
429 |
panchoAlto = new JPanel(); |
430 |
panchoAlto.setLayout(flowLayout5); |
431 |
lancho.setText("Ancho.");
|
432 |
flowLayout5.setAlignment(java.awt.FlowLayout.LEFT); |
433 |
flowLayout5.setVgap(20);
|
434 |
jLabel2.setText("Alto.");
|
435 |
panchoAlto.add(lancho, null);
|
436 |
panchoAlto.add(getTancho(), null);
|
437 |
panchoAlto.add(jLabel2, null);
|
438 |
panchoAlto.add(getTalto(), null);
|
439 |
|
440 |
} |
441 |
return panchoAlto;
|
442 |
} |
443 |
|
444 |
/**
|
445 |
* This method initializes jTextField
|
446 |
*
|
447 |
* @return javax.swing.JTextField
|
448 |
*/
|
449 |
public JTextField getTancho() { |
450 |
if (tancho == null) { |
451 |
tancho = new JTextField(); |
452 |
tancho.setPreferredSize(new java.awt.Dimension(80,19)); |
453 |
tancho.setEditable(false);
|
454 |
tancho.setText("0");
|
455 |
} |
456 |
return tancho;
|
457 |
} |
458 |
/**
|
459 |
* This method initializes jTextField1
|
460 |
*
|
461 |
* @return javax.swing.JTextField
|
462 |
*/
|
463 |
public JTextField getTalto() { |
464 |
if (talto == null) { |
465 |
talto = new JTextField(); |
466 |
talto.setPreferredSize(new java.awt.Dimension(80,19)); |
467 |
talto.setText("0");
|
468 |
talto.setEditable(false);
|
469 |
} |
470 |
return talto;
|
471 |
} |
472 |
} |