svn-gvsig-desktop / branches / CqCMSDvp / libraries / libCq CMS for java.old / src / org / cresques / ui / raster / DataInputSaveRaster.java @ 1736
History | View | Annotate | Download (11.1 KB)
1 |
package org.cresques.ui.raster; |
---|---|
2 |
|
3 |
import javax.swing.JPanel; |
4 |
import java.awt.BorderLayout; |
5 |
import javax.swing.JLabel; |
6 |
import java.awt.FlowLayout; |
7 |
|
8 |
import javax.swing.JScrollPane; |
9 |
import javax.swing.JTextField; |
10 |
import javax.swing.JComboBox; |
11 |
import javax.swing.DefaultComboBoxModel; |
12 |
import javax.swing.plaf.basic.BasicComboBoxEditor; |
13 |
import java.lang.String; |
14 |
import javax.swing.JButton; |
15 |
/*
|
16 |
* Created on 04-mar-2005
|
17 |
*
|
18 |
*/
|
19 |
|
20 |
/**
|
21 |
* @author Nacho Brodin <brodin_ign@gva.es>
|
22 |
*
|
23 |
*/
|
24 |
public class DataInputSaveRaster extends JPanel{ |
25 |
|
26 |
private JPanel jPanel = null; |
27 |
private JPanel coordenadas = null; |
28 |
private JPanel psup_izq = null; |
29 |
private JPanel pinf_der = null; |
30 |
private JLabel lsup_izq = null; |
31 |
private JTextField tsup_izqX = null; |
32 |
private JTextField tsup_izqY = null; |
33 |
private JLabel linf_der = null; |
34 |
private JLabel y = null; |
35 |
private JTextField tinf_derX = null; |
36 |
private JTextField tinf_derY = null; |
37 |
private JPanel datosImagen = null; |
38 |
private JPanel datosFichero = null; |
39 |
private JPanel pescalaRes = null; |
40 |
private JPanel pnombre = null; |
41 |
private JLabel lescala = null; |
42 |
private JTextField tescala = null; |
43 |
private JLabel lfile = null; |
44 |
private JLabel lresolucion = null; |
45 |
private JLabel lppp = null; |
46 |
private DefaultComboBoxModel defaultComboBoxModel = null; |
47 |
private BasicComboBoxEditor basicComboBoxEditor = null; |
48 |
private String string = null; |
49 |
private JComboBox jComboBox = null; |
50 |
private JButton bseleccion = null; |
51 |
private JPanel panchoAlto = null; |
52 |
private JLabel lancho = null; |
53 |
private JLabel jLabel2 = null; |
54 |
private JTextField tancho = null; |
55 |
private JTextField talto = null; |
56 |
private JButton bpropiedades = null; |
57 |
|
58 |
|
59 |
public DataInputSaveRaster() {
|
60 |
super();
|
61 |
initialize(); |
62 |
} |
63 |
|
64 |
private void initialize() { |
65 |
this.setLayout(new BorderLayout()); |
66 |
this.setSize(350, 208); //AnchoxAlto panel interior |
67 |
this.add(getJPanel(), java.awt.BorderLayout.CENTER);
|
68 |
} |
69 |
|
70 |
|
71 |
/**
|
72 |
* This method initializes jPanel
|
73 |
*
|
74 |
* @return javax.swing.JPanel
|
75 |
*/
|
76 |
private JPanel getJPanel() { |
77 |
if (jPanel == null) { |
78 |
jPanel = new JPanel(); |
79 |
jPanel.setLayout(new BorderLayout()); |
80 |
jPanel.add(getCoordenadas(), java.awt.BorderLayout.NORTH); |
81 |
jPanel.add(getDatosImagen(), java.awt.BorderLayout.CENTER); |
82 |
jPanel.add(getDatosFichero(), java.awt.BorderLayout.SOUTH); |
83 |
} |
84 |
return jPanel;
|
85 |
} |
86 |
/**
|
87 |
* This method initializes jPanel1
|
88 |
*
|
89 |
* @return javax.swing.JPanel
|
90 |
*/
|
91 |
private JPanel getCoordenadas() { |
92 |
if (coordenadas == null) { |
93 |
coordenadas = new JPanel(); |
94 |
coordenadas.setLayout(new BorderLayout()); |
95 |
coordenadas.setBorder(javax.swing.BorderFactory.createEmptyBorder(0,0,0,0)); |
96 |
coordenadas.add(getPsup_izq(), java.awt.BorderLayout.NORTH); |
97 |
coordenadas.add(getPinf_der(), java.awt.BorderLayout.SOUTH); |
98 |
} |
99 |
return coordenadas;
|
100 |
} |
101 |
/**
|
102 |
* This method initializes jPanel2
|
103 |
*
|
104 |
* @return javax.swing.JPanel
|
105 |
*/
|
106 |
private JPanel getPsup_izq() { |
107 |
if (psup_izq == null) { |
108 |
lsup_izq = new JLabel(); |
109 |
y = new JLabel(); |
110 |
psup_izq = new JPanel(); |
111 |
FlowLayout flowLayout1 = new FlowLayout(); |
112 |
psup_izq.setLayout(flowLayout1); |
113 |
lsup_izq.setText("Sup. izq. X:");
|
114 |
y.setText(" Y:");
|
115 |
flowLayout1.setAlignment(java.awt.FlowLayout.LEFT); |
116 |
flowLayout1.setHgap(5);
|
117 |
psup_izq.setAlignmentY(0.5F);
|
118 |
psup_izq.add(lsup_izq, null);
|
119 |
psup_izq.add(getTsup_izqX(), null);
|
120 |
psup_izq.add(y,null);
|
121 |
psup_izq.add(getTsup_izqY(), null);
|
122 |
} |
123 |
return psup_izq;
|
124 |
} |
125 |
/**
|
126 |
* This method initializes jPanel3
|
127 |
*
|
128 |
* @return javax.swing.JPanel
|
129 |
*/
|
130 |
private JPanel getPinf_der() { |
131 |
if (pinf_der == null) { |
132 |
linf_der = new JLabel(); |
133 |
pinf_der = new JPanel(); |
134 |
y = new JLabel(); |
135 |
FlowLayout flowLayout2 = new FlowLayout(); |
136 |
pinf_der.setLayout(flowLayout2); |
137 |
y.setText(" Y:");
|
138 |
linf_der.setText("Inf. der. X:");
|
139 |
flowLayout2.setAlignment(java.awt.FlowLayout.LEFT); |
140 |
pinf_der.add(linf_der, null);
|
141 |
pinf_der.add(getTinf_derX(), null);
|
142 |
pinf_der.add(y,null);
|
143 |
pinf_der.add(getTinf_derY(), null);
|
144 |
} |
145 |
return pinf_der;
|
146 |
} |
147 |
/**
|
148 |
* This method initializes jTextField
|
149 |
*
|
150 |
* @return javax.swing.JTextField
|
151 |
*/
|
152 |
public JTextField getTsup_izqX() { |
153 |
if (tsup_izqX == null) { |
154 |
tsup_izqX = new JTextField(); |
155 |
tsup_izqX.setPreferredSize(new java.awt.Dimension(110,19)); |
156 |
tsup_izqX.setText("0");
|
157 |
tsup_izqX.setMinimumSize(new java.awt.Dimension(110,19)); |
158 |
} |
159 |
return tsup_izqX;
|
160 |
} |
161 |
/**
|
162 |
* This method initializes jTextField
|
163 |
*
|
164 |
* @return javax.swing.JTextField
|
165 |
*/
|
166 |
public JTextField getTsup_izqY() { |
167 |
if (tsup_izqY == null) { |
168 |
tsup_izqY = new JTextField(); |
169 |
tsup_izqY.setMinimumSize(new java.awt.Dimension(110,19)); |
170 |
tsup_izqY.setPreferredSize(new java.awt.Dimension(110,19)); |
171 |
tsup_izqY.setText("0");
|
172 |
} |
173 |
return tsup_izqY;
|
174 |
} |
175 |
/**
|
176 |
* This method initializes jTextField
|
177 |
*
|
178 |
* @return javax.swing.JTextField
|
179 |
*/
|
180 |
public JTextField getTinf_derX() { |
181 |
if (tinf_derX == null) { |
182 |
tinf_derX = new JTextField(); |
183 |
tinf_derX.setMinimumSize(new java.awt.Dimension(110,19)); |
184 |
tinf_derX.setPreferredSize(new java.awt.Dimension(110,19)); |
185 |
tinf_derX.setText("0");
|
186 |
} |
187 |
return tinf_derX;
|
188 |
} |
189 |
/**
|
190 |
* This method initializes jTextField1
|
191 |
*
|
192 |
* @return javax.swing.JTextField
|
193 |
*/
|
194 |
public JTextField getTinf_derY() { |
195 |
if (tinf_derY == null) { |
196 |
tinf_derY = new JTextField(); |
197 |
tinf_derY.setMinimumSize(new java.awt.Dimension(110,19)); |
198 |
tinf_derY.setPreferredSize(new java.awt.Dimension(110,19)); |
199 |
tinf_derY.setText("0");
|
200 |
} |
201 |
return tinf_derY;
|
202 |
} |
203 |
/**
|
204 |
* This method initializes jPanel1
|
205 |
*
|
206 |
* @return javax.swing.JPanel
|
207 |
*/
|
208 |
private JPanel getDatosImagen() { |
209 |
if (datosImagen == null) { |
210 |
BorderLayout borderLayout1 = new BorderLayout(); |
211 |
datosImagen = new JPanel(); |
212 |
datosImagen.setLayout(borderLayout1); |
213 |
datosImagen.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray,1));
|
214 |
datosImagen.setAlignmentY(0.5F);
|
215 |
borderLayout1.setHgap(0);
|
216 |
borderLayout1.setVgap(0);
|
217 |
datosImagen.add(getPescalaRes(), java.awt.BorderLayout.NORTH); |
218 |
datosImagen.add(getPanchoAlto(), java.awt.BorderLayout.SOUTH); |
219 |
} |
220 |
return datosImagen;
|
221 |
} |
222 |
/**
|
223 |
* This method initializes jPanel2
|
224 |
*
|
225 |
* @return javax.swing.JPanel
|
226 |
*/
|
227 |
private JPanel getDatosFichero() { |
228 |
if (datosFichero == null) { |
229 |
datosFichero = new JPanel(); |
230 |
datosFichero.setLayout(new BorderLayout()); |
231 |
datosFichero.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
|
232 |
datosFichero.setBorder(javax.swing.BorderFactory.createEmptyBorder(0,0,0,0)); |
233 |
datosFichero.add(getPnombre(), java.awt.BorderLayout.CENTER); |
234 |
} |
235 |
return datosFichero;
|
236 |
} |
237 |
/**
|
238 |
* This method initializes jPanel1
|
239 |
*
|
240 |
* @return javax.swing.JPanel
|
241 |
*/
|
242 |
private JPanel getPescalaRes() { |
243 |
if (pescalaRes == null) { |
244 |
lescala = new JLabel(); |
245 |
lresolucion = new JLabel(); |
246 |
lppp = new JLabel(); |
247 |
FlowLayout flowLayout3 = new FlowLayout(); |
248 |
pescalaRes = new JPanel(); |
249 |
pescalaRes.setLayout(flowLayout3); |
250 |
lescala.setText("Escala 1:");
|
251 |
lresolucion.setText("Resoluci?n");
|
252 |
lppp.setText("ppp");
|
253 |
lresolucion.setName("");
|
254 |
flowLayout3.setAlignment(java.awt.FlowLayout.LEFT); |
255 |
flowLayout3.setVgap(20);
|
256 |
pescalaRes.add(lescala, null);
|
257 |
pescalaRes.add(getTescala(), null);
|
258 |
pescalaRes.add(lresolucion, null);
|
259 |
pescalaRes.add(getJComboBox(), null);
|
260 |
pescalaRes.add(lppp, null);
|
261 |
} |
262 |
return pescalaRes;
|
263 |
} |
264 |
/**
|
265 |
* This method initializes jPanel3
|
266 |
*
|
267 |
* @return javax.swing.JPanel
|
268 |
*/
|
269 |
private JPanel getPnombre() { |
270 |
if (pnombre == null) { |
271 |
lfile = new JLabel(); |
272 |
pnombre = new JPanel(); |
273 |
FlowLayout flowLayout4 = new FlowLayout(); |
274 |
pnombre.setLayout(flowLayout4); |
275 |
lfile.setText("Fichero");
|
276 |
flowLayout4.setAlignment(java.awt.FlowLayout.LEFT); |
277 |
pnombre.add(lfile, null);
|
278 |
pnombre.add(getBseleccion(), null);
|
279 |
pnombre.add(this.getBPropiedades(), null); |
280 |
this.getBPropiedades().setText("Propiedades GTiff"); |
281 |
} |
282 |
return pnombre;
|
283 |
} |
284 |
/**
|
285 |
* This method initializes jTextField
|
286 |
*
|
287 |
* @return javax.swing.JTextField
|
288 |
*/
|
289 |
public JTextField getTescala() { |
290 |
if (tescala == null) { |
291 |
tescala = new JTextField(); |
292 |
tescala.setMinimumSize(new java.awt.Dimension(70,19)); |
293 |
tescala.setPreferredSize(new java.awt.Dimension(80,19)); |
294 |
tescala.setText("0");
|
295 |
} |
296 |
return tescala;
|
297 |
} |
298 |
|
299 |
private Object makeObj(final String item) { |
300 |
return new Object() { public String toString() { return item; } }; |
301 |
} |
302 |
|
303 |
/**
|
304 |
* This method initializes defaultComboBoxModel
|
305 |
*
|
306 |
* @return javax.swing.DefaultComboBoxModel
|
307 |
*/
|
308 |
private DefaultComboBoxModel getDefaultComboBoxModel() { |
309 |
if (defaultComboBoxModel == null) { |
310 |
defaultComboBoxModel = new DefaultComboBoxModel(); |
311 |
} |
312 |
return defaultComboBoxModel;
|
313 |
} |
314 |
/**
|
315 |
* This method initializes basicComboBoxEditor
|
316 |
*
|
317 |
* @return javax.swing.plaf.basic.BasicComboBoxEditor
|
318 |
*/
|
319 |
private BasicComboBoxEditor getBasicComboBoxEditor() { |
320 |
if (basicComboBoxEditor == null) { |
321 |
basicComboBoxEditor = new BasicComboBoxEditor(); |
322 |
basicComboBoxEditor.setItem(getString()); |
323 |
} |
324 |
return basicComboBoxEditor;
|
325 |
} |
326 |
/**
|
327 |
* This method initializes string
|
328 |
*
|
329 |
* @return java.lang.String
|
330 |
*/
|
331 |
private String getString() { |
332 |
if (string == null) { |
333 |
string = new String(); |
334 |
} |
335 |
return string;
|
336 |
} |
337 |
/**
|
338 |
* This method initializes jComboBox
|
339 |
*
|
340 |
* @return javax.swing.JComboBox
|
341 |
*/
|
342 |
public JComboBox getJComboBox() { |
343 |
if (jComboBox == null) { |
344 |
String[] lista={"75","150","300"}; |
345 |
jComboBox = new JComboBox(lista); |
346 |
jComboBox.setPreferredSize(new java.awt.Dimension(70,24)); |
347 |
} |
348 |
return jComboBox;
|
349 |
} |
350 |
|
351 |
/**
|
352 |
* This method initializes jComboBox
|
353 |
*
|
354 |
* @return javax.swing.JComboBox
|
355 |
*/
|
356 |
public JButton getBPropiedades() { |
357 |
if (bpropiedades == null) { |
358 |
bpropiedades = new JButton(); |
359 |
} |
360 |
return bpropiedades;
|
361 |
} |
362 |
|
363 |
/**
|
364 |
* This method initializes jButton
|
365 |
*
|
366 |
* @return javax.swing.JButton
|
367 |
*/
|
368 |
public JButton getBseleccion() { |
369 |
if (bseleccion == null) { |
370 |
bseleccion = new JButton(); |
371 |
bseleccion.setText("Seleccionar");
|
372 |
} |
373 |
return bseleccion;
|
374 |
} |
375 |
/**
|
376 |
* This method initializes jPanel1
|
377 |
*
|
378 |
* @return javax.swing.JPanel
|
379 |
*/
|
380 |
private JPanel getPanchoAlto() { |
381 |
if (panchoAlto == null) { |
382 |
jLabel2 = new JLabel(); |
383 |
lancho = new JLabel(); |
384 |
FlowLayout flowLayout5 = new FlowLayout(); |
385 |
panchoAlto = new JPanel(); |
386 |
panchoAlto.setLayout(flowLayout5); |
387 |
lancho.setText("Ancho.");
|
388 |
flowLayout5.setAlignment(java.awt.FlowLayout.LEFT); |
389 |
flowLayout5.setVgap(20);
|
390 |
jLabel2.setText("Alto.");
|
391 |
panchoAlto.add(lancho, null);
|
392 |
panchoAlto.add(getTancho(), null);
|
393 |
panchoAlto.add(jLabel2, null);
|
394 |
panchoAlto.add(getTalto(), null);
|
395 |
|
396 |
} |
397 |
return panchoAlto;
|
398 |
} |
399 |
|
400 |
/**
|
401 |
* This method initializes jTextField
|
402 |
*
|
403 |
* @return javax.swing.JTextField
|
404 |
*/
|
405 |
public JTextField getTancho() { |
406 |
if (tancho == null) { |
407 |
tancho = new JTextField(); |
408 |
tancho.setPreferredSize(new java.awt.Dimension(80,19)); |
409 |
tancho.setEditable(false);
|
410 |
tancho.setText("0");
|
411 |
} |
412 |
return tancho;
|
413 |
} |
414 |
/**
|
415 |
* This method initializes jTextField1
|
416 |
*
|
417 |
* @return javax.swing.JTextField
|
418 |
*/
|
419 |
public JTextField getTalto() { |
420 |
if (talto == null) { |
421 |
talto = new JTextField(); |
422 |
talto.setPreferredSize(new java.awt.Dimension(80,19)); |
423 |
talto.setText("0");
|
424 |
talto.setEditable(false);
|
425 |
} |
426 |
return talto;
|
427 |
} |
428 |
} |