svn-gvsig-desktop / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / project / documents / view / gui / ViewProperties.java @ 9532
History | View | Annotate | Download (17.6 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.project.documents.view.gui; |
42 |
|
43 |
|
44 |
import java.awt.Color; |
45 |
import java.awt.Dimension; |
46 |
import java.awt.GridLayout; |
47 |
import java.awt.event.ActionListener; |
48 |
|
49 |
import javax.swing.JColorChooser; |
50 |
import javax.swing.JPanel; |
51 |
|
52 |
import org.gvsig.gui.beans.AcceptCancelPanel; |
53 |
import org.gvsig.gui.beans.swing.JButton; |
54 |
|
55 |
import com.iver.andami.PluginServices; |
56 |
import com.iver.andami.ui.mdiManager.SingletonWindow; |
57 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
58 |
import com.iver.cit.gvsig.gui.panels.CRSSelectPanel; |
59 |
import com.iver.cit.gvsig.project.documents.layout.Attributes; |
60 |
import com.iver.cit.gvsig.project.documents.view.ProjectView; |
61 |
/**
|
62 |
* Dialogo donde se muestran las propiedades de una vista
|
63 |
*
|
64 |
* @author Fernando Gonz?lez Cort?s
|
65 |
*/
|
66 |
public class ViewProperties extends JPanel implements SingletonWindow{ |
67 |
/*private String[] units = new String[] {
|
68 |
PluginServices.getText(this, "metros"),
|
69 |
PluginServices.getText(this, "kilometros"),
|
70 |
};
|
71 |
*/
|
72 |
private static String[] unitsNames = null; |
73 |
private javax.swing.JLabel jLabel = null; |
74 |
private javax.swing.JTextField txtName = null; |
75 |
private javax.swing.JLabel jLabel1 = null; |
76 |
private javax.swing.JTextField txtDate = null; |
77 |
private javax.swing.JLabel jLabel2 = null; |
78 |
private javax.swing.JTextField txtOwner = null; |
79 |
private javax.swing.JLabel jLabel4 = null; |
80 |
private javax.swing.JComboBox cmbMapUnits = null; |
81 |
private javax.swing.JLabel jLabel5 = null; |
82 |
private javax.swing.JComboBox cmbDistanceUnits = null; |
83 |
private javax.swing.JLabel jLabel6 = null; |
84 |
private javax.swing.JTextArea txtComments = null; |
85 |
private javax.swing.JLabel jLabel7 = null; |
86 |
private javax.swing.JLabel lblColor = null; |
87 |
|
88 |
private Color backColor = null; |
89 |
|
90 |
private JButton btnColor = null; |
91 |
private ProjectView view=null; |
92 |
private javax.swing.JScrollPane jScrollPane = null; |
93 |
private javax.swing.JPanel jPanel = null; |
94 |
private javax.swing.JPanel jPanel1 = null; |
95 |
private javax.swing.JPanel jPanel2 = null; |
96 |
private javax.swing.JPanel jPanel3 = null; |
97 |
|
98 |
private javax.swing.JLabel jLabel3 = null; |
99 |
private javax.swing.JLabel jLabelSep1 = null; |
100 |
private WindowInfo m_viewinfo = null; |
101 |
//private JLabel jLblProj = null;
|
102 |
//private JLabel jLblProjName = null;
|
103 |
//private JButton jBtnChangeProj = null;
|
104 |
protected CRSSelectPanel jPanelProj = null; |
105 |
private AcceptCancelPanel okCancelPanel = null; |
106 |
private boolean isAcceppted=false; |
107 |
|
108 |
/**
|
109 |
* This is the default constructor
|
110 |
*
|
111 |
* @param f Frame padre del dialogo
|
112 |
* @param v Vista que se representa
|
113 |
*/
|
114 |
public ViewProperties(ProjectView v) {
|
115 |
view = v; |
116 |
initialize(); |
117 |
} |
118 |
|
119 |
/**
|
120 |
* This method initializes this
|
121 |
*/
|
122 |
private void initialize() { |
123 |
this.setSize(378, 358); |
124 |
java.awt.FlowLayout layFlowLayout3 = new java.awt.FlowLayout();
|
125 |
layFlowLayout3.setHgap(0);
|
126 |
setLayout(layFlowLayout3); |
127 |
/* jLblProjName = new JLabel();
|
128 |
jLblProj = new JLabel();
|
129 |
jLblProj.setText(view.getProjection().getAbrev());
|
130 |
jLblProj.setPreferredSize(new java.awt.Dimension(180,20));
|
131 |
jLblProjName.setText("Proyecci?n actual:");
|
132 |
jLblProjName.setPreferredSize(new java.awt.Dimension(95,15));*/
|
133 |
this.setPreferredSize(new java.awt.Dimension(365,463)); |
134 |
add(getJPanel(), null);
|
135 |
add(getJPanel1(), null);
|
136 |
add(getJPanel2(), null);
|
137 |
add(getJPanel3(), null);
|
138 |
add(getJLabelSep1(), null);
|
139 |
this.add(getJPanelProj(), null); |
140 |
this.add(getJLabel6(), null); |
141 |
add(getJScrollPane(), null);
|
142 |
|
143 |
|
144 |
this.add(getJLabel7(), null); |
145 |
this.add(getLblColor(), null); |
146 |
this.add(getBtnColor(), null); |
147 |
|
148 |
|
149 |
add(getJLabel3(), null);
|
150 |
this.add(getOkCancelPanel(), null); |
151 |
txtName.setText(view.getName()); |
152 |
txtDate.setText(view.getCreationDate()); |
153 |
txtOwner.setText(view.getOwner()); |
154 |
|
155 |
cmbMapUnits.setSelectedIndex(view.getMapContext().getViewPort().getMapUnits()); |
156 |
cmbDistanceUnits.setSelectedIndex(view.getMapContext().getViewPort().getDistanceUnits()); |
157 |
|
158 |
txtComments.setText(view.getComment()); |
159 |
|
160 |
lblColor.setBackground(view.getMapContext().getViewPort().getBackColor()); |
161 |
} |
162 |
|
163 |
/**
|
164 |
* This method initializes jLabel
|
165 |
*
|
166 |
* @return javax.swing.JLabel
|
167 |
*/
|
168 |
private javax.swing.JLabel getJLabel() {
|
169 |
if (jLabel == null) { |
170 |
jLabel = new javax.swing.JLabel();
|
171 |
jLabel.setText(PluginServices.getText(this, "nombre") + ":"); |
172 |
} |
173 |
|
174 |
return jLabel;
|
175 |
} |
176 |
|
177 |
private javax.swing.JLabel getJLabelSep1() {
|
178 |
if (jLabelSep1 == null) { |
179 |
jLabelSep1 = new javax.swing.JLabel();
|
180 |
jLabelSep1.setPreferredSize(new java.awt.Dimension(200, 10)); |
181 |
} |
182 |
return jLabelSep1;
|
183 |
} |
184 |
|
185 |
/**
|
186 |
* This method initializes txtName
|
187 |
*
|
188 |
* @return javax.swing.JTextField
|
189 |
*/
|
190 |
private javax.swing.JTextField getTxtName() {
|
191 |
if (txtName == null) { |
192 |
txtName = new javax.swing.JTextField();
|
193 |
txtName.setPreferredSize(new java.awt.Dimension(200, 20)); |
194 |
} |
195 |
|
196 |
return txtName;
|
197 |
} |
198 |
|
199 |
/**
|
200 |
* This method initializes jLabel1
|
201 |
*
|
202 |
* @return javax.swing.JLabel
|
203 |
*/
|
204 |
private javax.swing.JLabel getJLabel1() {
|
205 |
if (jLabel1 == null) { |
206 |
jLabel1 = new javax.swing.JLabel();
|
207 |
jLabel1.setText(PluginServices.getText(this, "creation_date") + ":"); |
208 |
} |
209 |
|
210 |
return jLabel1;
|
211 |
} |
212 |
|
213 |
/**
|
214 |
* This method initializes txtDate
|
215 |
*
|
216 |
* @return javax.swing.JTextField
|
217 |
*/
|
218 |
private javax.swing.JTextField getTxtDate() {
|
219 |
if (txtDate == null) { |
220 |
txtDate = new javax.swing.JTextField();
|
221 |
txtDate.setPreferredSize(new java.awt.Dimension(200, 20)); |
222 |
txtDate.setEditable(false);
|
223 |
txtDate.setBackground(java.awt.Color.white); |
224 |
} |
225 |
|
226 |
return txtDate;
|
227 |
} |
228 |
|
229 |
/**
|
230 |
* This method initializes jLabel2
|
231 |
*
|
232 |
* @return javax.swing.JLabel
|
233 |
*/
|
234 |
private javax.swing.JLabel getJLabel2() {
|
235 |
if (jLabel2 == null) { |
236 |
jLabel2 = new javax.swing.JLabel();
|
237 |
jLabel2.setText(PluginServices.getText(this, "owner") + ":"); |
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(200, 20)); |
252 |
} |
253 |
|
254 |
return txtOwner;
|
255 |
} |
256 |
|
257 |
/**
|
258 |
* This method initializes jLabel4
|
259 |
*
|
260 |
* @return javax.swing.JLabel
|
261 |
*/
|
262 |
private javax.swing.JLabel getJLabel4() {
|
263 |
if (jLabel4 == null) { |
264 |
jLabel4 = new javax.swing.JLabel();
|
265 |
jLabel4.setText(PluginServices.getText(this, "map_units") + ":"); |
266 |
} |
267 |
|
268 |
return jLabel4;
|
269 |
} |
270 |
|
271 |
/**
|
272 |
* This method initializes cmbMapUnits
|
273 |
*
|
274 |
* @return javax.swing.JComboBox
|
275 |
*/
|
276 |
private javax.swing.JComboBox getCmbMapUnits() {
|
277 |
if (cmbMapUnits == null) { |
278 |
cmbMapUnits = new javax.swing.JComboBox(getUnitsNames());
|
279 |
cmbMapUnits.setPreferredSize(new java.awt.Dimension(200, 20)); |
280 |
cmbMapUnits.setSelectedIndex(view.getMapContext().getViewPort().getMapUnits()); |
281 |
cmbMapUnits.addActionListener(new java.awt.event.ActionListener() {
|
282 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
283 |
view.getMapContext().getViewPort().setMapUnits(cmbMapUnits.getSelectedIndex()); |
284 |
} |
285 |
}); |
286 |
} |
287 |
|
288 |
return cmbMapUnits;
|
289 |
} |
290 |
|
291 |
/**
|
292 |
* This method initializes jLabel5
|
293 |
*
|
294 |
* @return javax.swing.JLabel
|
295 |
*/
|
296 |
private javax.swing.JLabel getJLabel5() {
|
297 |
if (jLabel5 == null) { |
298 |
jLabel5 = new javax.swing.JLabel();
|
299 |
jLabel5.setText(PluginServices.getText(this, "distance_units") + ":"); |
300 |
} |
301 |
|
302 |
return jLabel5;
|
303 |
} |
304 |
|
305 |
/**
|
306 |
* This method initializes cmbDistanceUnits
|
307 |
*
|
308 |
* @return javax.swing.JComboBox
|
309 |
*/
|
310 |
private javax.swing.JComboBox getCmbDistanceUnits() {
|
311 |
if (cmbDistanceUnits == null) { |
312 |
cmbDistanceUnits = new javax.swing.JComboBox(getUnitsNames());
|
313 |
cmbDistanceUnits.setPreferredSize(new java.awt.Dimension(200, 20)); |
314 |
cmbDistanceUnits.setEditable(false);
|
315 |
cmbDistanceUnits.setSelectedIndex(view.getMapContext().getViewPort().getDistanceUnits()); |
316 |
cmbDistanceUnits.addActionListener(new java.awt.event.ActionListener() {
|
317 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
318 |
view.getMapContext().getViewPort().setDistanceUnits(cmbDistanceUnits.getSelectedIndex()); |
319 |
} |
320 |
}); |
321 |
} |
322 |
|
323 |
return cmbDistanceUnits;
|
324 |
} |
325 |
|
326 |
/**
|
327 |
* This method initializes jLabel6
|
328 |
*
|
329 |
* @return javax.swing.JLabel
|
330 |
*/
|
331 |
private javax.swing.JLabel getJLabel6() {
|
332 |
if (jLabel6 == null) { |
333 |
jLabel6 = new javax.swing.JLabel();
|
334 |
jLabel6.setText(PluginServices.getText(this, "comentarios") + ":"); |
335 |
jLabel6.setPreferredSize(new java.awt.Dimension(340,35)); |
336 |
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); |
337 |
jLabel6.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); |
338 |
} |
339 |
|
340 |
return jLabel6;
|
341 |
} |
342 |
|
343 |
/**
|
344 |
* This method initializes txtComments
|
345 |
*
|
346 |
* @return javax.swing.JTextArea
|
347 |
*/
|
348 |
private javax.swing.JTextArea getTxtComments() {
|
349 |
if (txtComments == null) { |
350 |
txtComments = new javax.swing.JTextArea();
|
351 |
txtComments.setRows(1);
|
352 |
txtComments.setColumns(28);
|
353 |
} |
354 |
|
355 |
return txtComments;
|
356 |
} |
357 |
|
358 |
/**
|
359 |
* This method initializes jLabel7
|
360 |
*
|
361 |
* @return javax.swing.JLabel
|
362 |
*/
|
363 |
private javax.swing.JLabel getJLabel7() {
|
364 |
if (jLabel7 == null) { |
365 |
jLabel7 = new javax.swing.JLabel();
|
366 |
jLabel7.setText(PluginServices.getText(this, "background_color") + |
367 |
":");
|
368 |
jLabel7.setPreferredSize(new java.awt.Dimension(190,16)); |
369 |
} |
370 |
|
371 |
return jLabel7;
|
372 |
} |
373 |
|
374 |
/**
|
375 |
* This method initializes lblColor
|
376 |
*
|
377 |
* @return javax.swing.JLabel
|
378 |
*/
|
379 |
private javax.swing.JLabel getLblColor() {
|
380 |
if (lblColor == null) { |
381 |
lblColor = new javax.swing.JLabel();
|
382 |
lblColor.setText("");
|
383 |
lblColor.setPreferredSize(new java.awt.Dimension(30, 16)); |
384 |
Color theColor = view.getMapContext().getViewPort().getBackColor();
|
385 |
if (theColor == null) theColor = Color.WHITE; |
386 |
lblColor.setBackground(theColor); |
387 |
lblColor.setOpaque(true);
|
388 |
} |
389 |
|
390 |
return lblColor;
|
391 |
} |
392 |
|
393 |
/**
|
394 |
* This method initializes btnColor
|
395 |
*
|
396 |
* @return javax.swing.JButton
|
397 |
*/
|
398 |
private JButton getBtnColor() { |
399 |
if (btnColor == null) { |
400 |
btnColor = new JButton(); |
401 |
|
402 |
btnColor.setText("...");
|
403 |
|
404 |
btnColor.addActionListener(new java.awt.event.ActionListener() {
|
405 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
406 |
Color ret = JColorChooser.showDialog(ViewProperties.this, |
407 |
PluginServices.getText(this, "background_color"), |
408 |
lblColor.getBackground()); |
409 |
|
410 |
if (ret != null) { |
411 |
lblColor.setBackground(ret); |
412 |
backColor = ret; |
413 |
} |
414 |
else
|
415 |
lblColor.setBackground(Color.WHITE);
|
416 |
} |
417 |
}); |
418 |
} |
419 |
|
420 |
return btnColor;
|
421 |
} |
422 |
|
423 |
/**
|
424 |
* This method initializes jScrollPane
|
425 |
*
|
426 |
* @return javax.swing.JScrollPane
|
427 |
*/
|
428 |
private javax.swing.JScrollPane getJScrollPane() {
|
429 |
if (jScrollPane == null) { |
430 |
jScrollPane = new javax.swing.JScrollPane();
|
431 |
jScrollPane.setViewportView(getTxtComments()); |
432 |
jScrollPane.setPreferredSize(new java.awt.Dimension(340, 70)); |
433 |
} |
434 |
|
435 |
return jScrollPane;
|
436 |
} |
437 |
|
438 |
/**
|
439 |
* This method initializes jPanel
|
440 |
*
|
441 |
* @return javax.swing.JPanel
|
442 |
*/
|
443 |
private javax.swing.JPanel getJPanel() {
|
444 |
if (jPanel == null) { |
445 |
jPanel = new javax.swing.JPanel();
|
446 |
|
447 |
/*
|
448 |
java.awt.FlowLayout layFlowLayout4 = new java.awt.FlowLayout();
|
449 |
layFlowLayout4.setAlignment(java.awt.FlowLayout.LEFT);
|
450 |
layFlowLayout4.setVgap(9);
|
451 |
jPanel.setLayout(layFlowLayout4);
|
452 |
*/
|
453 |
|
454 |
GridLayout layout = new GridLayout(3,1); |
455 |
layout.setVgap(5);
|
456 |
jPanel.setLayout(layout); |
457 |
|
458 |
|
459 |
jPanel.add(getJLabel(), null);
|
460 |
jPanel.add(getJLabel1(), null);
|
461 |
jPanel.add(getJLabel2(), null);
|
462 |
jPanel.setPreferredSize(new java.awt.Dimension(140, 80)); |
463 |
} |
464 |
|
465 |
return jPanel;
|
466 |
} |
467 |
|
468 |
/**
|
469 |
* This method initializes jPanel1
|
470 |
*
|
471 |
* @return javax.swing.JPanel
|
472 |
*/
|
473 |
private javax.swing.JPanel getJPanel1() {
|
474 |
if (jPanel1 == null) { |
475 |
jPanel1 = new javax.swing.JPanel();
|
476 |
|
477 |
java.awt.FlowLayout layFlowLayout2 = new java.awt.FlowLayout();
|
478 |
layFlowLayout2.setHgap(5);
|
479 |
layFlowLayout2.setAlignment(java.awt.FlowLayout.LEFT); |
480 |
jPanel1.setLayout(layFlowLayout2); |
481 |
jPanel1.add(getTxtName(), null);
|
482 |
jPanel1.add(getTxtDate(), null);
|
483 |
jPanel1.add(getTxtOwner(), null);
|
484 |
jPanel1.setPreferredSize(new java.awt.Dimension(210, 80)); |
485 |
} |
486 |
|
487 |
return jPanel1;
|
488 |
} |
489 |
|
490 |
/**
|
491 |
* This method initializes jPanel2
|
492 |
*
|
493 |
* @return javax.swing.JPanel
|
494 |
*/
|
495 |
private javax.swing.JPanel getJPanel2() {
|
496 |
if (jPanel2 == null) { |
497 |
jPanel2 = new javax.swing.JPanel();
|
498 |
|
499 |
java.awt.FlowLayout layFlowLayout5 = new java.awt.FlowLayout();
|
500 |
layFlowLayout5.setAlignment(java.awt.FlowLayout.LEFT); |
501 |
layFlowLayout5.setVgap(9);
|
502 |
jPanel2.setLayout(layFlowLayout5); |
503 |
jPanel2.add(getJLabel4(), null);
|
504 |
jPanel2.add(getJLabel5(), null);
|
505 |
jPanel2.setPreferredSize(new java.awt.Dimension(140, 50)); |
506 |
} |
507 |
|
508 |
return jPanel2;
|
509 |
} |
510 |
|
511 |
/**
|
512 |
* This method initializes jPanel3
|
513 |
*
|
514 |
* @return javax.swing.JPanel
|
515 |
*/
|
516 |
private javax.swing.JPanel getJPanel3() {
|
517 |
if (jPanel3 == null) { |
518 |
jPanel3 = new javax.swing.JPanel();
|
519 |
|
520 |
java.awt.FlowLayout layFlowLayout6 = new java.awt.FlowLayout();
|
521 |
layFlowLayout6.setAlignment(java.awt.FlowLayout.LEFT); |
522 |
jPanel3.setLayout(layFlowLayout6); |
523 |
jPanel3.add(getCmbMapUnits(), null);
|
524 |
jPanel3.add(getCmbDistanceUnits(), null);
|
525 |
jPanel3.setPreferredSize(new java.awt.Dimension(210, 50)); |
526 |
} |
527 |
|
528 |
return jPanel3;
|
529 |
} |
530 |
|
531 |
|
532 |
/**
|
533 |
* This method initializes jLabel3
|
534 |
*
|
535 |
* @return javax.swing.JLabel
|
536 |
*/
|
537 |
private javax.swing.JLabel getJLabel3() {
|
538 |
if (jLabel3 == null) { |
539 |
jLabel3 = new javax.swing.JLabel();
|
540 |
jLabel3.setText("");
|
541 |
jLabel3.setPreferredSize(new java.awt.Dimension(30, 0)); |
542 |
} |
543 |
|
544 |
return jLabel3;
|
545 |
} |
546 |
|
547 |
/**
|
548 |
* @see com.iver.mdiApp.ui.MDIManager.IWindow#getWindowInfo()
|
549 |
*/
|
550 |
public WindowInfo getWindowInfo() {
|
551 |
WindowInfo m_viewinfo=new WindowInfo();
|
552 |
m_viewinfo.setTitle(PluginServices.getText(this, "propiedades_vista")); |
553 |
m_viewinfo.setHeight(370);
|
554 |
return m_viewinfo;
|
555 |
} |
556 |
|
557 |
/**
|
558 |
* @see com.iver.mdiApp.ui.MDIManager.IWindow#windowActivated()
|
559 |
*/
|
560 |
public void viewActivated() { |
561 |
} |
562 |
/**
|
563 |
* This method initializes jButton
|
564 |
*
|
565 |
* @return javax.swing.JButton
|
566 |
* /
|
567 |
private JButton getJBtnChangeProj() {
|
568 |
if (jBtnChangeProj == null) {
|
569 |
jBtnChangeProj = new JButton();
|
570 |
jBtnChangeProj.setText("...");
|
571 |
jBtnChangeProj.setPreferredSize(new java.awt.Dimension(34,16));
|
572 |
jBtnChangeProj.addActionListener(new java.awt.event.ActionListener() {
|
573 |
public void actionPerformed(java.awt.event.ActionEvent e) {
|
574 |
CSSelectionDialog csSelect = new CSSelectionDialog();
|
575 |
csSelect.setProjection(view.getProjection());
|
576 |
|
577 |
PluginServices.getMDIManager().addView(csSelect);
|
578 |
|
579 |
if (csSelect.isOkPressed()) {
|
580 |
view.getMapContext().setProjection(csSelect.getProjection());
|
581 |
jLblProj.setText(view.getProjection().getAbrev());
|
582 |
}
|
583 |
}
|
584 |
});
|
585 |
}
|
586 |
return jBtnChangeProj;
|
587 |
} */
|
588 |
/**
|
589 |
* This method initializes jPanel4
|
590 |
*
|
591 |
* @return javax.swing.JPanel
|
592 |
*/
|
593 |
private CRSSelectPanel getJPanelProj() {
|
594 |
if (jPanelProj == null) { |
595 |
jPanelProj = CRSSelectPanel.getPanel(view.getProjection()); |
596 |
jPanelProj.setPreferredSize(new java.awt.Dimension(330,35)); |
597 |
jPanelProj.addActionListener(new java.awt.event.ActionListener() {
|
598 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
599 |
if (jPanelProj.isOkPressed()) {
|
600 |
view.setProjection(jPanelProj.getCurProj()); |
601 |
} |
602 |
} |
603 |
}); |
604 |
|
605 |
// jPanelProj.add(jLblProjName, null);
|
606 |
// jPanelProj.add(jLblProj, null);
|
607 |
// jPanelProj.add(getJBtnChangeProj(), null);
|
608 |
} |
609 |
return jPanelProj;
|
610 |
} |
611 |
|
612 |
/**
|
613 |
* @see com.iver.andami.ui.mdiManager.SingletonWindow#getWindowModel()
|
614 |
*/
|
615 |
public Object getWindowModel() { |
616 |
return view;
|
617 |
} |
618 |
|
619 |
/**
|
620 |
* This method initializes okCancelPanel
|
621 |
*
|
622 |
* @return javax.swing.JPanel
|
623 |
*/
|
624 |
private AcceptCancelPanel getOkCancelPanel() {
|
625 |
if (okCancelPanel == null) { |
626 |
ActionListener okAction, cancelAction;
|
627 |
okAction = new java.awt.event.ActionListener() {
|
628 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
629 |
view.setName(txtName.getText()); |
630 |
view.setCreationDate(txtDate.getText()); |
631 |
view.setOwner(txtOwner.getText()); |
632 |
view.setComment(txtComments.getText()); |
633 |
view.getMapContext().getViewPort().setMapUnits(cmbMapUnits.getSelectedIndex()); |
634 |
view.getMapContext().getViewPort().setDistanceUnits(cmbDistanceUnits.getSelectedIndex()); |
635 |
view.setBackColor(backColor); |
636 |
isAcceppted=true;
|
637 |
PluginServices.getMDIManager().closeWindow(ViewProperties.this); |
638 |
} |
639 |
}; |
640 |
cancelAction = new java.awt.event.ActionListener() {
|
641 |
|
642 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
643 |
isAcceppted=false;
|
644 |
PluginServices.getMDIManager().closeWindow(ViewProperties.this); |
645 |
} |
646 |
}; |
647 |
okCancelPanel = new AcceptCancelPanel(okAction, cancelAction);
|
648 |
Dimension sz = this.getSize(); |
649 |
sz.setSize((int)sz.getWidth()-20, (int) sz.getHeight()); |
650 |
okCancelPanel.setPreferredSize(sz); |
651 |
} |
652 |
return okCancelPanel;
|
653 |
} |
654 |
|
655 |
private String[] getUnitsNames() { |
656 |
if (unitsNames == null) { |
657 |
unitsNames = new String[Attributes.NAMES.length]; |
658 |
for (int i=0;i<Attributes.NAMES.length;i++) { |
659 |
unitsNames[i]=PluginServices.getText(this, Attributes.NAMES[i]); |
660 |
} |
661 |
} |
662 |
return unitsNames;
|
663 |
} |
664 |
|
665 |
public boolean isAcceppted() { |
666 |
return isAcceppted;
|
667 |
} |
668 |
} |