svn-gvsig-desktop / tags / v10_RC2c / applications / appgvSIG / src / com / iver / cit / gvsig / gui / project / MapProperties.java @ 8745
History | View | Annotate | Download (20.1 KB)
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.gui.project; |
42 |
|
43 |
|
44 |
|
45 |
|
46 |
import java.awt.event.ActionListener; |
47 |
|
48 |
import javax.swing.JCheckBox; |
49 |
import javax.swing.JPanel; |
50 |
|
51 |
import org.gvsig.gui.beans.AcceptCancelPanel; |
52 |
|
53 |
import com.iver.andami.PluginServices; |
54 |
import com.iver.andami.messages.NotificationManager; |
55 |
import com.iver.andami.ui.mdiManager.IWindow; |
56 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
57 |
import com.iver.cit.gvsig.project.ProjectMap; |
58 |
|
59 |
import java.awt.FlowLayout; |
60 |
import java.awt.GridLayout; |
61 |
/**
|
62 |
* Dialogo con la informaci?n de los mapas
|
63 |
*
|
64 |
* @author Fernando Gonz?lez Cort?s
|
65 |
*/
|
66 |
public class MapProperties extends JPanel implements IWindow { |
67 |
private javax.swing.JPanel jContentPane = null; // @jve:decl-index=0:visual-constraint="14,17" |
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 jLabel3 = null; |
75 |
private javax.swing.JScrollPane jScrollPane = null; |
76 |
private javax.swing.JTextArea txtComments = null; |
77 |
private javax.swing.JLabel jLabel4 = null; |
78 |
private javax.swing.JTextField txtHorizontal = null; |
79 |
private javax.swing.JLabel jLabel5 = null; |
80 |
private javax.swing.JTextField txtVertical = null; |
81 |
private javax.swing.JCheckBox chkMalla = null; |
82 |
private ProjectMap map;
|
83 |
private javax.swing.JPanel jPanel = null; |
84 |
private javax.swing.JPanel jPanel1 = null; |
85 |
private javax.swing.JPanel jPanel2 = null; |
86 |
private javax.swing.JPanel jPanel3 = null; |
87 |
private javax.swing.JLabel jLabel6 = null; |
88 |
|
89 |
private javax.swing.JPanel jPanel4 = null; |
90 |
private javax.swing.JLabel jLabel7 = null; |
91 |
private javax.swing.JLabel jLabel8 = null; |
92 |
private javax.swing.JCheckBox jCheckBox = null; |
93 |
private javax.swing.JPanel jPanel5 = null; |
94 |
private JCheckBox jCheckBox1 = null; |
95 |
private JCheckBox chbEditable = null; |
96 |
private AcceptCancelPanel accept;
|
97 |
/**
|
98 |
* This method initializes
|
99 |
*
|
100 |
*/
|
101 |
public MapProperties() {
|
102 |
super();
|
103 |
initialize(); |
104 |
} |
105 |
/**
|
106 |
* This is the default constructor
|
107 |
*
|
108 |
* @param f frame padre del dialogo
|
109 |
* @param m mapa cuya informaci?n se presenta
|
110 |
*/
|
111 |
public MapProperties(ProjectMap m) {
|
112 |
map = m; |
113 |
initialize(); |
114 |
} |
115 |
|
116 |
/**
|
117 |
* This method initializes this
|
118 |
*/
|
119 |
private void initialize() { |
120 |
this.setSize(425, 428); |
121 |
this.setPreferredSize(new java.awt.Dimension(410,400)); |
122 |
this.add(getJContentPane(), null); |
123 |
getTxtName().setText(map.getName()); |
124 |
getTxtDate().setText(map.getCreationDate()); |
125 |
getTxtOwner().setText(map.getOwner()); |
126 |
getTxtComments().setText(map.getComment()); |
127 |
|
128 |
getTxtHorizontal().setText(Double.toString(map.getModel().getAtributes().getNumUnitsX()));
|
129 |
getTxtVertical().setText(Double.toString(map.getModel().getAtributes().getNumUnitsY()));
|
130 |
|
131 |
getChkMalla().setSelected(map.getModel().isCuadricula()); |
132 |
//map.getModel().setProjectMap(map);
|
133 |
} |
134 |
|
135 |
/**
|
136 |
* This method initializes jContentPane
|
137 |
*
|
138 |
* @return javax.swing.JPanel
|
139 |
*/
|
140 |
private javax.swing.JPanel getJContentPane() {
|
141 |
if (jContentPane == null) { |
142 |
jContentPane = new javax.swing.JPanel();
|
143 |
|
144 |
java.awt.FlowLayout layFlowLayout10 = new java.awt.FlowLayout();
|
145 |
layFlowLayout10.setHgap(0);
|
146 |
jContentPane.setLayout(layFlowLayout10); |
147 |
jContentPane.add(getJPanel(), null);
|
148 |
jContentPane.add(getJPanel1(), null);
|
149 |
jContentPane.add(getJPanel2(), null);
|
150 |
jContentPane.add(getJPanel3(), null);
|
151 |
jContentPane.add(getJPanel5(), null);
|
152 |
jContentPane.setPreferredSize(new java.awt.Dimension(400,410)); |
153 |
jContentPane.setSize(new java.awt.Dimension(308,375)); |
154 |
jContentPane.add(getJPanel4(), null);
|
155 |
jContentPane.add(getAcceptCancelPanel(), null);
|
156 |
} |
157 |
|
158 |
return jContentPane;
|
159 |
} |
160 |
|
161 |
/**
|
162 |
* This method initializes jLabel
|
163 |
*
|
164 |
* @return javax.swing.JLabel
|
165 |
*/
|
166 |
private javax.swing.JLabel getJLabel() {
|
167 |
if (jLabel == null) { |
168 |
jLabel = new javax.swing.JLabel();
|
169 |
jLabel.setText(PluginServices.getText(this, "nombre") + ":"); |
170 |
jLabel.setPreferredSize(new java.awt.Dimension(180,20)); |
171 |
jLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); |
172 |
} |
173 |
|
174 |
return jLabel;
|
175 |
} |
176 |
|
177 |
/**
|
178 |
* This method initializes txtName
|
179 |
*
|
180 |
* @return javax.swing.JTextField
|
181 |
*/
|
182 |
private javax.swing.JTextField getTxtName() {
|
183 |
if (txtName == null) { |
184 |
txtName = new javax.swing.JTextField();
|
185 |
txtName.setPreferredSize(new java.awt.Dimension(190, 20)); |
186 |
} |
187 |
|
188 |
return txtName;
|
189 |
} |
190 |
|
191 |
/**
|
192 |
* This method initializes jLabel1
|
193 |
*
|
194 |
* @return javax.swing.JLabel
|
195 |
*/
|
196 |
private javax.swing.JLabel getJLabel1() {
|
197 |
if (jLabel1 == null) { |
198 |
jLabel1 = new javax.swing.JLabel();
|
199 |
jLabel1.setText(PluginServices.getText(this, "creation_date") + ":"); |
200 |
jLabel1.setPreferredSize(new java.awt.Dimension(180,20)); |
201 |
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); |
202 |
} |
203 |
|
204 |
return jLabel1;
|
205 |
} |
206 |
|
207 |
/**
|
208 |
* This method initializes txtDate
|
209 |
*
|
210 |
* @return javax.swing.JTextField
|
211 |
*/
|
212 |
private javax.swing.JTextField getTxtDate() {
|
213 |
if (txtDate == null) { |
214 |
txtDate = new javax.swing.JTextField();
|
215 |
txtDate.setPreferredSize(new java.awt.Dimension(190, 20)); |
216 |
txtDate.setEditable(false);
|
217 |
txtDate.setBackground(java.awt.Color.white); |
218 |
} |
219 |
|
220 |
return txtDate;
|
221 |
} |
222 |
|
223 |
/**
|
224 |
* This method initializes jLabel2
|
225 |
*
|
226 |
* @return javax.swing.JLabel
|
227 |
*/
|
228 |
private javax.swing.JLabel getJLabel2() {
|
229 |
if (jLabel2 == null) { |
230 |
jLabel2 = new javax.swing.JLabel();
|
231 |
jLabel2.setText(PluginServices.getText(this, "owner") + ":"); |
232 |
jLabel2.setPreferredSize(new java.awt.Dimension(180,20)); |
233 |
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); |
234 |
} |
235 |
|
236 |
return jLabel2;
|
237 |
} |
238 |
|
239 |
/**
|
240 |
* This method initializes txtOwner
|
241 |
*
|
242 |
* @return javax.swing.JTextField
|
243 |
*/
|
244 |
private javax.swing.JTextField getTxtOwner() {
|
245 |
if (txtOwner == null) { |
246 |
txtOwner = new javax.swing.JTextField();
|
247 |
txtOwner.setPreferredSize(new java.awt.Dimension(190, 20)); |
248 |
} |
249 |
|
250 |
return txtOwner;
|
251 |
} |
252 |
|
253 |
/**
|
254 |
* This method initializes jLabel3
|
255 |
*
|
256 |
* @return javax.swing.JLabel
|
257 |
*/
|
258 |
private javax.swing.JLabel getJLabel3() {
|
259 |
if (jLabel3 == null) { |
260 |
jLabel3 = new javax.swing.JLabel();
|
261 |
jLabel3.setText(PluginServices.getText(this, "comentarios") + ":"); |
262 |
jLabel3.setHorizontalTextPosition(javax.swing.SwingConstants.TRAILING); |
263 |
jLabel3.setVerticalAlignment(javax.swing.SwingConstants.TOP); |
264 |
jLabel3.setPreferredSize(new java.awt.Dimension(180,20)); |
265 |
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); |
266 |
} |
267 |
|
268 |
return jLabel3;
|
269 |
} |
270 |
|
271 |
/**
|
272 |
* This method initializes jScrollPane
|
273 |
*
|
274 |
* @return javax.swing.JScrollPane
|
275 |
*/
|
276 |
private javax.swing.JScrollPane getJScrollPane() {
|
277 |
if (jScrollPane == null) { |
278 |
jScrollPane = new javax.swing.JScrollPane();
|
279 |
jScrollPane.setPreferredSize(new java.awt.Dimension(190,50)); |
280 |
jScrollPane.setViewportView(getTxtComments()); |
281 |
} |
282 |
|
283 |
return jScrollPane;
|
284 |
} |
285 |
|
286 |
/**
|
287 |
* This method initializes txtComments
|
288 |
*
|
289 |
* @return javax.swing.JTextArea
|
290 |
*/
|
291 |
private javax.swing.JTextArea getTxtComments() {
|
292 |
if (txtComments == null) { |
293 |
txtComments = new javax.swing.JTextArea();
|
294 |
} |
295 |
|
296 |
return txtComments;
|
297 |
} |
298 |
|
299 |
/**
|
300 |
* This method initializes jLabel4
|
301 |
*
|
302 |
* @return javax.swing.JLabel
|
303 |
*/
|
304 |
private javax.swing.JLabel getJLabel4() {
|
305 |
if (jLabel4 == null) { |
306 |
jLabel4 = new javax.swing.JLabel();
|
307 |
jLabel4.setText(PluginServices.getText(this, "espaciado_horizontal") + |
308 |
":");
|
309 |
} |
310 |
|
311 |
return jLabel4;
|
312 |
} |
313 |
|
314 |
/**
|
315 |
* This method initializes txtHorizontal
|
316 |
*
|
317 |
* @return javax.swing.JTextField
|
318 |
*/
|
319 |
private javax.swing.JTextField getTxtHorizontal() {
|
320 |
if (txtHorizontal == null) { |
321 |
txtHorizontal = new javax.swing.JTextField();
|
322 |
txtHorizontal.setPreferredSize(new java.awt.Dimension(40, 20)); |
323 |
txtHorizontal.setHorizontalAlignment(javax.swing.JTextField.CENTER); |
324 |
} |
325 |
|
326 |
return txtHorizontal;
|
327 |
} |
328 |
|
329 |
/**
|
330 |
* This method initializes jLabel5
|
331 |
*
|
332 |
* @return javax.swing.JLabel
|
333 |
*/
|
334 |
private javax.swing.JLabel getJLabel5() {
|
335 |
if (jLabel5 == null) { |
336 |
jLabel5 = new javax.swing.JLabel();
|
337 |
jLabel5.setText(PluginServices.getText(this, "espaciado_vertical") + |
338 |
":");
|
339 |
} |
340 |
|
341 |
return jLabel5;
|
342 |
} |
343 |
|
344 |
/**
|
345 |
* This method initializes txtVertical
|
346 |
*
|
347 |
* @return javax.swing.JTextField
|
348 |
*/
|
349 |
private javax.swing.JTextField getTxtVertical() {
|
350 |
if (txtVertical == null) { |
351 |
txtVertical = new javax.swing.JTextField();
|
352 |
txtVertical.setPreferredSize(new java.awt.Dimension(40, 20)); |
353 |
txtVertical.setHorizontalAlignment(javax.swing.JTextField.CENTER); |
354 |
} |
355 |
|
356 |
return txtVertical;
|
357 |
} |
358 |
|
359 |
/**
|
360 |
* This method initializes chkMalla
|
361 |
*
|
362 |
* @return javax.swing.JCheckBox
|
363 |
*/
|
364 |
private javax.swing.JCheckBox getChkMalla() {
|
365 |
if (chkMalla == null) { |
366 |
chkMalla = new javax.swing.JCheckBox();
|
367 |
chkMalla.setText(PluginServices.getText(this, "malla_activada")); |
368 |
chkMalla.setSelected(true);
|
369 |
chkMalla.setPreferredSize(new java.awt.Dimension(190,24)); |
370 |
chkMalla.setHorizontalTextPosition(javax.swing.SwingConstants.TRAILING); |
371 |
chkMalla.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); |
372 |
chkMalla.addActionListener(new java.awt.event.ActionListener() {
|
373 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
374 |
///map.getModel().setIsCuadricula(chkMalla.isSelected());
|
375 |
} |
376 |
}); |
377 |
} |
378 |
|
379 |
return chkMalla;
|
380 |
} |
381 |
|
382 |
/**
|
383 |
* This method initializes jPanel
|
384 |
*
|
385 |
* @return javax.swing.JPanel
|
386 |
*/
|
387 |
private javax.swing.JPanel getJPanel() {
|
388 |
if (jPanel == null) { |
389 |
FlowLayout flowLayout2 = new FlowLayout(); |
390 |
flowLayout2.setHgap(4);
|
391 |
flowLayout2.setAlignment(java.awt.FlowLayout.LEFT); |
392 |
GridLayout gridLayout = new GridLayout(); |
393 |
gridLayout.setRows(4);
|
394 |
jPanel = new javax.swing.JPanel();
|
395 |
|
396 |
jPanel.setLayout(flowLayout2); |
397 |
jPanel.setPreferredSize(new java.awt.Dimension(190,150)); |
398 |
jPanel.add(getJLabel(), null);
|
399 |
jPanel.add(getJLabel1(), null);
|
400 |
jPanel.add(getJLabel2(), null);
|
401 |
jPanel.add(getJLabel3(), null);
|
402 |
} |
403 |
|
404 |
return jPanel;
|
405 |
} |
406 |
|
407 |
/**
|
408 |
* This method initializes jPanel1
|
409 |
*
|
410 |
* @return javax.swing.JPanel
|
411 |
*/
|
412 |
private javax.swing.JPanel getJPanel1() {
|
413 |
if (jPanel1 == null) { |
414 |
jPanel1 = new javax.swing.JPanel();
|
415 |
|
416 |
java.awt.FlowLayout layFlowLayout12 = new java.awt.FlowLayout();
|
417 |
layFlowLayout12.setAlignment(java.awt.FlowLayout.LEFT); |
418 |
jPanel1.setLayout(layFlowLayout12); |
419 |
jPanel1.add(getTxtName(), null);
|
420 |
jPanel1.add(getTxtDate(), null);
|
421 |
jPanel1.add(getTxtOwner(), null);
|
422 |
jPanel1.setPreferredSize(new java.awt.Dimension(200,150)); |
423 |
jPanel1.add(getJScrollPane(), null);
|
424 |
} |
425 |
|
426 |
return jPanel1;
|
427 |
} |
428 |
|
429 |
/**
|
430 |
* This method initializes jPanel2
|
431 |
*
|
432 |
* @return javax.swing.JPanel
|
433 |
*/
|
434 |
private javax.swing.JPanel getJPanel2() {
|
435 |
if (jPanel2 == null) { |
436 |
GridLayout gridLayout4 = new GridLayout(); |
437 |
gridLayout4.setRows(2);
|
438 |
jPanel2 = new javax.swing.JPanel();
|
439 |
|
440 |
jPanel2.setLayout(gridLayout4); |
441 |
jPanel2.setPreferredSize(new java.awt.Dimension(295,50)); |
442 |
jPanel2.add(getJLabel4(), null);
|
443 |
jPanel2.add(getJLabel5(), null);
|
444 |
} |
445 |
|
446 |
return jPanel2;
|
447 |
} |
448 |
|
449 |
/**
|
450 |
* This method initializes jPanel3
|
451 |
*
|
452 |
* @return javax.swing.JPanel
|
453 |
*/
|
454 |
private javax.swing.JPanel getJPanel3() {
|
455 |
if (jPanel3 == null) { |
456 |
GridLayout gridLayout3 = new GridLayout(); |
457 |
gridLayout3.setRows(2);
|
458 |
GridLayout gridLayout2 = new GridLayout(); |
459 |
gridLayout2.setRows(2);
|
460 |
GridLayout gridLayout1 = new GridLayout(); |
461 |
gridLayout1.setRows(2);
|
462 |
jPanel3 = new javax.swing.JPanel();
|
463 |
|
464 |
jPanel3.setLayout(gridLayout3); |
465 |
jPanel3.setPreferredSize(new java.awt.Dimension(95,50)); |
466 |
jPanel3.add(getTxtHorizontal(), null);
|
467 |
jPanel3.add(getJLabel6(), null);
|
468 |
jPanel3.add(getTxtVertical(), null);
|
469 |
} |
470 |
|
471 |
return jPanel3;
|
472 |
} |
473 |
|
474 |
/**
|
475 |
* This method initializes jLabel6
|
476 |
*
|
477 |
* @return javax.swing.JLabel
|
478 |
*/
|
479 |
private javax.swing.JLabel getJLabel6() {
|
480 |
if (jLabel6 == null) { |
481 |
jLabel6 = new javax.swing.JLabel();
|
482 |
jLabel6.setPreferredSize(new java.awt.Dimension(38, 0)); |
483 |
} |
484 |
|
485 |
return jLabel6;
|
486 |
} |
487 |
|
488 |
/**
|
489 |
* @see com.iver.mdiApp.ui.MDIManager.IWindow#getWindowInfo()
|
490 |
*/
|
491 |
public WindowInfo getWindowInfo() {
|
492 |
WindowInfo m_viewinfo=new WindowInfo(WindowInfo.MODALDIALOG);
|
493 |
m_viewinfo.setTitle(PluginServices.getText(this, "propiedades_mapa")); |
494 |
return m_viewinfo;
|
495 |
} |
496 |
|
497 |
/**
|
498 |
* @see com.iver.mdiApp.ui.MDIManager.IWindow#windowActivated()
|
499 |
*/
|
500 |
public void viewActivated() { |
501 |
} |
502 |
/**
|
503 |
* This method initializes jPanel4
|
504 |
*
|
505 |
* @return javax.swing.JPanel
|
506 |
*/
|
507 |
private javax.swing.JPanel getJPanel4() {
|
508 |
if(jPanel4 == null) { |
509 |
FlowLayout flowLayout = new FlowLayout(); |
510 |
flowLayout.setAlignment(java.awt.FlowLayout.LEFT); |
511 |
jPanel4 = new javax.swing.JPanel();
|
512 |
jPanel4.setLayout(flowLayout); |
513 |
jPanel4.setPreferredSize(new java.awt.Dimension(390,24)); |
514 |
jPanel4.add(getJLabel7(), null);
|
515 |
jPanel4.add(getJLabel8(), null);
|
516 |
} |
517 |
return jPanel4;
|
518 |
} |
519 |
/**
|
520 |
* This method initializes jLabel7
|
521 |
*
|
522 |
* @return javax.swing.JLabel
|
523 |
*/
|
524 |
private javax.swing.JLabel getJLabel7() {
|
525 |
if(jLabel7 == null) { |
526 |
jLabel7 = new javax.swing.JLabel();
|
527 |
jLabel7.setText("Unidades: ");
|
528 |
} |
529 |
return jLabel7;
|
530 |
} |
531 |
/**
|
532 |
* This method initializes jLabel8
|
533 |
*
|
534 |
* @return javax.swing.JLabel
|
535 |
*/
|
536 |
private javax.swing.JLabel getJLabel8() {
|
537 |
if(jLabel8 == null) { |
538 |
jLabel8 = new javax.swing.JLabel();
|
539 |
jLabel8.setText(map.getModel().getAtributes().getNameUnit()); |
540 |
} |
541 |
return jLabel8;
|
542 |
} |
543 |
/**
|
544 |
* This method initializes jCheckBox
|
545 |
*
|
546 |
* @return javax.swing.JCheckBox
|
547 |
*/
|
548 |
private javax.swing.JCheckBox getJCheckBox() {
|
549 |
if(jCheckBox == null) { |
550 |
jCheckBox = new javax.swing.JCheckBox();
|
551 |
jCheckBox.setText(PluginServices.getText(this,"activar_regla")); |
552 |
jCheckBox.setPreferredSize(new java.awt.Dimension(190,24)); |
553 |
jCheckBox.setSelected(map.getModel().getRuler()); |
554 |
jCheckBox.addActionListener(new java.awt.event.ActionListener() {
|
555 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
556 |
//map.getModel().setRuler(jCheckBox.isSelected());
|
557 |
} |
558 |
}); |
559 |
} |
560 |
return jCheckBox;
|
561 |
} |
562 |
/**
|
563 |
* This method initializes jPanel5
|
564 |
*
|
565 |
* @return javax.swing.JPanel
|
566 |
*/
|
567 |
private javax.swing.JPanel getJPanel5() {
|
568 |
if(jPanel5 == null) { |
569 |
FlowLayout flowLayout1 = new FlowLayout(); |
570 |
flowLayout1.setAlignment(java.awt.FlowLayout.LEFT); |
571 |
jPanel5 = new javax.swing.JPanel();
|
572 |
jPanel5.setLayout(flowLayout1); |
573 |
jPanel5.setPreferredSize(new java.awt.Dimension(390,120)); |
574 |
jPanel5.add(getChkMalla(), null);
|
575 |
jPanel5.add(getJCheckBox(), null);
|
576 |
jPanel5.add(getJCheckBox1(), null);
|
577 |
jPanel5.add(getChbEditable(), null);
|
578 |
} |
579 |
return jPanel5;
|
580 |
} |
581 |
/**
|
582 |
* This method initializes jCheckBox1
|
583 |
*
|
584 |
* @return javax.swing.JCheckBox
|
585 |
*/
|
586 |
private JCheckBox getJCheckBox1() { |
587 |
if (jCheckBox1 == null) { |
588 |
jCheckBox1 = new JCheckBox(); |
589 |
jCheckBox1.setSelected(map.getModel().getIsDrawGrid()); |
590 |
jCheckBox1.setPreferredSize(new java.awt.Dimension(190,24)); |
591 |
jCheckBox1.setText(PluginServices.getText(this,"visualizar_cuadricula")); |
592 |
jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
|
593 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
594 |
|
595 |
} |
596 |
}); |
597 |
} |
598 |
return jCheckBox1;
|
599 |
} |
600 |
/**
|
601 |
* @see com.iver.andami.ui.mdiManager.SingletonWindow#getWindowModel()
|
602 |
*/
|
603 |
public Object getViewModel() { |
604 |
return map;
|
605 |
} |
606 |
/**
|
607 |
* This method initializes chbEditable
|
608 |
*
|
609 |
* @return javax.swing.JCheckBox
|
610 |
*/
|
611 |
private JCheckBox getChbEditable() { |
612 |
if (chbEditable == null) { |
613 |
chbEditable = new JCheckBox(); |
614 |
chbEditable.setSelected(map.getModel().isEditable()); |
615 |
chbEditable.setPreferredSize(new java.awt.Dimension(190,24)); |
616 |
chbEditable.setText(PluginServices.getText(this,"editable")); |
617 |
} |
618 |
return chbEditable;
|
619 |
} |
620 |
private AcceptCancelPanel getAcceptCancelPanel() {
|
621 |
if (accept == null) { |
622 |
ActionListener okAction, cancelAction;
|
623 |
okAction = new java.awt.event.ActionListener() {
|
624 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
625 |
map.setName(txtName.getText()); |
626 |
map.setOwner(txtOwner.getText()); |
627 |
map.setComment(txtComments.getText()); |
628 |
map.getModel().setIsCuadricula(chkMalla.isSelected()); |
629 |
map.getModel().setRuler(jCheckBox.isSelected()); |
630 |
map.getModel().setEditable(chbEditable.isSelected()); |
631 |
try {
|
632 |
String sh=txtHorizontal.getText();
|
633 |
sh=sh.replace(',','.'); |
634 |
if (sh.length()!=0){ |
635 |
double f = new Double(sh).doubleValue(); |
636 |
map.getModel().getAtributes().setNumUnitsX(f); |
637 |
} |
638 |
|
639 |
String sv=txtVertical.getText();
|
640 |
sv=sv.replace(',','.'); |
641 |
if (sv.length()!=0){ |
642 |
double f = new Double(sv).doubleValue(); |
643 |
map.getModel().getAtributes().setNumUnitsY(f); |
644 |
} |
645 |
|
646 |
PluginServices.getMDIManager().closeWindow(MapProperties.this); |
647 |
map.getModel().setIsDrawGrid(getJCheckBox1().isSelected()); |
648 |
map.getModel().refresh(); |
649 |
} catch (NumberFormatException ex) { |
650 |
NotificationManager.addInfo("no es un double", ex);
|
651 |
} |
652 |
} |
653 |
}; |
654 |
cancelAction = new java.awt.event.ActionListener() {
|
655 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
656 |
PluginServices.getMDIManager().closeWindow(MapProperties.this); |
657 |
} |
658 |
}; |
659 |
accept = new AcceptCancelPanel(okAction, cancelAction);
|
660 |
accept.setPreferredSize(new java.awt.Dimension(300,34)); |
661 |
} |
662 |
return accept;
|
663 |
} |
664 |
|
665 |
|
666 |
} // @jve:visual-info decl-index=0 visual-constraint="10,10"
|
667 |
|
668 |
|
669 |
// @jve:visual-info decl-index=0 visual-constraint="10,10"
|