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 @ 142

History | View | Annotate | Download (24.5 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.IFFrameUseFMap;
43
import org.gvsig.app.project.documents.layout.fframes.ListViewModel;
44
import org.gvsig.app.project.documents.layout.fframes.gui.JPRotation;
45
import org.gvsig.app.project.documents.layout.gui.LayoutPanel;
46
import org.gvsig.app.project.documents.view.DefaultViewDocument;
47
import org.gvsig.fmap.mapcontext.ViewPort;
48
import org.gvsig.i18n.Messages;
49

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

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

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

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

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

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

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

    
161
        return jContentPane;
162
    }
163

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

    
177
        return lVistas;
178
    }
179

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

    
193
        return jScrollPane;
194
    }
195

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

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

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

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

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

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

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

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

    
288
        return liVistas;
289
    }
290

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

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

    
316
        return chbEnlaceVivo;
317
    }
318

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

    
332
        return lEscala;
333
    }
334

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

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

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

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

    
373
        return cbEscala;
374
    }
375

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

    
389
        return lEscalaNumerica;
390
    }
391

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

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

    
410
        return tEscalaNumerica;
411
    }
412

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

    
427
        return lExtension;
428
    }
429

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

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

    
450
        return cbExtension;
451
    }
452

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

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

    
477
                            newFFrameView.setTypeScale(getCbEscala()
478
                                .getSelectedIndex());
479
                            if (newFFrameView.getTypeScale()!=IFFrameUseFMap.AUTOMATICO){
480
                                    newFFrameView.setScale(Double
481
                                                    .parseDouble(getTEscalaNumerica().getText()));
482
                            }
483
                            newFFrameView.setView(m_projectView);
484
                            newFFrameView.setQuality(getCbCalidad()
485
                                .getSelectedIndex());
486
                            if (fframeview.getGrid() != null) {                             
487
                                ((FFrameGrid) fframeview.getGrid())
488
                                    .setFFrameDependence(newFFrameView);
489
                                newFFrameView.setGrid(fframeview.getGrid());
490
                            }
491
                            newFFrameView.showGrid(getChbShowGrid()
492
                                .isSelected());
493
                            newFFrameView.setBoundBox(FLayoutUtilities
494
                                .toSheetRect(rect, layoutPanel
495
                                    .getLayoutControl().getAT()));
496

    
497
                        }
498
                    } catch (CloneNotSupportedException e1) {
499
                        LOG.error("It is not possible clonate the object", e);
500
                    }
501
                    isAcepted = true;
502
                    PluginServices.getMDIManager().closeWindow(
503
                        FFrameViewDialog.this);
504
                }
505
            });
506
        }
507

    
508
        return bAceptar;
509
    }
510

    
511
    /**
512
     * This method initializes bCancelar
513
     * 
514
     * @return javax.swing.JButton
515
     */
516
    private javax.swing.JButton getBCancelar() {
517
        if (bCancelar == null) {
518
            bCancelar = new javax.swing.JButton();
519
            bCancelar.setSize(85, 26);
520
            bCancelar.setText(PluginServices.getText(this, "Cancelar"));
521
            bCancelar.setBounds(new java.awt.Rectangle(207, 223, 85, 26));
522
            bCancelar.addActionListener(new java.awt.event.ActionListener() {
523

    
524
                public void actionPerformed(java.awt.event.ActionEvent e) {
525
                    newFFrameView = null;
526
                    PluginServices.getMDIManager().closeWindow(
527
                        FFrameViewDialog.this);
528
                }
529
            });
530
        }
531

    
532
        return bCancelar;
533
    }
534

    
535
    /**
536
     * This method initializes lCalidad
537
     * 
538
     * @return javax.swing.JLabel
539
     */
540
    private javax.swing.JLabel getLCalidad() {
541
        if (lCalidad == null) {
542
            lCalidad = new javax.swing.JLabel();
543
            lCalidad.setSize(86, 16);
544
            lCalidad.setText(PluginServices.getText(this, "calidad"));
545
            lCalidad.setLocation(10, 155);
546
        }
547

    
548
        return lCalidad;
549
    }
550

    
551
    /**
552
     * This method initializes cbCalidad
553
     * 
554
     * @return javax.swing.JComboBox
555
     */
