Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libCq CMS for java.old / src / org / cresques / ui / DefaultTabPanel.java @ 4578

History | View | Annotate | Download (2.13 KB)

1
/*
2
 * Cresques Mapping Suite. Graphic Library for constructing mapping applications.
3
 *
4
 * Copyright (C) 2004-5.
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., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
 *
20
 * For more information, contact:
21
 *
22
 * cresques@gmail.com
23
 */
24
package org.cresques.ui;
25

    
26
import java.awt.BorderLayout;
27

    
28
import javax.swing.JPanel;
29
import javax.swing.JTabbedPane;
30

    
31

    
32
/**
33
 * Panel del que heredaran los paneles que contengan tabs
34
 * @author Nacho Brodin (brodin_ign@gva.es)
35
 */
36
public class DefaultTabPanel extends DefaultDialogPanel {
37
    final private static long serialVersionUID = -3370601314380922368L;
38
    protected JTabbedPane tabbedPane = null;
39

    
40
    /**
41
     * Contructor
42
     */
43
    public DefaultTabPanel() {
44
        super();
45
        this.setBounds(0, 0, 355, 230);
46
        this.getContentPanel();
47
        this.getTabPane();
48
        contentPane.add(tabbedPane, BorderLayout.CENTER);
49
    }
50

    
51
    /**
52
     * Obtiene el Componente JTabbedPane
53
     * @return Componente JTabbedPane
54
     */
55
    private JTabbedPane getTabPane() {
56
        if (tabbedPane == null) {
57
            tabbedPane = new JTabbedPane();
58
        }
59

    
60
        return tabbedPane;
61
    }
62

    
63
    /**
64
     * A?ade un tab al JTabbedPane
65
     * @param title        T?tulo del tab
66
     * @param panel        Panel del nuevo tab
67
     */
68
    public void addTab(String title, JPanel panel) {
69
        tabbedPane.add(title, panel);
70
    }
71

    
72
    /**
73
     * Obtiene el JTabbedPane
74
     * @return JTabbedPane
75
     */
76
    public JTabbedPane getTab() {
77
        return tabbedPane;
78
    }
79
}