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