Statistics
| Revision:

root / trunk / extensions / extRasterTools-SE / src / org / gvsig / rastertools / properties / dialog / ButtonsPanel.java @ 11180

History | View | Annotate | Download (2.64 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19
package org.gvsig.rastertools.properties.dialog;
20

    
21
import java.awt.FlowLayout;
22

    
23
import javax.swing.JButton;
24
import javax.swing.JPanel;
25

    
26
/**
27
 * Panel con los controles de bot?n de aplicar, aceptar y cancelar.
28
 * 
29
 * @author Nacho Brodin (nachobrodin@gmail.com)
30
 *
31
 */
32
public class ButtonsPanel extends JPanel {
33
        private static final long serialVersionUID = -5111153508681932951L;
34
        private JButton bAccept = null;
35
        private JButton bApply = null;
36
        private JButton bCancel = null;
37
        private int         sizePanelX = 0;
38
        private int         sizePanelY = 30;
39
        
40

    
41
        /**
42
         * This method initializes 
43
         * 
44
         */
45
        public ButtonsPanel(int sizex) {
46
                super();
47
        this.sizePanelX = sizex;
48
                initialize();
49
        }
50

    
51
        /**
52
         * This method initializes this
53
         * 
54
         */
55
        private void initialize() {
56
        FlowLayout flowLayout = new FlowLayout();
57
        flowLayout.setAlignment(java.awt.FlowLayout.RIGHT);
58
        flowLayout.setHgap(2);
59
        flowLayout.setVgap(2);
60
        this.setLayout(flowLayout);
61
        this.setPreferredSize(new java.awt.Dimension(sizePanelX, sizePanelY));
62
        this.add(getAccept(), null);
63
        this.add(getApply(), null);
64
        this.add(getCancel(), null);
65
                        
66
        }
67

    
68
        /**
69
         * This method initializes jButton        
70
         *         
71
         * @return javax.swing.JButton        
72
         */
73
        public JButton getAccept() {
74
                if (bAccept == null) {
75
                        bAccept = new JButton();
76
                        bAccept.setText("Aceptar");
77
                }
78
                return bAccept;
79
        }
80

    
81
        /**
82
         * This method initializes jButton1        
83
         *         
84
         * @return javax.swing.JButton        
85
         */
86
        public JButton getApply() {
87
                if (bApply == null) {
88
                        bApply = new JButton();
89
                        bApply.setText("Aplicar");
90
                }
91
                return bApply;
92
        }
93

    
94
        /**
95
         * This method initializes jButton2        
96
         *         
97
         * @return javax.swing.JButton        
98
         */
99
        public JButton getCancel() {
100
                if (bCancel == null) {
101
                        bCancel = new JButton();
102
                        bCancel.setText("Cancelar");
103
                }
104
                return bCancel;
105
        }
106

    
107
}