Statistics
| Revision:

svn-gvsig-desktop / tags / Root_CqCMSGisPlanet / libraries / libCq CMS for java.old / src / org / cresques / ui / DefaultDialogPanel.java @ 1933

History | View | Annotate | Download (3.24 KB)

1
/*
2
 * Created on 20-feb-2005
3
 */
4
package org.cresques.ui;
5

    
6
import java.awt.FlowLayout;
7
import java.awt.event.ComponentEvent;
8
import java.awt.event.ComponentListener;
9

    
10
import javax.swing.JButton;
11
import javax.swing.JLabel;
12
import javax.swing.JPanel;
13
import javax.swing.event.AncestorEvent;
14
import javax.swing.event.AncestorListener;
15

    
16
/**
17
 * @author Luis W. Sevilla (sevilla_lui@gva.es)
18
 */
19
public class DefaultDialogPanel extends JPanel {
20
        protected JPanel contentPane = null;
21
        private JPanel tabPane = null;
22
        private JPanel buttonPane = null;
23
        private JButton acceptButton = null;
24
        private JButton cancelButton = null;
25
        private JButton applyButton = null;
26

    
27
        /**
28
         * 
29
         */
30
        public DefaultDialogPanel() {
31
                super();
32
                initialize();
33
        }
34

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