svn-document-layout / trunk / org.gvsig.app.document.layout2.app / org.gvsig.app.document.layout2.app.mainplugin / src / main / java / org / gvsig / app / project / documents / layout / gui / MapProperties.java @ 365
History | View | Annotate | Download (23.6 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
package org.gvsig.app.project.documents.layout.gui; |
23 |
|
24 |
import java.awt.FlowLayout; |
25 |
import java.awt.GridLayout; |
26 |
import java.awt.event.ActionListener; |
27 |
|
28 |
import javax.swing.JCheckBox; |
29 |
import javax.swing.JLabel; |
30 |
import javax.swing.JPanel; |
31 |
|
32 |
import org.gvsig.andami.PluginServices; |
33 |
import org.gvsig.andami.messages.NotificationManager; |
34 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
35 |
import org.gvsig.andami.ui.mdiManager.WindowInfo; |
36 |
import org.gvsig.app.project.documents.layout.LayoutDocument; |
37 |
import org.gvsig.gui.beans.AcceptCancelPanel; |
38 |
|
39 |
/**
|
40 |
* Dialogo con la informaci?n de los mapas
|
41 |
*
|
42 |
* @author Fernando Gonz?lez Cort?s
|
43 |
*/
|
44 |
public class MapProperties extends JPanel implements IWindow { |
45 |
|
46 |
private static final long serialVersionUID = 2354472110990301841L; |
47 |
private javax.swing.JPanel jContentPane = null; // @jve:decl-index=0:visual-constraint="14,17" |
48 |
private javax.swing.JLabel jLabel = null; |
49 |
private javax.swing.JTextField txtName = null; |
50 |
private javax.swing.JLabel jLabel1 = null; |
51 |
private javax.swing.JTextField txtDate = null; |
52 |
private javax.swing.JLabel jLabel2 = null; |
53 |
private javax.swing.JTextField txtOwner = null; |
54 |
private javax.swing.JLabel jLabel3 = null; |
55 |
private javax.swing.JScrollPane jScrollPane = null; |
56 |
private javax.swing.JTextArea txtComments = null; |
57 |
private javax.swing.JLabel jLabel4 = null; |
58 |
private javax.swing.JTextField txtHorizontal = null; |
59 |
private javax.swing.JLabel jLabel5 = null; |
60 |
private javax.swing.JTextField txtVertical = null; |
61 |
private javax.swing.JCheckBox chkActiveGrid = null; |
62 |
private LayoutDocument map;
|
63 |
private javax.swing.JPanel jPanel = null; |
64 |
private javax.swing.JPanel jPanel1 = null; |
65 |
private javax.swing.JPanel jPanel2 = null; |
66 |
private javax.swing.JPanel jPanel3 = null; |
67 |
private javax.swing.JPanel jPanel4 = null; |
68 |
private javax.swing.JLabel jLabel7 = null; |
69 |
private javax.swing.JLabel jLabel8 = null; |
70 |
private javax.swing.JCheckBox activeRuler = null; |
71 |
private javax.swing.JPanel jPanel5 = null; |
72 |
private JCheckBox showGrid = null; |
73 |
private JCheckBox chbEditable = null; |
74 |
private AcceptCancelPanel accept;
|
75 |
private boolean isAccepted = false; |
76 |
private JPanel jPanel6 = null; |
77 |
private JLabel jLabel6 = null; |
78 |
private JLabel jLabel9 = null; |
79 |
|
80 |
/**
|
81 |
* This method initializes
|
82 |
*
|
83 |
*/
|
84 |
public MapProperties() {
|
85 |
super();
|
86 |
initialize(); |
87 |
} |
88 |
|
89 |
/**
|
90 |
* This is the default constructor
|
91 |
*
|
92 |
* @param f
|
93 |
* frame padre del dialogo
|
94 |
* @param m
|
95 |
* mapa cuya informaci?n se presenta
|
96 |
*/
|
97 |
public MapProperties(LayoutDocument m) {
|
98 |
map = m; |
99 |
initialize(); |
100 |
} |
101 |
|
102 |
/**
|
103 |
* This method initializes this
|
104 |
*/
|
105 |
private void initialize() { |
106 |
this.setSize(425, 428); |
107 |
this.setPreferredSize(new java.awt.Dimension(410, 400)); |
108 |
this.add(getJContentPane(), null); |
109 |
getTxtName().setText(map.getName()); |
110 |
getTxtDate().setText(map.getCreationDate()); |
111 |
getTxtOwner().setText(map.getOwner()); |
112 |
getTxtComments().setText(map.getComment()); |
113 |
|
114 |
jLabel9.setText(map.getLayoutContext().getAttributes().getNameUnit()); |
115 |
jLabel6.setText(map.getLayoutContext().getAttributes().getNameUnit()); |
116 |
|
117 |
getTxtHorizontal().setText( |
118 |
Double.toString(map.getLayoutContext().getAttributes()
|
119 |
.getHGridGapCm())); |
120 |
getTxtVertical().setText( |
121 |
Double.toString(map.getLayoutContext().getAttributes()
|
122 |
.getVGridGapCm())); |
123 |
|
124 |
getChkActiveGrid().setSelected( |
125 |
map.getLayoutContext().isAdjustingToGrid()); |
126 |
// map.getModel().setProjectMap(map);
|
127 |
} |
128 |
|
129 |
/**
|
130 |
* This method initializes jContentPane
|
131 |
*
|
132 |
* @return javax.swing.JPanel
|
133 |
*/
|
134 |
private javax.swing.JPanel getJContentPane() {
|
135 |
if (jContentPane == null) { |
136 |
jContentPane = new javax.swing.JPanel();
|
137 |
|
138 |
java.awt.FlowLayout layFlowLayout10 = new java.awt.FlowLayout();
|
139 |
layFlowLayout10.setHgap(0);
|
140 |
jContentPane.setLayout(layFlowLayout10); |
141 |
jContentPane.add(getJPanel(), null);
|
142 |
jContentPane.add(getJPanel1(), null);
|
143 |
jContentPane.add(getJPanel2(), null);
|
144 |
jContentPane.add(getJPanel3(), null);
|
145 |
jContentPane.setPreferredSize(new java.awt.Dimension(400, 410)); |
146 |
jContentPane.setSize(new java.awt.Dimension(308, 375)); |
147 |
jContentPane.add(getJPanel6(), null);
|
148 |
jContentPane.add(getJPanel5(), null);
|
149 |
jContentPane.add(getJPanel4(), null);
|
150 |
jContentPane.add(getAcceptCancelPanel(), null);
|
151 |
} |
152 |
|
153 |
return jContentPane;
|
154 |
} |
155 |
|
156 |
/**
|
157 |
* This method initializes jLabel
|
158 |
*
|
159 |
* @return javax.swing.JLabel
|
160 |
*/
|
161 |
private javax.swing.JLabel getJLabel() {
|
162 |
if (jLabel == null) { |
163 |
jLabel = new javax.swing.JLabel();
|
164 |
jLabel.setText(PluginServices.getText(this, "nombre") + ":"); |
165 |
jLabel.setPreferredSize(new java.awt.Dimension(180, 20)); |
166 |
jLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); |
167 |
} |
168 |
|
169 |
return jLabel;
|
170 |
} |
171 |
|
172 |
/**
|
173 |
* This method initializes txtName
|
174 |
*
|
175 |
* @return javax.swing.JTextField
|
176 |
*/
|
177 |
private javax.swing.JTextField getTxtName() {
|
178 |
if (txtName == null) { |
179 |
txtName = new javax.swing.JTextField();
|
180 |
txtName.setPreferredSize(new java.awt.Dimension(190, 20)); |
181 |
} |
182 |
|
183 |
return txtName;
|
184 |
} |
185 |
|
186 |
/**
|
187 |
* This method initializes jLabel1
|
188 |
*
|
189 |
* @return javax.swing.JLabel
|
190 |
*/
|
191 |
private javax.swing.JLabel getJLabel1() {
|
192 |
if (jLabel1 == null) { |
193 |
jLabel1 = new javax.swing.JLabel();
|
194 |
jLabel1 |
195 |
.setText(PluginServices.getText(this, "creation_date") + ":"); |
196 |
jLabel1.setPreferredSize(new java.awt.Dimension(180, 20)); |
197 |
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); |
198 |
} |
199 |
|
200 |
return jLabel1;
|
201 |
} |
202 |
|
203 |
/**
|
204 |
* This method initializes txtDate
|
205 |
*
|
206 |
* @return javax.swing.JTextField
|
207 |
*/
|
208 |
private javax.swing.JTextField getTxtDate() {
|
209 |
if (txtDate == null) { |
210 |
txtDate = new javax.swing.JTextField();
|
211 |
txtDate.setPreferredSize(new java.awt.Dimension(190, 20)); |
212 |
txtDate.setEditable(false);
|
213 |
txtDate.setBackground(java.awt.Color.white); |
214 |
} |
215 |
|
216 |
return txtDate;
|
217 |
} |
218 |
|
219 |
/**
|
220 |
* This method initializes jLabel2
|
221 |
*
|
222 |
* @return javax.swing.JLabel
|
223 |
*/
|
224 |
private javax.swing.JLabel getJLabel2() {
|
225 |
if (jLabel2 == null) { |
226 |
jLabel2 = new javax.swing.JLabel();
|
227 |
jLabel2.setText(PluginServices.getText(this, "owner") + ":"); |
228 |
jLabel2.setPreferredSize(new java.awt.Dimension(180, 20)); |
229 |
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); |
230 |
} |
231 |
|
232 |
return jLabel2;
|
233 |
} |
234 |
|
235 |
/**
|
236 |
* This method initializes txtOwner
|
237 |
*
|
238 |
* @return javax.swing.JTextField
|
239 |
*/
|
240 |
private javax.swing.JTextField getTxtOwner() {
|
241 |
if (txtOwner == null) { |
242 |
txtOwner = new javax.swing.JTextField();
|
243 |
txtOwner.setPreferredSize(new java.awt.Dimension(190, 20)); |
244 |
} |
245 |
|
246 |
return txtOwner;
|
247 |
} |
248 |
|
249 |
/**
|
250 |
* This method initializes jLabel3
|
251 |
*
|
252 |
* @return javax.swing.JLabel
|
253 |
*/
|
254 |
private javax.swing.JLabel getJLabel3() {
|
255 |
if (jLabel3 == null) { |
256 |
jLabel3 = new javax.swing.JLabel();
|
257 |
jLabel3.setText(PluginServices.getText(this, "comentarios") + ":"); |
258 |
jLabel3 |
259 |
.setHorizontalTextPosition(javax.swing.SwingConstants.TRAILING); |
260 |
jLabel3.setVerticalAlignment(javax.swing.SwingConstants.TOP); |
261 |
jLabel3.setPreferredSize(new java.awt.Dimension(180, 20)); |
262 |
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); |
263 |
} |
264 |
|
265 |
return jLabel3;
|
266 |
} |
267 |
|
268 |
/**
|
269 |
* This method initializes jScrollPane
|
270 |
*
|
271 |
* @return javax.swing.JScrollPane
|
272 |
*/
|
273 |
private javax.swing.JScrollPane getJScrollPane() {
|
274 |
if (jScrollPane == null) { |
275 |
jScrollPane = new javax.swing.JScrollPane();
|
276 |
jScrollPane.setPreferredSize(new java.awt.Dimension(190, 50)); |
277 |
jScrollPane.setViewportView(getTxtComments()); |
278 |
} |
279 |
|
280 |
return jScrollPane;
|
281 |
} |
282 |
|
283 |
/**
|
284 |
* This method initializes txtComments
|
285 |
*
|
286 |
* @return javax.swing.JTextArea
|
287 |
*/
|
288 |
private javax.swing.JTextArea getTxtComments() {
|
289 |
if (txtComments == null) { |
290 |
txtComments = new javax.swing.JTextArea();
|
291 |
} |
292 |
|
293 |
return txtComments;
|
294 |
} |
295 |
|
296 |
/**
|
297 |
* This method initializes jLabel4
|
298 |
*
|
299 |
* @return javax.swing.JLabel
|
300 |
*/
|
301 |
private javax.swing.JLabel getJLabel4() {
|
302 |
if (jLabel4 == null) { |
303 |
jLabel4 = new javax.swing.JLabel();
|
304 |
jLabel4.setText(PluginServices |
305 |
.getText(this, "espaciado_horizontal") + ":"); |
306 |
jLabel4.setPreferredSize(new java.awt.Dimension(130, 16)); |
307 |
} |
308 |
|
309 |
return jLabel4;
|
310 |
} |
311 |
|
312 |
/**
|
313 |
* This method initializes txtHorizontal
|
314 |
*
|
315 |
* @return javax.swing.JTextField
|
316 |
*/
|
317 |
private javax.swing.JTextField getTxtHorizontal() {
|
318 |
if (txtHorizontal == null) { |
319 |
txtHorizontal = new javax.swing.JTextField();
|
320 |
txtHorizontal.setPreferredSize(new java.awt.Dimension(30, 20)); |
321 |
txtHorizontal.setHorizontalAlignment(javax.swing.JTextField.CENTER); |
322 |
} |
323 |
|
324 |
return txtHorizontal;
|
325 |
} |
326 |
|
327 |
/**
|
328 |
* This method initializes jLabel5
|
329 |
*
|
330 |
* @return javax.swing.JLabel
|
331 |
*/
|
332 |
private javax.swing.JLabel getJLabel5() {
|
333 |
if (jLabel5 == null) { |
334 |
jLabel5 = new javax.swing.JLabel();
|
335 |
jLabel5.setText(PluginServices.getText(this, "espaciado_vertical") |
336 |
+ ":");
|
337 |
jLabel5.setPreferredSize(new java.awt.Dimension(130, 16)); |
338 |
} |
339 |
|
340 |
return jLabel5;
|
341 |
} |
342 |
|
343 |
/**
|
344 |
* This method initializes txtVertical
|
345 |
*
|
346 |
* @return javax.swing.JTextField
|
347 |
*/
|
348 |
private javax.swing.JTextField getTxtVertical() {
|
349 |
if (txtVertical == null) { |
350 |
txtVertical = new javax.swing.JTextField();
|
351 |
txtVertical.setPreferredSize(new java.awt.Dimension(30, 20)); |
352 |
txtVertical.setHorizontalAlignment(javax.swing.JTextField.CENTER); |
353 |
} |
354 |
|
355 |
return txtVertical;
|
356 |
} |
357 |
|
358 |
/**
|
359 |
* This method initializes chkMalla
|
360 |
*
|
361 |
* @return javax.swing.JCheckBox
|
362 |
*/
|
363 |
private javax.swing.JCheckBox getChkActiveGrid() {
|
364 |
if (chkActiveGrid == null) { |
365 |
chkActiveGrid = new javax.swing.JCheckBox();
|
366 |
chkActiveGrid.setText(PluginServices |
367 |
.getText(this, "malla_activada")); |
368 |
chkActiveGrid.setSelected(true);
|
369 |
chkActiveGrid.setPreferredSize(new java.awt.Dimension(190, 24)); |
370 |
chkActiveGrid |
371 |
.setHorizontalTextPosition(javax.swing.SwingConstants.TRAILING); |
372 |
chkActiveGrid |
373 |
.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); |
374 |
chkActiveGrid |
375 |
.addActionListener(new java.awt.event.ActionListener() {
|
376 |
|
377 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
378 |
// /map.getModel().setIsCuadricula(chkMalla.isSelected());
|
379 |
} |
380 |
}); |
381 |
} |
382 |
|
383 |
return chkActiveGrid;
|
384 |
} |
385 |
|
386 |
/**
|
387 |
* This method initializes jPanel
|
388 |
*
|
389 |
* @return javax.swing.JPanel
|
390 |
*/
|
391 |
private javax.swing.JPanel getJPanel() {
|
392 |
if (jPanel == null) { |
393 |
FlowLayout flowLayout2 = new FlowLayout(); |
394 |
flowLayout2.setHgap(4);
|
395 |
flowLayout2.setAlignment(java.awt.FlowLayout.LEFT); |
396 |
GridLayout gridLayout = new GridLayout(); |
397 |
gridLayout.setRows(4);
|
398 |
jPanel = new javax.swing.JPanel();
|
399 |
|
400 |
jPanel.setLayout(flowLayout2); |
401 |
jPanel.setPreferredSize(new java.awt.Dimension(190, 150)); |
402 |
jPanel.add(getJLabel(), null);
|
403 |
jPanel.add(getJLabel1(), null);
|
404 |
jPanel.add(getJLabel2(), null);
|
405 |
jPanel.add(getJLabel3(), null);
|
406 |
} |
407 |
|
408 |
return jPanel;
|
409 |
} |
410 |
|
411 |
/**
|
412 |
* This method initializes jPanel1
|
413 |
*
|
414 |
* @return javax.swing.JPanel
|
415 |
*/
|
416 |
private javax.swing.JPanel getJPanel1() {
|
417 |
if (jPanel1 == null) { |
418 |
jPanel1 = new javax.swing.JPanel();
|
419 |
|
420 |
java.awt.FlowLayout layFlowLayout12 = new java.awt.FlowLayout();
|
421 |
layFlowLayout12.setAlignment(java.awt.FlowLayout.LEFT); |
422 |
jPanel1.setLayout(layFlowLayout12); |
423 |
jPanel1.add(getTxtName(), null);
|
424 |
jPanel1.add(getTxtDate(), null);
|
425 |
jPanel1.add(getTxtOwner(), null);
|
426 |
jPanel1.setPreferredSize(new java.awt.Dimension(200, 150)); |
427 |
jPanel1.add(getJScrollPane(), null);
|
428 |
} |
429 |
|
430 |
return jPanel1;
|
431 |
} |
432 |
|
433 |
/**
|
434 |
* This method initializes jPanel2
|
435 |
*
|
436 |
* @return javax.swing.JPanel
|
437 |
*/
|
438 |
private javax.swing.JPanel getJPanel2() {
|
439 |
if (jPanel2 == null) { |
440 |
GridLayout gridLayout4 = new GridLayout(); |
441 |
gridLayout4.setRows(2);
|
442 |
jPanel2 = new javax.swing.JPanel();
|
443 |
|
444 |
jPanel2.setLayout(gridLayout4); |
445 |
jPanel2.setPreferredSize(new java.awt.Dimension(220, 50)); |
446 |
jPanel2.add(getJLabel4(), null);
|
447 |
jPanel2.add(getJLabel5(), null);
|
448 |
} |
449 |
|
450 |
return jPanel2;
|
451 |
} |
452 |
|
453 |
/**
|
454 |
* This method initializes jPanel3
|
455 |
*
|
456 |
* @return javax.swing.JPanel
|
457 |
*/
|
458 |
private javax.swing.JPanel getJPanel3() {
|
459 |
if (jPanel3 == null) { |
460 |
GridLayout gridLayout3 = new GridLayout(); |
461 |
gridLayout3.setRows(2);
|
462 |
GridLayout gridLayout2 = new GridLayout(); |
463 |
gridLayout2.setRows(2);
|
464 |
GridLayout gridLayout1 = new GridLayout(); |
465 |
gridLayout1.setRows(2);
|
466 |
jPanel3 = new javax.swing.JPanel();
|
467 |
|
468 |
jPanel3.setLayout(gridLayout3); |
469 |
jPanel3.setPreferredSize(new java.awt.Dimension(40, 50)); |
470 |
jPanel3.add(getTxtHorizontal(), null);
|
471 |
jPanel3.add(getTxtVertical(), null);
|
472 |
} |
473 |
|
474 |
return jPanel3;
|
475 |
} |
476 |
|
477 |
/**
|
478 |
* @see com.iver.mdiApp.ui.MDIManager.IWindow#getWindowInfo()
|
479 |
*/
|
480 |
public WindowInfo getWindowInfo() {
|
481 |
WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG);
|
482 |
m_viewinfo.setTitle(PluginServices.getText(this, "propiedades_mapa")); |
483 |
return m_viewinfo;
|
484 |
} |
485 |
|
486 |
/**
|
487 |
* @see com.iver.mdiApp.ui.MDIManager.IWindow#windowActivated()
|
488 |
*/
|
489 |
public void viewActivated() { |
490 |
} |
491 |
|
492 |
/**
|
493 |
* This method initializes jPanel4
|
494 |
*
|
495 |
* @return javax.swing.JPanel
|
496 |
*/
|
497 |
private javax.swing.JPanel getJPanel4() {
|
498 |
if (jPanel4 == null) { |
499 |
FlowLayout flowLayout = new FlowLayout(); |
500 |
flowLayout.setAlignment(java.awt.FlowLayout.LEFT); |
501 |
jPanel4 = new javax.swing.JPanel();
|
502 |
jPanel4.setLayout(flowLayout); |
503 |
jPanel4.setPreferredSize(new java.awt.Dimension(390, 24)); |
504 |
jPanel4.add(getJLabel7(), null);
|
505 |
jPanel4.add(getJLabel8(), null);
|
506 |
} |
507 |
return jPanel4;
|
508 |
} |
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 |
/**
|
524 |
* This method initializes jLabel8
|
525 |
*
|
526 |
* @return javax.swing.JLabel
|
527 |
*/
|
528 |
private javax.swing.JLabel getJLabel8() {
|
529 |
if (jLabel8 == null) { |
530 |
jLabel8 = new javax.swing.JLabel();
|
531 |
jLabel8.setText(PluginServices.getText(this, map.getLayoutContext()
|
532 |
.getAttributes().getNameUnit())); |
533 |
} |
534 |
return jLabel8;
|
535 |
} |
536 |
|
537 |
/**
|
538 |
* This method initializes jCheckBox
|
539 |
*
|
540 |
* @return javax.swing.JCheckBox
|
541 |
*/
|
542 |
private javax.swing.JCheckBox getChbActiveRuler() {
|
543 |
if (activeRuler == null) { |
544 |
activeRuler = new javax.swing.JCheckBox();
|
545 |
activeRuler.setText(PluginServices.getText(this, "activar_regla")); |
546 |
activeRuler.setPreferredSize(new java.awt.Dimension(190, 24)); |
547 |
activeRuler.setSelected(map.getLayoutContext().getRuler()); |
548 |
activeRuler.addActionListener(new java.awt.event.ActionListener() {
|
549 |
|
550 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
551 |
// map.getModel().setRuler(jCheckBox.isSelected());
|
552 |
} |
553 |
}); |
554 |
} |
555 |
return activeRuler;
|
556 |
} |
557 |
|
558 |
/**
|
559 |
* This method initializes jPanel5
|
560 |
*
|
561 |
* @return javax.swing.JPanel
|
562 |
*/
|
563 |
private javax.swing.JPanel getJPanel5() {
|
564 |
if (jPanel5 == null) { |
565 |
FlowLayout flowLayout1 = new FlowLayout(); |
566 |
flowLayout1.setAlignment(java.awt.FlowLayout.LEFT); |
567 |
jPanel5 = new javax.swing.JPanel();
|
568 |
jPanel5.setLayout(flowLayout1); |
569 |
jPanel5.setPreferredSize(new java.awt.Dimension(390, 120)); |
570 |
jPanel5.add(getChkActiveGrid(), null);
|
571 |
jPanel5.add(getChbActiveRuler(), null);
|
572 |
jPanel5.add(getChbShowGrid(), null);
|
573 |
jPanel5.add(getChbEditable(), null);
|
574 |
} |
575 |
return jPanel5;
|
576 |
} |
577 |
|
578 |
/**
|
579 |
* This method initializes jCheckBox1
|
580 |
*
|
581 |
* @return javax.swing.JCheckBox
|
582 |
*/
|
583 |
private JCheckBox getChbShowGrid() { |
584 |
if (showGrid == null) { |
585 |
showGrid = new JCheckBox(); |
586 |
showGrid.setSelected(map.getLayoutContext().isGridVisible()); |
587 |
showGrid.setPreferredSize(new java.awt.Dimension(190, 24)); |
588 |
showGrid.setText(PluginServices.getText(this,
|
589 |
"visualizar_cuadricula"));
|
590 |
showGrid.addActionListener(new java.awt.event.ActionListener() {
|
591 |
|
592 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
593 |
|
594 |
} |
595 |
}); |
596 |
} |
597 |
return showGrid;
|
598 |
} |
599 |
|
600 |
/**
|
601 |
* @see org.gvsig.andami.ui.mdiManager.SingletonWindow#getWindowModel()
|
602 |
*/
|
603 |
public Object getViewModel() { |
604 |
return map;
|
605 |
} |
606 |
|
607 |
/**
|
608 |
* This method initializes chbEditable
|
609 |
*
|
610 |
* @return javax.swing.JCheckBox
|
611 |
*/
|
612 |
private JCheckBox getChbEditable() { |
613 |
if (chbEditable == null) { |
614 |
chbEditable = new JCheckBox(); |
615 |
chbEditable.setSelected(map.getLayoutContext().isEditable()); |
616 |
chbEditable.setPreferredSize(new java.awt.Dimension(190, 24)); |
617 |
chbEditable.setText(PluginServices.getText(this, "editable")); |
618 |
} |
619 |
return chbEditable;
|
620 |
} |
621 |
|
622 |
private AcceptCancelPanel getAcceptCancelPanel() {
|
623 |
if (accept == null) { |
624 |
ActionListener okAction, cancelAction;
|
625 |
okAction = new java.awt.event.ActionListener() {
|
626 |
|
627 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
628 |
map.setName(txtName.getText()); |
629 |
map.setOwner(txtOwner.getText()); |
630 |
map.setComment(txtComments.getText()); |
631 |
map.getLayoutContext().setAdjustToGrid( |
632 |
chkActiveGrid.isSelected()); |
633 |
map.getLayoutContext() |
634 |
.setGridVisible(showGrid.isSelected()); |
635 |
map.getLayoutContext().setRuler(activeRuler.isSelected()); |
636 |
map.getLayoutContext() |
637 |
.setEditable(chbEditable.isSelected()); |
638 |
try {
|
639 |
String sh = txtHorizontal.getText();
|
640 |
sh = sh.replace(',', '.'); |
641 |
if (sh.length() != 0) { |
642 |
double f = new Double(sh).doubleValue(); |
643 |
map.getLayoutContext().getAttributes() |
644 |
.setHGridGrapCm(f); |
645 |
} |
646 |
|
647 |
String sv = txtVertical.getText();
|
648 |
sv = sv.replace(',', '.'); |
649 |
if (sv.length() != 0) { |
650 |
double f = new Double(sv).doubleValue(); |
651 |
map.getLayoutContext().getAttributes() |
652 |
.setVGridGrapCm(f); |
653 |
} |
654 |
|
655 |
PluginServices.getMDIManager().closeWindow( |
656 |
MapProperties.this); |
657 |
map.getLayoutContext().setGridVisible( |
658 |
getChbShowGrid().isSelected()); |
659 |
IWindow win = |
660 |
PluginServices.getMDIManager().getActiveWindow(); |
661 |
if (win instanceof LayoutPanel) { |
662 |
((LayoutPanel) win).getLayoutControl().refresh(); |
663 |
} |
664 |
PluginServices.getMainFrame().enableControls(); |
665 |
} catch (NumberFormatException ex) { |
666 |
NotificationManager.addInfo("no es un double", ex);
|
667 |
} |
668 |
isAccepted = true;
|
669 |
} |
670 |
}; |
671 |
cancelAction = new java.awt.event.ActionListener() {
|
672 |
|
673 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
674 |
isAccepted = false;
|
675 |
PluginServices.getMDIManager().closeWindow( |
676 |
MapProperties.this); |
677 |
} |
678 |
}; |
679 |
accept = new AcceptCancelPanel(okAction, cancelAction);
|
680 |
accept.setPreferredSize(new java.awt.Dimension(300, 34)); |
681 |
} |
682 |
return accept;
|
683 |
} |
684 |
|
685 |
public boolean isAccepted() { |
686 |
return isAccepted;
|
687 |
} |
688 |
|
689 |
/**
|
690 |
* This method initializes jPanel6
|
691 |
*
|
692 |
* @return javax.swing.JPanel
|
693 |
*/
|
694 |
private JPanel getJPanel6() { |
695 |
if (jPanel6 == null) { |
696 |
jLabel9 = new JLabel(); |
697 |
jLabel9.setPreferredSize(new java.awt.Dimension(130, 20)); |
698 |
jLabel9 |
699 |
.setHorizontalTextPosition(javax.swing.SwingConstants.TRAILING); |
700 |
jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); |
701 |
jLabel9.setText("");
|
702 |
GridLayout gridLayout5 = new GridLayout(); |
703 |
gridLayout5.setRows(2);
|
704 |
gridLayout5.setColumns(1);
|
705 |
jLabel6 = new JLabel(); |
706 |
jLabel6.setPreferredSize(new java.awt.Dimension(130, 20)); |
707 |
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); |
708 |
jLabel6.setText("");
|
709 |
jPanel6 = new JPanel(); |
710 |
jPanel6.setPreferredSize(new java.awt.Dimension(130, 50)); |
711 |
jPanel6.setLayout(gridLayout5); |
712 |
jPanel6.add(jLabel9, null);
|
713 |
jPanel6.add(jLabel6, null);
|
714 |
} |
715 |
return jPanel6;
|
716 |
} |
717 |
|
718 |
public Object getWindowProfile() { |
719 |
return WindowInfo.DIALOG_PROFILE;
|
720 |
} |
721 |
|
722 |
} // @jve:visual-info decl-index=0 visual-constraint="10,10"
|
723 |
|
724 |
// @jve:visual-info decl-index=0 visual-constraint="10,10"
|