Statistics
| Revision:

svn-gvsig-desktop / branches / CqCMSDvp / libraries / libCq CMS for java.old / src / org / cresques / ui / DefaultDialogPanel.java @ 2312

History | View | Annotate | Download (3.93 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.FlowLayout;
27

    
28
import javax.swing.JButton;
29
import javax.swing.JLabel;
30
import javax.swing.JPanel;
31

    
32
/**
33
 * @author Luis W. Sevilla (sevilla_lui@gva.es)
34
 */
35
public class DefaultDialogPanel extends JPanel {
36
        protected JPanel contentPane = null;
37
        private JPanel tabPane = null;
38
        private JPanel buttonPane = null;
39
        private JButton acceptButton = null;
40
        private JButton cancelButton = null;
41
        private JButton applyButton = null;
42

    
43
        /**
44
         * 
45
         */
46
        public DefaultDialogPanel() {
47
                super();
48
                initialize();
49
        }
50

    
51
        /**
52
         * This method initializes this
53
         * 
54
         * @return void
55
         */
56
        private void initialize() {
57
                //setBounds(0,0,321,230);
58
                //javax.swing.BoxLayout(jContentPane, javax.swing.BoxLayout.Y_AXIS);
59
                //jContentPane.setLayout(new java.awt.GridLayout(2,1));
60
                setLayout(new FlowLayout());
61
                setBorder(javax.swing.BorderFactory.createEmptyBorder(5,5,5,5));
62
                //jContentPane.setSize(30, 24);
63
                this.setPreferredSize(new java.awt.Dimension(320,165));
64
                add(getTabPanel(), null);
65
                add(getButtonPanel(), null);
66
        }
67
        
68
        protected JPanel getContentPanel(){
69
                if (contentPane == null) {
70
                        contentPane = new JPanel();
71
                        contentPane.setBounds(6, 200, 309, 125);
72
                        contentPane.setPreferredSize(new java.awt.Dimension(310,100));
73
                }
74
                return contentPane;
75
        }
76
        
77
        private JPanel getTabPanel() {
78
                if (tabPane == null){
79
                        tabPane = new JPanel();
80
                        setLayout(new FlowLayout());
81
                        //tabPane.setBounds(6, 7, 309, 189);
82
                        tabPane.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.SoftBevelBorder.RAISED));
83
                        tabPane.add(getContentPanel(), null);
84
                }
85
                return tabPane;
86
        }
87
        
88
        protected JPanel getButtonPanel() {
89
                if (buttonPane == null) {
90
                        java.awt.FlowLayout flowLayout2 = new FlowLayout();
91
                        buttonPane = new JPanel();
92
                        buttonPane.setLayout(flowLayout2);
93
                        buttonPane.setSize(309, 25);
94
                        buttonPane.setBounds(6, 200, 309, 25);
95
                        flowLayout2.setHgap(0);
96
                        flowLayout2.setAlignment(java.awt.FlowLayout.RIGHT);
97
                        flowLayout2.setVgap(1);
98
                        buttonPane.add(getAcceptButton(), null);
99
                        JLabel lbl1 = new JLabel();
100
                        lbl1.setPreferredSize(new java.awt.Dimension(18,23));
101
                        buttonPane.add(lbl1);
102
                        buttonPane.add(getCancelButton(), null);
103
                        JLabel lbl2 = new JLabel();
104
                        lbl2.setPreferredSize(new java.awt.Dimension(18,23));
105
                        buttonPane.add(lbl2);
106
                        buttonPane.add(getApplyButton(), null);
107
                }
108
                return buttonPane;
109
        }
110
        /**
111
         * This method initializes jButton        
112
         *         
113
         * @return javax.swing.JButton        
114
         */    
115
        public JButton getAcceptButton() {
116
                if (acceptButton == null) {
117
                        acceptButton = new JButton("Aceptar");
118
                        acceptButton.setText("Aceptar");
119
                }
120
                return acceptButton;
121
        }
122
        /**
123
         * This method initializes jButton        
124
         *         
125
         * @return javax.swing.JButton        
126
         */    
127
        public JButton getCancelButton() {
128
                if (cancelButton == null) {
129
                        cancelButton = new JButton("Cancelar");
130
                        cancelButton.setText("Cancelar");
131
                }
132
                return cancelButton;
133
        }
134
        /**
135
         * This method initializes jButton        
136
         *         
137
         * @return javax.swing.JButton        
138
         */    
139
        public JButton getApplyButton() {
140
                if (applyButton == null) {
141
                        applyButton = new JButton("Aplicar");
142
                }
143
                return applyButton;
144
        }
145
}