svn-gvsig-desktop / branches / CqCMSDvp / libraries / libCq CMS for java.old / src / org / cresques / ui / DefaultDialogPanel.java @ 2705
History | View | Annotate | Download (4.75 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 |
/**
|
34 |
* @author Luis W. Sevilla (sevilla_lui@gva.es)
|
35 |
*/
|
36 |
public class DefaultDialogPanel extends JPanel { |
37 |
final private static long serialVersionUID = -3370601314380922368L; |
38 |
protected JPanel contentPane = null; |
39 |
private JPanel tabPane = null; |
40 |
private JPanel buttonPane = null; |
41 |
private JButton acceptButton = null; |
42 |
private JButton cancelButton = null; |
43 |
private JButton applyButton = null; |
44 |
|
45 |
/**
|
46 |
* Constructor
|
47 |
*/
|
48 |
public DefaultDialogPanel() {
|
49 |
super();
|
50 |
initialize(); |
51 |
} |
52 |
|
53 |
/**
|
54 |
* This method initializes this
|
55 |
*
|
56 |
* @return void
|
57 |
*/
|
58 |
private void initialize() { |
59 |
//setBounds(0,0,321,230);
|
60 |
//javax.swing.BoxLayout(jContentPane, javax.swing.BoxLayout.Y_AXIS);
|
61 |
//jContentPane.setLayout(new java.awt.GridLayout(2,1));
|
62 |
setLayout(new FlowLayout()); |
63 |
setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5)); |
64 |
|
65 |
//jContentPane.setSize(30, 24);
|
66 |
this.setPreferredSize(new java.awt.Dimension(320, 165)); |
67 |
add(getTabPanel(), null);
|
68 |
add(getButtonPanel(), null);
|
69 |
} |
70 |
|
71 |
/**
|
72 |
* Obtiene el panel general
|
73 |
* @return
|
74 |
*/
|
75 |
protected JPanel getContentPanel() { |
76 |
if (contentPane == null) { |
77 |
contentPane = new JPanel(); |
78 |
contentPane.setBounds(6, 200, 309, 125); |
79 |
contentPane.setPreferredSize(new java.awt.Dimension(310, 100)); |
80 |
} |
81 |
|
82 |
return contentPane;
|
83 |
} |
84 |
|
85 |
private JPanel getTabPanel() { |
86 |
if (tabPane == null) { |
87 |
tabPane = new JPanel(); |
88 |
setLayout(new FlowLayout()); |
89 |
|
90 |
//tabPane.setBounds(6, 7, 309, 189);
|
91 |
tabPane.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.SoftBevelBorder.RAISED));
|
92 |
tabPane.add(getContentPanel(), null);
|
93 |
} |
94 |
|
95 |
return tabPane;
|
96 |
} |
97 |
|
98 |
/**
|
99 |
* Obtiene el panel que contiene los botones de Aceptar, Cancelar y Aplicar
|
100 |
* @return
|
101 |
*/
|
102 |
protected JPanel getButtonPanel() { |
103 |
if (buttonPane == null) { |
104 |
java.awt.FlowLayout flowLayout2 = new FlowLayout(); |
105 |
buttonPane = new JPanel(); |
106 |
buttonPane.setLayout(flowLayout2); |
107 |
buttonPane.setSize(309, 25); |
108 |
buttonPane.setBounds(6, 200, 309, 25); |
109 |
flowLayout2.setHgap(0);
|
110 |
flowLayout2.setAlignment(java.awt.FlowLayout.RIGHT); |
111 |
flowLayout2.setVgap(1);
|
112 |
buttonPane.add(getAcceptButton(), null);
|
113 |
|
114 |
JLabel lbl1 = new JLabel(); |
115 |
lbl1.setPreferredSize(new java.awt.Dimension(18, 23)); |
116 |
buttonPane.add(lbl1); |
117 |
buttonPane.add(getCancelButton(), null);
|
118 |
|
119 |
JLabel lbl2 = new JLabel(); |
120 |
lbl2.setPreferredSize(new java.awt.Dimension(18, 23)); |
121 |
buttonPane.add(lbl2); |
122 |
buttonPane.add(getApplyButton(), null);
|
123 |
} |
124 |
|
125 |
return buttonPane;
|
126 |
} |
127 |
|
128 |
/**
|
129 |
* This method initializes Accept button
|
130 |
*
|
131 |
* @return javax.swing.JButton
|
132 |
*/
|
133 |
public JButton getAcceptButton() { |
134 |
if (acceptButton == null) { |
135 |
acceptButton = new JButton("Aceptar"); |
136 |
acceptButton.setText("Aceptar");
|
137 |
} |
138 |
|
139 |
return acceptButton;
|
140 |
} |
141 |
|
142 |
/**
|
143 |
* This method initializes Cancel Button
|
144 |
*
|
145 |
* @return javax.swing.JButton
|
146 |
*/
|
147 |
public JButton getCancelButton() { |
148 |
if (cancelButton == null) { |
149 |
cancelButton = new JButton("Cancelar"); |
150 |
cancelButton.setText("Cancelar");
|
151 |
} |
152 |
|
153 |
return cancelButton;
|
154 |
} |
155 |
|
156 |
/**
|
157 |
* This method initializes Apply Button
|
158 |
*
|
159 |
* @return javax.swing.JButton
|
160 |
*/
|
161 |
public JButton getApplyButton() { |
162 |
if (applyButton == null) { |
163 |
applyButton = new JButton("Aplicar"); |
164 |
} |
165 |
|
166 |
return applyButton;
|
167 |
} |
168 |
} |