Statistics
| Revision:

svn-document-layout / branches / usability_v2 / 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 @ 141

History | View | Annotate | Download (25.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
import javax.swing.JOptionPane;
31

    
32
import org.gvsig.andami.PluginServices;
33
import org.gvsig.andami.messages.NotificationManager;
34
import org.gvsig.andami.ui.mdiManager.WindowInfo;
35
import org.gvsig.app.ApplicationLocator;
36
import org.gvsig.app.project.ProjectManager;
37
import org.gvsig.app.project.documents.layout.FLayoutUtilities;
38
import org.gvsig.app.project.documents.layout.LayoutManager;
39
import org.gvsig.app.project.documents.layout.fframes.FFrameGrid;
40
import org.gvsig.app.project.documents.layout.fframes.FFrameView;
41
import org.gvsig.app.project.documents.layout.fframes.IFFrame;
42
import org.gvsig.app.project.documents.layout.fframes.ListViewModel;
43
import org.gvsig.app.project.documents.layout.fframes.gui.JPRotation;
44
import org.gvsig.app.project.documents.layout.gui.LayoutPanel;
45
import org.gvsig.app.project.documents.view.DefaultViewDocument;
46
import org.gvsig.fmap.mapcontext.ViewPort;
47
import org.gvsig.i18n.Messages;
48

    
49
/**
50
 * Di?logo para a?adir una vista al Layout.
51
 * 
52
 * @author Vicente Caballero Navarro
53
 */
54
public class FFrameViewDialog extends AbstractFFrameDialog implements
55
    IFFrameDialog {
56

    
57
    private static final long serialVersionUID = -7223804566537544559L;
58
    
59
    private final LayoutManager layoutManager;
60
    
61
    private javax.swing.JPanel jContentPane = null;
62
    private javax.swing.JLabel lVistas = null;
63
    private javax.swing.JScrollPane jScrollPane = null;
64
    private javax.swing.JList liVistas = null; // @jve:visual-info decl-index=0
65
                                               // visual-constraint="98,-3"
66
    private javax.swing.JCheckBox chbEnlaceVivo = null;
67
    private javax.swing.JLabel lEscala = null;
68
    private javax.swing.JComboBox cbEscala = null;
69
    private javax.swing.JLabel lEscalaNumerica = null;
70
    private javax.swing.JTextField tEscalaNumerica = null;
71
    private javax.swing.JLabel lExtension = null;
72
    private javax.swing.JComboBox cbExtension = null;
73
    private javax.swing.JLabel lVisualizacion = null;
74
    private javax.swing.JComboBox cbVisualizacion = null;
75
    private javax.swing.JButton bAceptar = null;
76
    private javax.swing.JButton bCancelar = null;
77
    private javax.swing.JLabel lCalidad = null;
78
    private javax.swing.JComboBox cbCalidad = null;
79
    private DefaultViewDocument m_projectView = null;
80
    private Rectangle2D rect = new Rectangle2D.Double();
81
    private FFrameView fframeview = null; // new FFrameView();
82
    private boolean isAcepted = false;
83
    private JPRotation rotation = null;
84
    private FFrameView newFFrameView = null;
85
    private javax.swing.JButton bGrid = null;
86
    private javax.swing.JCheckBox chbShowGrid = null;
87

    
88
    /**
89
     * This is the default constructor
90
     * 
91
     * @param layoutPanel
92
     *            Referencia al Layout.
93
     * @param fframe
94
     *            Referencia al fframe vista.
95
     */
96
    public FFrameViewDialog(LayoutPanel layoutPanel, IFFrame frame) {
97
        super(layoutPanel, frame);
98
        fframeview = (FFrameView) frame;
99
        initialize();
100
        layoutManager = (LayoutManager) ProjectManager.getInstance()
101
            .getDocumentManager("project.document.layout");
102
    }
103

    
104
    /**
105
     * This method initializes this
106
     */
107
    private void initialize() {
108
        this.setLayout(null);
109
        this.add(getJContentPane(), null);
110
        this.setSize(478, 269);
111

    
112
        if (fframeview.getTypeScale() == 0 || fframeview.getTypeScale() == 1) {
113
            getTEscalaNumerica().setEnabled(false);
114
        } else {
115
            getTEscalaNumerica().setEnabled(true);
116
        }
117
        getPRotation().setRotation(fframeview.getRotation());
118
    }
119

    
120
    /**
121
     * Inserta el rect?ngulo que ocupar? el fframe vista.
122
     * 
123
     * @param r
124
     *            Rect?ngulo.
125
     */
126
    public void setRectangle(Rectangle2D r) {
127
        rect.setRect(r);
128
    }
129

    
130
    /**
131
     * This method initializes jContentPane
132
     * 
133
     * @return javax.swing.JPanel
134
     */
135
    private javax.swing.JPanel getJContentPane() {
136
        if (jContentPane == null) {
137
            jContentPane = new javax.swing.JPanel();
138
            jContentPane.setLayout(null);
139
            jContentPane.add(getLVistas(), null);
140
            jContentPane.add(getJScrollPane(), null);
141
            jContentPane.add(getChbEnlaceVivo(), null);
142
            jContentPane.add(getLEscala(), null);
143
            jContentPane.add(getCbEscala(), null);
144
            jContentPane.add(getLEscalaNumerica(), null);
145
            jContentPane.add(getTEscalaNumerica(), null);
146
            jContentPane.add(getLExtension(), null);
147
            jContentPane.add(getCbExtension(), null);
148
            jContentPane.add(getLCalidad(), null);
149
            jContentPane.add(getCbCalidad(), null);
150
            jContentPane.add(getbAceptar(), null);
151
            jContentPane.add(getBCancelar(), null);
152
            jContentPane.setSize(475, 264);
153
            jContentPane.setPreferredSize(new java.awt.Dimension(60, 60));
154
            jContentPane.setLocation(0, 0);
155
            jContentPane.add(getPRotation(), null);
156
            jContentPane.add(getBGrid(), null);
157
            jContentPane.add(getChbShowGrid(), null);
158
        }
159

    
160
        return jContentPane;
161
    }
162

    
163
    /**
164
     * This method initializes lVistas
165
     * 
166
     * @return javax.swing.JLabel
167
     */
168
    private javax.swing.JLabel getLVistas() {
169
        if (lVistas == null) {
170
            lVistas = new javax.swing.JLabel();
171
            lVistas.setSize(85, 19);
172
            lVistas.setText(PluginServices.getText(this, "Vista"));
173
            lVistas.setLocation(10, 10);
174
        }
175

    
176
        return lVistas;
177
    }
178

    
179
    /**
180
     * This method initializes jScrollPane
181
     * 
182
     * @return javax.swing.JScrollPane
183
     */
184
    private javax.swing.JScrollPane getJScrollPane() {
185
        if (jScrollPane == null) {
186
            jScrollPane = new javax.swing.JScrollPane();
187
            jScrollPane.setViewportView(getLiVistas());
188
            jScrollPane.setBounds(99, 8, 224, 64);
189
            jScrollPane.setPreferredSize(new java.awt.Dimension(250, 60));
190
        }
191

    
192
        return jScrollPane;
193
    }
194

    
195
    /**
196
     * This method initializes liVistas
197
     * 
198
     * @return javax.swing.JList
199
     */
200
    private javax.swing.JList getLiVistas() {
201
        if (liVistas == null) {
202
            ListViewModel listmodel = new ListViewModel();
203
            
204
            if (listmodel.addViews()) {
205
               JOptionPane.showMessageDialog(
206
                   ApplicationLocator.getManager().getRootComponent(),
207
                   Messages.getText("_Some_views_excluded_from_list_because_have_editing_layers"),
208
                   Messages.getText("propiedades_marco_vista"),
209
                   JOptionPane.WARNING_MESSAGE); 
210
            }
211
            
212
            liVistas = new javax.swing.JList();
213
            liVistas.setModel(listmodel);
214
            for (int i = 0; i < liVistas.getModel().getSize(); i++) {
215
                if (fframeview.getMapContext() != null) {
216

    
217
                    DefaultViewDocument pvaux =
218
                        (DefaultViewDocument) liVistas.getModel().getElementAt(
219
                            i);
220

    
221
                    if (pvaux.getMapContext()
222
                        .equals(fframeview.getMapContext())) {
223
                        liVistas.setSelectedIndex(i);
224
                        m_projectView =
225
                            (DefaultViewDocument) liVistas.getModel()
226
                                .getElementAt(i);
227
                    }
228
                }
229
            }
230

    
231
            liVistas
232
                .addListSelectionListener(new javax.swing.event.ListSelectionListener() {
233

    
234
                    private int selectIndex = -1;
235
                    private Rectangle2D boundBox;
236

    
237
                    public void valueChanged(
238
                        javax.swing.event.ListSelectionEvent e) {
239
                        int selectInt =
240
                            ((JList) e.getSource()).getSelectedIndex();
241
                        if (selectInt != selectIndex) {
242
                            selectIndex = selectInt;
243
                            if (selectIndex == -1) {
244
                                return;
245
                            }
246
                            m_projectView =
247
                                (DefaultViewDocument) liVistas.getModel()
248
                                    .getElementAt(selectInt);
249

    
250
                            getCbEscala().setSelectedItem(
251
                                PluginServices.getText(this, "automatico"));
252
                            boundBox =
253
                                FLayoutUtilities.toSheetRect(rect, layoutPanel
254
                                    .getLayoutControl().getAT());
255
                            // fframeview.setBoundBox(FLayoutUtilities.toSheetRect(
256
                            // rect, m_layout.getAT()));
257

    
258
                            // fframeview.setView(m_projectView);
259
                            //
260
                            // fframeview.setMapUnits(m_projectView.getMapContext()
261
                            // .getViewPort()
262
                            // .getMapUnits());
263
                            ViewPort vp;
264
                            try {
265
                                vp =
266
                                    (ViewPort) m_projectView.getMapContext()
267
                                        .getViewPort().clone();
268
                                vp.setImageSize(new Dimension((int) rect
269
                                    .getWidth(), (int) rect.getHeight()));
270
                                getTEscalaNumerica().setText(
271
                                    String.valueOf(FLayoutUtilities
272
                                        .getScaleView(vp, boundBox.getWidth(),
273
                                            FLayoutUtilities.fromSheetDistance(
274
                                                boundBox.getWidth(),
275
                                                layoutPanel.getLayoutControl()
276
                                                    .getAT()))));
277
                            } catch (CloneNotSupportedException e1) {
278
                                NotificationManager.addError("Excepci?n :", e1);
279
                            }
280
                            // getTEscalaNumerica().setText(String.valueOf(
281
                            // fframeview.getScale()));
282
                        }
283
                    }
284
                });
285
        }
286

    
287
        return liVistas;
288
    }
289

    
290
    /**
291
     * This method initializes chbEnlaceVivo
292
     * 
293
     * @return javax.swing.JCheckBox
294
     */
295
    private javax.swing.JCheckBox getChbEnlaceVivo() {
296
        if (chbEnlaceVivo == null) {
297
            chbEnlaceVivo = new javax.swing.JCheckBox();
298
            chbEnlaceVivo.setSize(88, 24);
299
            chbEnlaceVivo.setText(PluginServices.getText(this, "enlace_vivo"));
300
            chbEnlaceVivo.setSelected(fframeview.getLinked());
301
            chbEnlaceVivo.setLocation(10, 75);
302
            chbEnlaceVivo.setEnabled(true);
303
            chbEnlaceVivo
304
                .addActionListener(new java.awt.event.ActionListener() {
305

    
306
                    public void actionPerformed(java.awt.event.ActionEvent e) {
307
                        System.out.println("actionPerformed()"); // TODO
308
                                                                 // Auto-generated
309
                                                                 // Event stub
310
                                                                 // actionPerformed()
311
                    }
312
                });
313
        }
314

    
315
        return chbEnlaceVivo;
316
    }
317

    
318
    /**
319
     * This method initializes lEscala
320
     * 
321
     * @return javax.swing.JLabel
322
     */
323
    private javax.swing.JLabel getLEscala() {
324
        if (lEscala == null) {
325
            lEscala = new javax.swing.JLabel();
326
            lEscala.setSize(86, 16);
327
            lEscala.setText(PluginServices.getText(this, "escala"));
328
            lEscala.setLocation(10, 105);
329
        }
330

    
331
        return lEscala;
332
    }
333

    
334
    /**
335
     * This method initializes cbEscala
336
     * 
337
     * @return javax.swing.JComboBox
338
     */
339
    private javax.swing.JComboBox getCbEscala() {
340
        if (cbEscala == null) {
341
            // String[]
342
            // s={"Autom?tico","Conservar escala de visualizaci?n","Escala especificada por el usuario"};
343
            cbEscala = new javax.swing.JComboBox();
344
            cbEscala.setSize(220, 20);
345
            cbEscala.addItem(PluginServices.getText(this, "automatico"));
346
            cbEscala.addItem(PluginServices.getText(this,
347
                "conservar_escala_visualizacion"));
348
            cbEscala.addItem(PluginServices.getText(this, "escala_usuario"));
349
            cbEscala.setSelectedIndex(fframeview.getTypeScale());
350

    
351
            if (fframeview.getTypeScale() == 0
352
                || fframeview.getTypeScale() == 1) {
353
                getTEscalaNumerica().setEnabled(false);
354
            } else {
355
                getTEscalaNumerica().setEnabled(true);
356
            }
357

    
358
            cbEscala.setPreferredSize(new java.awt.Dimension(200, 20));
359
            cbEscala.setLocation(100, 105);
360
            cbEscala.addActionListener(new java.awt.event.ActionListener() {
361

    
362
                public void actionPerformed(java.awt.event.ActionEvent e) {
363
                    if (cbEscala.getSelectedIndex() == 2) {
364
                        getTEscalaNumerica().setEnabled(true);
365
                    } else {
366
                        getTEscalaNumerica().setEnabled(false);
367
                    }
368
                }
369
            });
370
        }
371

    
372
        return cbEscala;
373
    }
374

    
375
    /**
376
     * This method initializes lEscalaNumerica
377
     * 
378
     * @return javax.swing.JLabel
379
     */
380
    private javax.swing.JLabel getLEscalaNumerica() {
381
        if (lEscalaNumerica == null) {
382
            lEscalaNumerica = new javax.swing.JLabel();
383
            lEscalaNumerica.setSize(86, 16);
384
            lEscalaNumerica.setText("1:");
385
            lEscalaNumerica.setLocation(10, 130);
386
        }
387

    
388
        return lEscalaNumerica;
389
    }
390

    
391
    /**
392
     * This method initializes tEscalaNumerica
393
     * 
394
     * @return javax.swing.JTextField
395
     */
396
    private javax.swing.JTextField getTEscalaNumerica() {
397
        if (tEscalaNumerica == null) {
398
            tEscalaNumerica = new javax.swing.JTextField();
399
            tEscalaNumerica.setSize(220, 20);
400
            tEscalaNumerica.setPreferredSize(new java.awt.Dimension(200, 20));
401

    
402
            if (m_projectView != null) {
403
                tEscalaNumerica.setText(String.valueOf(fframeview.getScale()));
404
            }
405
            tEscalaNumerica.setLocation(100, 130);
406
            tEscalaNumerica.setEnabled(false);
407
        }
408

    
409
        return tEscalaNumerica;
410
    }
411

    
412
    /**
413
     * This method initializes lExtension
414
     * 
415
     * @return javax.swing.JLabel
416
     */
417
    private javax.swing.JLabel getLExtension() {
418
        if (lExtension == null) {
419
            lExtension = new javax.swing.JLabel();
420
            lExtension.setSize(86, 16);
421
            lExtension.setText(PluginServices.getText(this, "extension"));
422
            lExtension.setLocation(10, 155);
423
            lExtension.setVisible(false);
424
        }
425

    
426
        return lExtension;
427
    }
428

    
429
    /**
430
     * This method initializes cbExtension
431
     * 
432
     * @return javax.swing.JComboBox
433
     */
434
    private javax.swing.JComboBox getCbExtension() {
435
        if (cbExtension == null) {
436
            // String[] s={"Rellenar marco de la vista","Recorte a vista"};
437
            cbExtension = new javax.swing.JComboBox();
438
            cbExtension.setSize(220, 20);
439
            cbExtension.addItem(PluginServices.getText(this,
440
                "rellenar_marco_vista"));
441
            cbExtension.addItem(PluginServices.getText(this, "recorte_vista"));
442

    
443
            cbExtension.setPreferredSize(new java.awt.Dimension(200, 20));
444
            cbExtension.setLocation(100, 155);
445
            cbExtension.setEnabled(false);
446
            cbExtension.setVisible(false);
447
        }
448

    
449
        return cbExtension;
450
    }
451

    
452
    /**
453
     * This method initializes jButton
454
     * 
455
     * @return javax.swing.JButton
456
     */
457
    private javax.swing.JButton getbAceptar() {
458
        if (bAceptar == null) {
459
            bAceptar = new javax.swing.JButton();
460
            bAceptar.setSize(85, 26);
461
            bAceptar.setText(PluginServices.getText(this, "Aceptar"));
462
            bAceptar.setBounds(new java.awt.Rectangle(109, 223, 85, 26));
463
            bAceptar.addActionListener(new java.awt.event.ActionListener() {
464

    
465
                public void actionPerformed(java.awt.event.ActionEvent e) {
466
                    try {
467
                        newFFrameView = (FFrameView) fframeview.clone();
468
                        newFFrameView.setBoundBox(FLayoutUtilities.toSheetRect(
469
                            rect, layoutPanel.getLayoutControl().getAT()));
470
                        newFFrameView.setRotation(getPRotation().getRotation());
471
                        if (m_projectView != null) {
472
                            newFFrameView.setLinked(getChbEnlaceVivo()
473
                                .isSelected());
474
                            // newFFrameView.setName(m_projectView.getName());
475

    
476
                            newFFrameView.setTypeScale(getCbEscala()
477
                                .getSelectedIndex());
478
                            newFFrameView.setScale(Double
479
                                .parseDouble(getTEscalaNumerica().getText()));
480
                            newFFrameView.setView(m_projectView);
481

    
482
                            // fframeview.setFMap(m_projectView.getMapContext());
483
                            newFFrameView.setExtension(getCbExtension()
484
                                .getSelectedIndex());
485
                            newFFrameView.setQuality(getCbCalidad()
486
                                .getSelectedIndex());
487
                            if (fframeview.getGrid() != null) {                             
488
                                ((FFrameGrid) fframeview.getGrid())
489
                                    .setFFrameDependence(newFFrameView);
490
                                // ((FFrameGrid)grid).setBoundBox();
491
                                newFFrameView.setGrid(fframeview.getGrid());
492
                            }
493
                            newFFrameView.showGrid(getChbShowGrid()
494
                                .isSelected());
495
                            newFFrameView.setBoundBox(FLayoutUtilities
496
                                .toSheetRect(rect, layoutPanel
497
                                    .getLayoutControl().getAT()));
498

    
499
                            /*
500
                             * for (int i=0;i<m_layout.getFFrames().size();i++){
501
                             * IFFrame
502
                             * fframe=(IFFrame)m_layout.getFFrames().get(i);
503
                             * if (fframe instanceof FFrameScaleBar){
504
                             * if
505
                             * (((FFrameScaleBar)fframe).getFFrameView()==fframeview
506
                             * ){
507
                             * if (getJComboBox().getSelectedIndex()!=0){
508
                             * ((FFrameScaleBar)fframe).setIsFixed(true);
509
                             * ((FFrameScaleBar)fframe).setScaleView(Long.parseLong
510
                             * (getJTextField().getText()));
511
                             * }else{
512
                             * ((FFrameScaleBar)fframe).setIsFixed(false);
513
                             * }
514
                             * 
515
                             * }
516
                             * }
517
                             * 
518
                             * 
519
                             * }
520
                             */
521
                        }
522
                    } catch (CloneNotSupportedException e1) {
523
                        LOG.error("It is not possible clonate the object", e);
524
                    }
525
                    isAcepted = true;
526

    
527
                    // }else{
528
                    // isAcepted=false;
529
                    // }
530
                    PluginServices.getMDIManager().closeWindow(
531
                        FFrameViewDialog.this);
532
                }
533
            });
534
        }
535

    
536
        return bAceptar;
537
    }
538

    
539
    /**
540
     * This method initializes bCancelar
541
     * 
542
     * @return javax.swing.JButton
543
     */
544
    private javax.swing.JButton getBCancelar() {
545
        if (bCancelar == null) {
546
            bCancelar = new javax.swing.JButton();
547
            bCancelar.setSize(85, 26);
548
            bCancelar.setText(PluginServices.getText(this, "Cancelar"));
549
            bCancelar.setBounds(new java.awt.Rectangle(207, 223, 85, 26));
550
            bCancelar.addActionListener(new java.awt.event.ActionListener() {
551

    
552
                public void actionPerformed(java.awt.event.ActionEvent e) {
553
                    newFFrameView = null;
554
                    PluginServices.getMDIManager().closeWindow(
555
                        FFrameViewDialog.this);
556
                }
557
            });
558
        }
559

    
560
        return bCancelar;
561
    }
562

    
563
    /**
564
     * This method initializes lCalidad
565
     * 
566
     * @return javax.swing.JLabel
567
     */
568
    private javax.swing.JLabel getLCalidad() {
569
        if (lCalidad == null) {
570
            lCalidad = new javax.swing.JLabel();
571
            lCalidad.setSize(86, 16);
572
            lCalidad.setText(PluginServices.getText(this, "calidad"));
573
            lCalidad.setLocation(10, 155);
574
        }
575

    
576
        return lCalidad;
577
    }
578

    
579
    /**
580
     * This method initializes cbCalidad
581
     * 
582
     * @return javax.swing.JComboBox
583
     */
584
    private javax.swing.JComboBox getCbCalidad() {
585
        if (cbCalidad == null) {
586
            // String[] s={"Presentaci?n","Borrador"};
587
            cbCalidad = new javax.swing.JComboBox();
588
            cbCalidad.setSize(220, 20);
589
            cbCalidad.addItem(PluginServices.getText(this, "presentacion"));
590
            cbCalidad.addItem(PluginServices.getText(this, "borrador"));
591
            cbCalidad.setSelectedIndex(fframeview.getQuality());
592
            cbCalidad.setPreferredSize(new java.awt.Dimension(200, 20));
593
            cbCalidad.setLocation(100, 155);
594
        }
595

    
596
        return cbCalidad;
597
    }
598

    
599
    /*
600
     * (non-Javadoc)
601
     * 
602
     * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
603
     */
604
    public WindowInfo getWindowInfo() {
605
        WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG);
606

    
607
        // vi.setResizable(false);
608
        m_viewinfo.setTitle(PluginServices.getText(this,
609
            "propiedades_marco_vista"));
610

    
611
        return m_viewinfo;
612
    }
613

    
614
    /**
615
     * @see org.gvsig.app.project.documents.layout.fframes.gui.dialogs.IFFrameDialog#getIsAcepted()
616
     */
617
    public boolean getIsAcepted() {
618
        return isAcepted;
619
    }
620

    
621
    /**
622
     * @see com.iver.mdiApp.ui.MDIManager.IWindow#windowActivated()
623
     */
624
    public void viewActivated() {
625
    }
626

    
627
    /**
628
     * This method initializes rotation
629
     * 
630
     * @return javax.swing.JPanel
631
     */
632
    private JPRotation getPRotation() {
633
        if (rotation == null) {
634
            rotation = new JPRotation();
635
            rotation.setBounds(330, 90, 120, 120);
636
        }
637
        return rotation;
638
    }
639

    
640
    public IFFrame getFFrame() {
641
        return newFFrameView;
642
    }
643

    
644
    /**
645
     * This method initializes bGrid
646
     * 
647
     * @return javax.swing.JButton
648
     */
649
    private JButton getBGrid() {
650
        if (bGrid == null) {
651
            bGrid = new JButton();
652
            bGrid.setBounds(new java.awt.Rectangle(207, 186, 85, 26));
653
            bGrid.setText(PluginServices.getText(this, "configurar"));
654
            bGrid.addActionListener(new java.awt.event.ActionListener() {
655

    
656
                public void actionPerformed(java.awt.event.ActionEvent e) {                
657
                    FFrameGrid fframeGrid = null;
658

    
659
                    if (fframeview.getGrid() != null) {
660
                        fframeGrid = (FFrameGrid) fframeview.getGrid();
661
                    } else {                       
662
                        fframeGrid = (FFrameGrid) layoutManager.createFrame(FFrameGrid.PERSISTENCE_DEFINITION_NAME);                
663
                        fframeGrid.setFFrameDependence(fframeview);             
664
                    }
665

    
666
                    FFrameGridDialog fframeGridDialog = 
667
                        (FFrameGridDialog)layoutManager.createFFrameDialog(fframeGrid, layoutPanel);
668
                    fframeGridDialog.setFFrameView(fframeview);
669
                        
670
   
671
                    if (fframeGridDialog != null) {
672
                        PluginServices.getMDIManager().addWindow(fframeGridDialog);
673
                    }
674
                    IFFrame newFrame = fframeGridDialog.getFFrame();
675
                    if (newFrame != null) {
676
                        fframeview.setGrid(newFrame);
677
                    }
678
                }
679
            });
680
        }
681
        return bGrid;
682
    }
683

    
684
    /**
685
     * This method initializes chbShowGrid
686
     * 
687
     * @return javax.swing.JCheckBox
688
     */
689
    private JCheckBox getChbShowGrid() {
690
        if (chbShowGrid == null) {
691
            chbShowGrid = new JCheckBox();
692
            chbShowGrid.setBounds(new java.awt.Rectangle(13, 191, 181, 21));
693
            chbShowGrid.setSelected(fframeview.isShowGrid());
694
            chbShowGrid.setText(PluginServices.getText(this, "Show_grid"));
695
        }
696
        return chbShowGrid;
697
    }
698

    
699
    public Object getWindowProfile() {
700
        return WindowInfo.DIALOG_PROFILE;
701
    }
702

    
703
} // @jve:decl-index=0:visual-constraint="10,10"