svn-gvsig-desktop / branches / v2_0_0_prep / extensions / org.gvsig.app.document.layout.app / org.gvsig.app.document.layout.app.mainplugin / src / main / java / org / gvsig / app / project / documents / layout / fframes / gui / dialogs / FFrameViewDialog.java @ 36648
History | View | Annotate | Download (26.8 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.fframes.gui.dialogs; |
23 |
|
24 |
import java.awt.Dimension; |
25 |
import java.awt.geom.Rectangle2D; |
26 |
|
27 |
import javax.swing.JButton; |
28 |
import javax.swing.JCheckBox; |
29 |
import javax.swing.JList; |
30 |
|
31 |
import org.gvsig.andami.PluginServices; |
32 |
import org.gvsig.andami.messages.NotificationManager; |
33 |
import org.gvsig.andami.ui.mdiManager.WindowInfo; |
34 |
import org.gvsig.app.project.documents.layout.FLayoutUtilities; |
35 |
import org.gvsig.app.project.documents.layout.fframes.FFrameGrid; |
36 |
import org.gvsig.app.project.documents.layout.fframes.FFrameGridFactory; |
37 |
import org.gvsig.app.project.documents.layout.fframes.FFrameView; |
38 |
import org.gvsig.app.project.documents.layout.fframes.IFFrame; |
39 |
import org.gvsig.app.project.documents.layout.fframes.ListViewModel; |
40 |
import org.gvsig.app.project.documents.layout.fframes.gui.JPRotation; |
41 |
import org.gvsig.app.project.documents.layout.gui.LayoutPanel; |
42 |
import org.gvsig.app.project.documents.view.DefaultViewDocument; |
43 |
import org.gvsig.fmap.mapcontext.ViewPort; |
44 |
|
45 |
/**
|
46 |
* Di?logo para a?adir una vista al Layout.
|
47 |
*
|
48 |
* @author Vicente Caballero Navarro
|
49 |
*/
|
50 |
public class FFrameViewDialog extends AbstractFFrameDialog implements |
51 |
IFFrameDialog { |
52 |
|
53 |
private static final long serialVersionUID = -7223804566537544559L; |
54 |
private javax.swing.JPanel jContentPane = null; |
55 |
private javax.swing.JLabel lVistas = null; |
56 |
private javax.swing.JScrollPane jScrollPane = null; |
57 |
private javax.swing.JList liVistas = null; // @jve:visual-info decl-index=0 |
58 |
// visual-constraint="98,-3"
|
59 |
private javax.swing.JCheckBox chbEnlaceVivo = null; |
60 |
private javax.swing.JLabel lEscala = null; |
61 |
private javax.swing.JComboBox cbEscala = null; |
62 |
private javax.swing.JLabel lEscalaNumerica = null; |
63 |
private javax.swing.JTextField tEscalaNumerica = null; |
64 |
private javax.swing.JLabel lExtension = null; |
65 |
private javax.swing.JComboBox cbExtension = null; |
66 |
private javax.swing.JLabel lVisualizacion = null; |
67 |
private javax.swing.JComboBox cbVisualizacion = null; |
68 |
private javax.swing.JButton bAceptar = null; |
69 |
private javax.swing.JButton bCancelar = null; |
70 |
private javax.swing.JLabel lCalidad = null; |
71 |
private javax.swing.JComboBox cbCalidad = null; |
72 |
private DefaultViewDocument m_projectView = null; |
73 |
private Rectangle2D rect = new Rectangle2D.Double(); |
74 |
private FFrameView fframeview = null; // new FFrameView(); |
75 |
private boolean isAcepted = false; |
76 |
private JPRotation rotation = null; |
77 |
private FFrameView newFFrameView = null; |
78 |
private javax.swing.JButton bGrid = null; |
79 |
private javax.swing.JCheckBox chbShowGrid = null; |
80 |
|
81 |
/**
|
82 |
* This is the default constructor
|
83 |
*
|
84 |
* @param layoutPanel
|
85 |
* Referencia al Layout.
|
86 |
* @param fframe
|
87 |
* Referencia al fframe vista.
|
88 |
*/
|
89 |
public FFrameViewDialog(LayoutPanel layoutPanel, IFFrame frame) {
|
90 |
super(layoutPanel, frame);
|
91 |
fframeview = (FFrameView) frame; |
92 |
initialize(); |
93 |
} |
94 |
|
95 |
/**
|
96 |
* This method initializes this
|
97 |
*/
|
98 |
private void initialize() { |
99 |
this.setLayout(null); |
100 |
this.add(getJContentPane(), null); |
101 |
this.setSize(478, 269); |
102 |
|
103 |
if (fframeview.getTypeScale() == 0 || fframeview.getTypeScale() == 1) { |
104 |
getTEscalaNumerica().setEnabled(false);
|
105 |
} else {
|
106 |
getTEscalaNumerica().setEnabled(true);
|
107 |
} |
108 |
getPRotation().setRotation(fframeview.getRotation()); |
109 |
} |
110 |
|
111 |
/**
|
112 |
* Inserta el rect?ngulo que ocupar? el fframe vista.
|
113 |
*
|
114 |
* @param r
|
115 |
* Rect?ngulo.
|
116 |
*/
|
117 |
public void setRectangle(Rectangle2D r) { |
118 |
rect.setRect(r); |
119 |
} |
120 |
|
121 |
/**
|
122 |
* This method initializes jContentPane
|
123 |
*
|
124 |
* @return javax.swing.JPanel
|
125 |
*/
|
126 |
private javax.swing.JPanel getJContentPane() {
|
127 |
if (jContentPane == null) { |
128 |
jContentPane = new javax.swing.JPanel();
|
129 |
jContentPane.setLayout(null);
|
130 |
jContentPane.add(getLVistas(), null);
|
131 |
jContentPane.add(getJScrollPane(), null);
|
132 |
jContentPane.add(getChbEnlaceVivo(), null);
|
133 |
jContentPane.add(getLEscala(), null);
|
134 |
jContentPane.add(getCbEscala(), null);
|
135 |
jContentPane.add(getLEscalaNumerica(), null);
|
136 |
jContentPane.add(getTEscalaNumerica(), null);
|
137 |
jContentPane.add(getLExtension(), null);
|
138 |
jContentPane.add(getCbExtension(), null);
|
139 |
jContentPane.add(getLVisualizacion(), null);
|
140 |
jContentPane.add(getCbVisualizacion(), null);
|
141 |
jContentPane.add(getLCalidad(), null);
|
142 |
jContentPane.add(getCbCalidad(), null);
|
143 |
jContentPane.add(getbAceptar(), null);
|
144 |
jContentPane.add(getBCancelar(), null);
|
145 |
jContentPane.setSize(475, 264); |
146 |
jContentPane.setPreferredSize(new java.awt.Dimension(60, 60)); |
147 |
jContentPane.setLocation(0, 0); |
148 |
jContentPane.add(getPRotation(), null);
|
149 |
jContentPane.add(getBGrid(), null);
|
150 |
jContentPane.add(getChbShowGrid(), null);
|
151 |
} |
152 |
|
153 |
return jContentPane;
|
154 |
} |
155 |
|
156 |
/**
|
157 |
* This method initializes lVistas
|
158 |
*
|
159 |
* @return javax.swing.JLabel
|
160 |
*/
|
161 |
private javax.swing.JLabel getLVistas() {
|
162 |
if (lVistas == null) { |
163 |
lVistas = new javax.swing.JLabel();
|
164 |
lVistas.setSize(85, 19); |
165 |
lVistas.setText(PluginServices.getText(this, "Vista")); |
166 |
lVistas.setLocation(10, 10); |
167 |
} |
168 |
|
169 |
return lVistas;
|
170 |
} |
171 |
|
172 |
/**
|
173 |
* This method initializes jScrollPane
|
174 |
*
|
175 |
* @return javax.swing.JScrollPane
|
176 |
*/
|
177 |
private javax.swing.JScrollPane getJScrollPane() {
|
178 |
if (jScrollPane == null) { |
179 |
jScrollPane = new javax.swing.JScrollPane();
|
180 |
jScrollPane.setViewportView(getLiVistas()); |
181 |
jScrollPane.setBounds(99, 8, 224, 64); |
182 |
jScrollPane.setPreferredSize(new java.awt.Dimension(250, 60)); |
183 |
} |
184 |
|
185 |
return jScrollPane;
|
186 |
} |
187 |
|
188 |
/**
|
189 |
* This method initializes liVistas
|
190 |
*
|
191 |
* @return javax.swing.JList
|
192 |
*/
|
193 |
private javax.swing.JList getLiVistas() {
|
194 |
if (liVistas == null) { |
195 |
ListViewModel listmodel = new ListViewModel();
|
196 |
listmodel.addViews(); |
197 |
liVistas = new javax.swing.JList();
|
198 |
liVistas.setModel(listmodel); |
199 |
for (int i = 0; i < liVistas.getModel().getSize(); i++) { |
200 |
if (fframeview.getMapContext() != null) { |
201 |
|
202 |
DefaultViewDocument pvaux = |
203 |
(DefaultViewDocument) liVistas.getModel().getElementAt( |
204 |
i); |
205 |
|
206 |
if (pvaux.getMapContext()
|
207 |
.equals(fframeview.getMapContext())) { |
208 |
liVistas.setSelectedIndex(i); |
209 |
m_projectView = |
210 |
(DefaultViewDocument) liVistas.getModel() |
211 |
.getElementAt(i); |
212 |
} |
213 |
} |
214 |
} |
215 |
|
216 |
liVistas |
217 |
.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
|
218 |
|
219 |
private int selectIndex = -1; |
220 |
private Rectangle2D boundBox; |
221 |
|
222 |
public void valueChanged( |
223 |
javax.swing.event.ListSelectionEvent e) { |
224 |
int selectInt =
|
225 |
((JList) e.getSource()).getSelectedIndex();
|
226 |
if (selectInt != selectIndex) {
|
227 |
selectIndex = selectInt; |
228 |
if (selectIndex == -1) { |
229 |
return;
|
230 |
} |
231 |
m_projectView = |
232 |
(DefaultViewDocument) liVistas.getModel() |
233 |
.getElementAt(selectInt); |
234 |
|
235 |
getCbEscala().setSelectedItem( |
236 |
PluginServices.getText(this, "automatico")); |
237 |
boundBox = |
238 |
FLayoutUtilities.toSheetRect(rect, layoutPanel |
239 |
.getLayoutControl().getAT()); |
240 |
// fframeview.setBoundBox(FLayoutUtilities.toSheetRect(
|
241 |
// rect, m_layout.getAT()));
|
242 |
|
243 |
// fframeview.setView(m_projectView);
|
244 |
//
|
245 |
// fframeview.setMapUnits(m_projectView.getMapContext()
|
246 |
// .getViewPort()
|
247 |
// .getMapUnits());
|
248 |
ViewPort vp; |
249 |
try {
|
250 |
vp = |
251 |
(ViewPort) m_projectView.getMapContext() |
252 |
.getViewPort().clone(); |
253 |
vp.setImageSize(new Dimension((int) rect |
254 |
.getWidth(), (int) rect.getHeight()));
|
255 |
getTEscalaNumerica().setText( |
256 |
String.valueOf(FLayoutUtilities
|
257 |
.getScaleView(vp, boundBox.getWidth(), |
258 |
FLayoutUtilities.fromSheetDistance( |
259 |
boundBox.getWidth(), |
260 |
layoutPanel.getLayoutControl() |
261 |
.getAT())))); |
262 |
} catch (CloneNotSupportedException e1) { |
263 |
NotificationManager.addError("Excepci?n :", e1);
|
264 |
} |
265 |
// getTEscalaNumerica().setText(String.valueOf(
|
266 |
// fframeview.getScale()));
|
267 |
} |
268 |
} |
269 |
}); |
270 |
} |
271 |
|
272 |
return liVistas;
|
273 |
} |
274 |
|
275 |
/**
|
276 |
* This method initializes chbEnlaceVivo
|
277 |
*
|
278 |
* @return javax.swing.JCheckBox
|
279 |
*/
|
280 |
private javax.swing.JCheckBox getChbEnlaceVivo() {
|
281 |
if (chbEnlaceVivo == null) { |
282 |
chbEnlaceVivo = new javax.swing.JCheckBox();
|
283 |
chbEnlaceVivo.setSize(88, 24); |
284 |
chbEnlaceVivo.setText(PluginServices.getText(this, "enlace_vivo")); |
285 |
chbEnlaceVivo.setSelected(fframeview.getLinked()); |
286 |
chbEnlaceVivo.setLocation(10, 75); |
287 |
chbEnlaceVivo.setEnabled(true);
|
288 |
chbEnlaceVivo |
289 |
.addActionListener(new java.awt.event.ActionListener() {
|
290 |
|
291 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
292 |
System.out.println("actionPerformed()"); // TODO |
293 |
// Auto-generated
|
294 |
// Event stub
|
295 |
// actionPerformed()
|
296 |
} |
297 |
}); |
298 |
} |
299 |
|
300 |
return chbEnlaceVivo;
|
301 |
} |
302 |
|
303 |
/**
|
304 |
* This method initializes lEscala
|
305 |
*
|
306 |
* @return javax.swing.JLabel
|
307 |
*/
|
308 |
private javax.swing.JLabel getLEscala() {
|
309 |
if (lEscala == null) { |
310 |
lEscala = new javax.swing.JLabel();
|
311 |
lEscala.setSize(86, 16); |
312 |
lEscala.setText(PluginServices.getText(this, "escala")); |
313 |
lEscala.setLocation(10, 105); |
314 |
} |
315 |
|
316 |
return lEscala;
|
317 |
} |
318 |
|
319 |
/**
|
320 |
* This method initializes cbEscala
|
321 |
*
|
322 |
* @return javax.swing.JComboBox
|
323 |
*/
|
324 |
private javax.swing.JComboBox getCbEscala() {
|
325 |
if (cbEscala == null) { |
326 |
// String[]
|
327 |
// s={"Autom?tico","Conservar escala de visualizaci?n","Escala especificada por el usuario"};
|
328 |
cbEscala = new javax.swing.JComboBox();
|
329 |
cbEscala.setSize(220, 20); |
330 |
cbEscala.addItem(PluginServices.getText(this, "automatico")); |
331 |
cbEscala.addItem(PluginServices.getText(this,
|
332 |
"conservar_escala_visualizacion"));
|
333 |
cbEscala.addItem(PluginServices.getText(this, "escala_usuario")); |
334 |
cbEscala.setSelectedIndex(fframeview.getTypeScale()); |
335 |
|
336 |
if (fframeview.getTypeScale() == 0 |
337 |
|| fframeview.getTypeScale() == 1) {
|
338 |
getTEscalaNumerica().setEnabled(false);
|
339 |
} else {
|
340 |
getTEscalaNumerica().setEnabled(true);
|
341 |
} |
342 |
|
343 |
cbEscala.setPreferredSize(new java.awt.Dimension(200, 20)); |
344 |
cbEscala.setLocation(100, 105); |
345 |
cbEscala.addActionListener(new java.awt.event.ActionListener() {
|
346 |
|
347 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
348 |
if (cbEscala.getSelectedIndex() == 2) { |
349 |
getTEscalaNumerica().setEnabled(true);
|
350 |
} else {
|
351 |
getTEscalaNumerica().setEnabled(false);
|
352 |
} |
353 |
} |
354 |
}); |
355 |
} |
356 |
|
357 |
return cbEscala;
|
358 |
} |
359 |
|
360 |
/**
|
361 |
* This method initializes lEscalaNumerica
|
362 |
*
|
363 |
* @return javax.swing.JLabel
|
364 |
*/
|
365 |
private javax.swing.JLabel getLEscalaNumerica() {
|
366 |
if (lEscalaNumerica == null) { |
367 |
lEscalaNumerica = new javax.swing.JLabel();
|
368 |
lEscalaNumerica.setSize(86, 16); |
369 |
lEscalaNumerica.setText("1:");
|
370 |
lEscalaNumerica.setLocation(10, 130); |
371 |
} |
372 |
|
373 |
return lEscalaNumerica;
|
374 |
} |
375 |
|
376 |
/**
|
377 |
* This method initializes tEscalaNumerica
|
378 |
*
|
379 |
* @return javax.swing.JTextField
|
380 |
*/
|
381 |
private javax.swing.JTextField getTEscalaNumerica() {
|
382 |
if (tEscalaNumerica == null) { |
383 |
tEscalaNumerica = new javax.swing.JTextField();
|
384 |
tEscalaNumerica.setSize(220, 20); |
385 |
tEscalaNumerica.setPreferredSize(new java.awt.Dimension(200, 20)); |
386 |
|
387 |
if (m_projectView != null) { |
388 |
tEscalaNumerica.setText(String.valueOf(fframeview.getScale()));
|
389 |
} |
390 |
tEscalaNumerica.setLocation(100, 130); |
391 |
tEscalaNumerica.setEnabled(false);
|
392 |
} |
393 |
|
394 |
return tEscalaNumerica;
|
395 |
} |
396 |
|
397 |
/**
|
398 |
* This method initializes lExtension
|
399 |
*
|
400 |
* @return javax.swing.JLabel
|
401 |
*/
|
402 |
private javax.swing.JLabel getLExtension() {
|
403 |
if (lExtension == null) { |
404 |
lExtension = new javax.swing.JLabel();
|
405 |
lExtension.setSize(86, 16); |
406 |
lExtension.setText(PluginServices.getText(this, "extension")); |
407 |
lExtension.setLocation(10, 155); |
408 |
lExtension.setVisible(false);
|
409 |
} |
410 |
|
411 |
return lExtension;
|
412 |
} |
413 |
|
414 |
/**
|
415 |
* This method initializes cbExtension
|
416 |
*
|
417 |
* @return javax.swing.JComboBox
|
418 |
*/
|
419 |
private javax.swing.JComboBox getCbExtension() {
|
420 |
if (cbExtension == null) { |
421 |
// String[] s={"Rellenar marco de la vista","Recorte a vista"};
|
422 |
cbExtension = new javax.swing.JComboBox();
|
423 |
cbExtension.setSize(220, 20); |
424 |
cbExtension.addItem(PluginServices.getText(this,
|
425 |
"rellenar_marco_vista"));
|
426 |
cbExtension.addItem(PluginServices.getText(this, "recorte_vista")); |
427 |
|
428 |
cbExtension.setPreferredSize(new java.awt.Dimension(200, 20)); |
429 |
cbExtension.setLocation(100, 155); |
430 |
cbExtension.setEnabled(false);
|
431 |
cbExtension.setVisible(false);
|
432 |
} |
433 |
|
434 |
return cbExtension;
|
435 |
} |
436 |
|
437 |
/**
|
438 |
* This method initializes jLabel4
|
439 |
*
|
440 |
* @return javax.swing.JLabel
|
441 |
*/
|
442 |
private javax.swing.JLabel getLVisualizacion() {
|
443 |
if (lVisualizacion == null) { |
444 |
lVisualizacion = new javax.swing.JLabel();
|
445 |
lVisualizacion.setSize(86, 16); |
446 |
lVisualizacion.setText(PluginServices |
447 |
.getText(this, "visualizacion")); |
448 |
lVisualizacion.setLocation(10, 180); |
449 |
lVisualizacion.setVisible(false);
|
450 |
} |
451 |
|
452 |
return lVisualizacion;
|
453 |
} |
454 |
|
455 |
/**
|
456 |
* This method initializes cbVisualizacion
|
457 |
*
|
458 |
* @return javax.swing.JComboBox
|
459 |
*/
|
460 |
private javax.swing.JComboBox getCbVisualizacion() {
|
461 |
if (cbVisualizacion == null) { |
462 |
// String[] s={"Cuando activo","Siempre"};
|
463 |
cbVisualizacion = new javax.swing.JComboBox();
|
464 |
cbVisualizacion.setSize(220, 20); |
465 |
cbVisualizacion.addItem(PluginServices.getText(this,
|
466 |
"cuando_activo"));
|
467 |
cbVisualizacion.addItem(PluginServices.getText(this, "siempre")); |
468 |
cbVisualizacion.setSelectedIndex(fframeview.getViewing()); |
469 |
cbVisualizacion.setPreferredSize(new java.awt.Dimension(200, 20)); |
470 |
cbVisualizacion.setLocation(100, 180); |
471 |
cbVisualizacion.setEnabled(false);
|
472 |
cbVisualizacion.setVisible(false);
|
473 |
} |
474 |
|
475 |
return cbVisualizacion;
|
476 |
} |
477 |
|
478 |
/**
|
479 |
* This method initializes jButton
|
480 |
*
|
481 |
* @return javax.swing.JButton
|
482 |
*/
|
483 |
private javax.swing.JButton getbAceptar() {
|
484 |
if (bAceptar == null) { |
485 |
bAceptar = new javax.swing.JButton();
|
486 |
bAceptar.setSize(85, 26); |
487 |
bAceptar.setText(PluginServices.getText(this, "Aceptar")); |
488 |
bAceptar.setBounds(new java.awt.Rectangle(109, 223, 85, 26)); |
489 |
bAceptar.addActionListener(new java.awt.event.ActionListener() {
|
490 |
|
491 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
492 |
try {
|
493 |
newFFrameView = (FFrameView) fframeview.clone(); |
494 |
newFFrameView.setBoundBox(FLayoutUtilities.toSheetRect( |
495 |
rect, layoutPanel.getLayoutControl().getAT())); |
496 |
newFFrameView.setRotation(getPRotation().getRotation()); |
497 |
if (m_projectView != null) { |
498 |
newFFrameView.setLinked(getChbEnlaceVivo() |
499 |
.isSelected()); |
500 |
// newFFrameView.setName(m_projectView.getName());
|
501 |
|
502 |
newFFrameView.setTypeScale(getCbEscala() |
503 |
.getSelectedIndex()); |
504 |
newFFrameView.setScale(Double
|
505 |
.parseDouble(getTEscalaNumerica().getText())); |
506 |
newFFrameView.setView(m_projectView); |
507 |
|
508 |
// fframeview.setFMap(m_projectView.getMapContext());
|
509 |
newFFrameView.setExtension(getCbExtension() |
510 |
.getSelectedIndex()); |
511 |
newFFrameView.setViewing(getCbVisualizacion() |
512 |
.getSelectedIndex()); |
513 |
newFFrameView.setQuality(getCbCalidad() |
514 |
.getSelectedIndex()); |
515 |
if (fframeview.getGrid() != null) { |
516 |
((FFrameGrid) fframeview.getGrid()) |
517 |
.setLayout(layoutPanel); |
518 |
((FFrameGrid) fframeview.getGrid()) |
519 |
.setFFrameDependence(newFFrameView); |
520 |
// ((FFrameGrid)grid).setBoundBox();
|
521 |
newFFrameView.setGrid(fframeview.getGrid()); |
522 |
} |
523 |
newFFrameView.showGrid(getChbShowGrid() |
524 |
.isSelected()); |
525 |
newFFrameView.setBoundBox(FLayoutUtilities |
526 |
.toSheetRect(rect, layoutPanel |
527 |
.getLayoutControl().getAT())); |
528 |
|
529 |
/*
|
530 |
* for (int i=0;i<m_layout.getFFrames().size();i++){
|
531 |
* IFFrame
|
532 |
* fframe=(IFFrame)m_layout.getFFrames().get(i);
|
533 |
* if (fframe instanceof FFrameScaleBar){
|
534 |
* if
|
535 |
* (((FFrameScaleBar)fframe).getFFrameView()==fframeview
|
536 |
* ){
|
537 |
* if (getJComboBox().getSelectedIndex()!=0){
|
538 |
* ((FFrameScaleBar)fframe).setIsFixed(true);
|
539 |
* ((FFrameScaleBar)fframe).setScaleView(Long.parseLong
|
540 |
* (getJTextField().getText()));
|
541 |
* }else{
|
542 |
* ((FFrameScaleBar)fframe).setIsFixed(false);
|
543 |
* }
|
544 |
*
|
545 |
* }
|
546 |
* }
|
547 |
*
|
548 |
*
|
549 |
* }
|
550 |
*/
|
551 |
} |
552 |
} catch (CloneNotSupportedException e1) { |
553 |
LOG.error("It is not possible clonate the object", e);
|
554 |
} |
555 |
isAcepted = true;
|
556 |
|
557 |
// }else{
|
558 |
// isAcepted=false;
|
559 |
// }
|
560 |
PluginServices.getMDIManager().closeWindow( |
561 |
FFrameViewDialog.this); |
562 |
} |
563 |
}); |
564 |
} |
565 |
|
566 |
return bAceptar;
|
567 |
} |
568 |
|
569 |
/**
|
570 |
* This method initializes bCancelar
|
571 |
*
|
572 |
* @return javax.swing.JButton
|
573 |
*/
|
574 |
private javax.swing.JButton getBCancelar() {
|
575 |
if (bCancelar == null) { |
576 |
bCancelar = new javax.swing.JButton();
|
577 |
bCancelar.setSize(85, 26); |
578 |
bCancelar.setText(PluginServices.getText(this, "Cancelar")); |
579 |
bCancelar.setBounds(new java.awt.Rectangle(207, 223, 85, 26)); |
580 |
bCancelar.addActionListener(new java.awt.event.ActionListener() {
|
581 |
|
582 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
583 |
newFFrameView = null;
|
584 |
PluginServices.getMDIManager().closeWindow( |
585 |
FFrameViewDialog.this); |
586 |
} |
587 |
}); |
588 |
} |
589 |
|
590 |
return bCancelar;
|
591 |
} |
592 |
|
593 |
/**
|
594 |
* This method initializes lCalidad
|
595 |
*
|
596 |
* @return javax.swing.JLabel
|
597 |
*/
|
598 |
private javax.swing.JLabel getLCalidad() {
|
599 |
if (lCalidad == null) { |
600 |
lCalidad = new javax.swing.JLabel();
|
601 |
lCalidad.setSize(86, 16); |
602 |
lCalidad.setText(PluginServices.getText(this, "calidad")); |
603 |
lCalidad.setLocation(10, 155); |
604 |
} |
605 |
|
606 |
return lCalidad;
|
607 |
} |
608 |
|
609 |
/**
|
610 |
* This method initializes cbCalidad
|
611 |
*
|
612 |
* @return javax.swing.JComboBox
|
613 |
*/
|
614 |
private javax.swing.JComboBox getCbCalidad() {
|
615 |
if (cbCalidad == null) { |
616 |
// String[] s={"Presentaci?n","Borrador"};
|
617 |
cbCalidad = new javax.swing.JComboBox();
|
618 |
cbCalidad.setSize(220, 20); |
619 |
cbCalidad.addItem(PluginServices.getText(this, "presentacion")); |
620 |
cbCalidad.addItem(PluginServices.getText(this, "borrador")); |
621 |
cbCalidad.setSelectedIndex(fframeview.getQuality()); |
622 |
cbCalidad.setPreferredSize(new java.awt.Dimension(200, 20)); |
623 |
cbCalidad.setLocation(100, 155); |
624 |
} |
625 |
|
626 |
return cbCalidad;
|
627 |
} |
628 |
|
629 |
/*
|
630 |
* (non-Javadoc)
|
631 |
*
|
632 |
* @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
|
633 |
*/
|
634 |
public WindowInfo getWindowInfo() {
|
635 |
WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG);
|
636 |
|
637 |
// vi.setResizable(false);
|
638 |
m_viewinfo.setTitle(PluginServices.getText(this,
|
639 |
"propiedades_marco_vista"));
|
640 |
|
641 |
return m_viewinfo;
|
642 |
} |
643 |
|
644 |
/**
|
645 |
* @see org.gvsig.app.project.documents.layout.fframes.gui.dialogs.IFFrameDialog#getIsAcepted()
|
646 |
*/
|
647 |
public boolean getIsAcepted() { |
648 |
return isAcepted;
|
649 |
} |
650 |
|
651 |
/**
|
652 |
* @see com.iver.mdiApp.ui.MDIManager.IWindow#windowActivated()
|
653 |
*/
|
654 |
public void viewActivated() { |
655 |
} |
656 |
|
657 |
/**
|
658 |
* This method initializes rotation
|
659 |
*
|
660 |
* @return javax.swing.JPanel
|
661 |
*/
|
662 |
private JPRotation getPRotation() {
|
663 |
if (rotation == null) { |
664 |
rotation = new JPRotation();
|
665 |
rotation.setBounds(330, 90, 120, 120); |
666 |
} |
667 |
return rotation;
|
668 |
} |
669 |
|
670 |
public IFFrame getFFrame() {
|
671 |
return newFFrameView;
|
672 |
} |
673 |
|
674 |
/**
|
675 |
* This method initializes bGrid
|
676 |
*
|
677 |
* @return javax.swing.JButton
|
678 |
*/
|
679 |
private JButton getBGrid() { |
680 |
if (bGrid == null) { |
681 |
bGrid = new JButton(); |
682 |
bGrid.setBounds(new java.awt.Rectangle(207, 186, 85, 26)); |
683 |
bGrid.setText(PluginServices.getText(this, "configurar")); |
684 |
bGrid.addActionListener(new java.awt.event.ActionListener() {
|
685 |
|
686 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
687 |
FFrameGridFactory gridFactory = new FFrameGridFactory();
|
688 |
FFrameGrid fframe = null;
|
689 |
|
690 |
if (fframeview.getGrid() != null) { |
691 |
fframe = (FFrameGrid) fframeview.getGrid(); |
692 |
} else {
|
693 |
fframe = (FFrameGrid) gridFactory.createFrame(); |
694 |
fframe.setLayout(layoutPanel); |
695 |
fframe.setFFrameDependence(fframeview); |
696 |
} |
697 |
|
698 |
FFrameGridDialog fframedialog = |
699 |
new FFrameGridDialog(layoutPanel, fframe, fframeview);
|
700 |
// fframedialog.setFFrameView(fframeview);
|
701 |
if (fframedialog != null) { |
702 |
PluginServices.getMDIManager().addWindow(fframedialog); |
703 |
} |
704 |
IFFrame newFrame = fframedialog.getFFrame(); |
705 |
if (newFrame != null) { |
706 |
fframeview.setGrid(newFrame); |
707 |
} |
708 |
} |
709 |
}); |
710 |
} |
711 |
return bGrid;
|
712 |
} |
713 |
|
714 |
/**
|
715 |
* This method initializes chbShowGrid
|
716 |
*
|
717 |
* @return javax.swing.JCheckBox
|
718 |
*/
|
719 |
private JCheckBox getChbShowGrid() { |
720 |
if (chbShowGrid == null) { |
721 |
chbShowGrid = new JCheckBox(); |
722 |
chbShowGrid.setBounds(new java.awt.Rectangle(13, 191, 181, 21)); |
723 |
chbShowGrid.setSelected(fframeview.isShowGrid()); |
724 |
chbShowGrid.setText(PluginServices.getText(this, "Show_grid")); |
725 |
} |
726 |
return chbShowGrid;
|
727 |
} |
728 |
|
729 |
public Object getWindowProfile() { |
730 |
return WindowInfo.DIALOG_PROFILE;
|
731 |
} |
732 |
|
733 |
} // @jve:decl-index=0:visual-constraint="10,10"
|