556
    private javax.swing.JComboBox getCbCalidad() {
557
        if (cbCalidad == null) {
558
            // String[] s={"Presentaci?n","Borrador"};
559
            cbCalidad = new javax.swing.JComboBox();
560
            cbCalidad.setSize(220, 20);
561
            cbCalidad.addItem(PluginServices.getText(this, "presentacion"));
562
            cbCalidad.addItem(PluginServices.getText(this, "borrador"));
563
            cbCalidad.setSelectedIndex(fframeview.getQuality());
564
            cbCalidad.setPreferredSize(new java.awt.Dimension(200, 20));
565
            cbCalidad.setLocation(100, 155);
566
        }
567

    
568
        return cbCalidad;
569
    }
570

    
571
    /*
572
     * (non-Javadoc)
573
     * 
574
     * @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
575
     */
576
    public WindowInfo getWindowInfo() {
577
        WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG);
578

    
579
        // vi.setResizable(false);
580
        m_viewinfo.setTitle(PluginServices.getText(this,
581
            "propiedades_marco_vista"));
582

    
583
        return m_viewinfo;
584
    }
585

    
586
    /**
587
     * @see org.gvsig.app.project.documents.layout.fframes.gui.dialogs.IFFrameDialog#getIsAcepted()
588
     */
589
    public boolean getIsAcepted() {
590
        return isAcepted;
591
    }
592

    
593
    /**
594
     * @see com.iver.mdiApp.ui.MDIManager.IWindow#windowActivated()
595
     */
596
    public void viewActivated() {
597
    }
598

    
599
    /**
600
     * This method initializes rotation
601
     * 
602
     * @return javax.swing.JPanel
603
     */
604
    private JPRotation getPRotation() {
605
        if (rotation == null) {
606
            rotation = new JPRotation();
607
            rotation.setBounds(330, 90, 120, 120);
608
        }
609
        return rotation;
610
    }
611

    
612
    public IFFrame getFFrame() {
613
        return newFFrameView;
614
    }
615

    
616
    /**
617
     * This method initializes bGrid
618
     * 
619
     * @return javax.swing.JButton
620
     */
621
    private JButton getBGrid() {
622
        if (bGrid == null) {
623
            bGrid = new JButton();
624
            bGrid.setBounds(new java.awt.Rectangle(207, 186, 85, 26));
625
            bGrid.setText(PluginServices.getText(this, "configurar"));
626
            bGrid.addActionListener(new java.awt.event.ActionListener() {
627

    
628
                public void actionPerformed(java.awt.event.ActionEvent e) {                
629
                    FFrameGrid fframeGrid = null;
630

    
631
                    if (fframeview.getGrid() != null) {
632
                        fframeGrid = (FFrameGrid) fframeview.getGrid();
633
                    } else {                       
634
                        fframeGrid = (FFrameGrid) layoutManager.createFrame(FFrameGrid.PERSISTENCE_DEFINITION_NAME);                
635
                        fframeGrid.setFFrameDependence(fframeview);             
636
                    }
637

    
638
                    FFrameGridDialog fframeGridDialog = 
639
                        (FFrameGridDialog)layoutManager.createFFrameDialog(fframeGrid, layoutPanel);
640
                    fframeGridDialog.setFFrameView(fframeview);
641
                        
642
   
643
                    if (fframeGridDialog != null) {
644
                        PluginServices.getMDIManager().addWindow(fframeGridDialog);
645
                    }
646
                    IFFrame newFrame = fframeGridDialog.getFFrame();
647
                    if (newFrame != null) {
648
                        fframeview.setGrid(newFrame);
649
                    }
650
                }
651
            });
652
        }
653
        return bGrid;
654
    }
655

    
656
    /**
657
     * This method initializes chbShowGrid
658
     * 
659
     * @return javax.swing.JCheckBox
660
     */
661
    private JCheckBox getChbShowGrid() {
662
        if (chbShowGrid == null) {
663
            chbShowGrid = new JCheckBox();
664
            chbShowGrid.setBounds(new java.awt.Rectangle(13, 191, 181, 21));
665
            chbShowGrid.setSelected(fframeview.isShowGrid());
666
            chbShowGrid.setText(PluginServices.getText(this, "Show_grid"));
667
        }
668
        return chbShowGrid;
669
    }
670

    
671
    public Object getWindowProfile() {
672
        return WindowInfo.DIALOG_PROFILE;
673
    }
674

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