Revision 2669 branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/ui/DefaultTabPanel.java
DefaultTabPanel.java | ||
---|---|---|
1 | 1 |
/* |
2 | 2 |
* Cresques Mapping Suite. Graphic Library for constructing mapping applications. |
3 |
* |
|
4 |
* Copyright (C) 2004-5. |
|
5 | 3 |
* |
4 |
* Copyright (C) 2004-5. |
|
5 |
* |
|
6 | 6 |
* This program is free software; you can redistribute it and/or |
7 | 7 |
* modify it under the terms of the GNU General Public License |
8 | 8 |
* as published by the Free Software Foundation; either version 2 |
... | ... | |
18 | 18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
19 | 19 |
* |
20 | 20 |
* For more information, contact: |
21 |
*
|
|
21 |
* |
|
22 | 22 |
* cresques@gmail.com |
23 | 23 |
*/ |
24 | 24 |
package org.cresques.ui; |
... | ... | |
28 | 28 |
import javax.swing.JPanel; |
29 | 29 |
import javax.swing.JTabbedPane; |
30 | 30 |
|
31 |
|
|
31 | 32 |
/** |
32 | 33 |
* @author Nacho Brodin (brodin_ign@gva.es) |
33 |
*
|
|
34 |
* |
|
34 | 35 |
* Panel del que heredaran los paneles que contengan tabs |
35 | 36 |
*/ |
36 | 37 |
public class DefaultTabPanel extends DefaultDialogPanel { |
37 |
final private static long serialVersionUID = -3370601314380922368L; |
|
38 |
protected JTabbedPane tabbedPane = null; |
|
39 |
|
|
40 |
|
|
41 |
/** |
|
42 |
* Contructor |
|
43 |
*/ |
|
44 |
public DefaultTabPanel() { |
|
45 |
|
|
46 |
super(); |
|
47 |
this.setBounds(0,0,355,230); |
|
48 |
this.getContentPanel(); |
|
49 |
this.getTabPane(); |
|
50 |
contentPane.add( tabbedPane, BorderLayout.CENTER ); |
|
51 |
|
|
52 |
} |
|
53 |
|
|
54 |
/** |
|
55 |
* Obtiene el Componente JTabbedPane |
|
56 |
* @return Componente JTabbedPane |
|
57 |
*/ |
|
58 |
private JTabbedPane getTabPane(){ |
|
59 |
|
|
60 |
if(tabbedPane==null){ |
|
61 |
tabbedPane = new JTabbedPane(); |
|
62 |
} |
|
63 |
return tabbedPane; |
|
64 |
|
|
65 |
} |
|
66 |
/** |
|
67 |
* A?ade un tab al JTabbedPane |
|
68 |
* @param title T?tulo del tab |
|
69 |
* @param panel Panel del nuevo tab |
|
70 |
*/ |
|
71 |
protected void addTab(String title, JPanel panel){ |
|
72 |
|
|
73 |
tabbedPane.add(title, panel); |
|
74 |
} |
|
75 |
|
|
76 |
/** |
|
77 |
* Obtiene el JTabbedPane |
|
78 |
* @return JTabbedPane |
|
79 |
*/ |
|
80 |
public JTabbedPane getTab() { |
|
81 |
|
|
82 |
return tabbedPane; |
|
83 |
|
|
84 |
} |
|
85 |
|
|
86 |
} |
|
38 |
final private static long serialVersionUID = -3370601314380922368L; |
|
39 |
protected JTabbedPane tabbedPane = null; |
|
87 | 40 |
|
41 |
/** |
|
42 |
* Contructor |
|
43 |
*/ |
|
44 |
public DefaultTabPanel() { |
|
45 |
super(); |
|
46 |
this.setBounds(0, 0, 355, 230); |
|
47 |
this.getContentPanel(); |
|
48 |
this.getTabPane(); |
|
49 |
contentPane.add(tabbedPane, BorderLayout.CENTER); |
|
50 |
} |
|
51 |
|
|
52 |
/** |
|
53 |
* Obtiene el Componente JTabbedPane |
|
54 |
* @return Componente JTabbedPane |
|
55 |
*/ |
|
56 |
private JTabbedPane getTabPane() { |
|
57 |
if (tabbedPane == null) { |
|
58 |
tabbedPane = new JTabbedPane(); |
|
59 |
} |
|
60 |
|
|
61 |
return tabbedPane; |
|
62 |
} |
|
63 |
|
|
64 |
/** |
|
65 |
* A?ade un tab al JTabbedPane |
|
66 |
* @param title T?tulo del tab |
|
67 |
* @param panel Panel del nuevo tab |
|
68 |
*/ |
|
69 |
protected void addTab(String title, JPanel panel) { |
|
70 |
tabbedPane.add(title, panel); |
|
71 |
} |
|
72 |
|
|
73 |
/** |
|
74 |
* Obtiene el JTabbedPane |
|
75 |
* @return JTabbedPane |
|
76 |
*/ |
|
77 |
public JTabbedPane getTab() { |
|
78 |
return tabbedPane; |
|
79 |
} |
|
80 |
} |
Also available in: Unified diff