Revision 6830 trunk/libraries/libCq CMS for java.old/src/org/cresques/ui/DefaultDialogPanel.java
DefaultDialogPanel.java | ||
---|---|---|
23 | 23 |
*/ |
24 | 24 |
package org.cresques.ui; |
25 | 25 |
|
26 |
import java.awt.Dimension;
|
|
26 |
import java.awt.FlowLayout;
|
|
27 | 27 |
import java.awt.GridBagConstraints; |
28 | 28 |
import java.awt.GridBagLayout; |
29 | 29 |
import java.awt.event.ComponentEvent; |
... | ... | |
31 | 31 |
|
32 | 32 |
import javax.swing.JButton; |
33 | 33 |
import javax.swing.JPanel; |
34 |
import java.awt.FlowLayout; |
|
34 |
import javax.swing.event.ChangeEvent; |
|
35 |
import javax.swing.event.ChangeListener; |
|
35 | 36 |
|
36 | 37 |
|
37 | 38 |
/** |
... | ... | |
41 | 42 |
final private static long serialVersionUID = -3370601314380922368L; |
42 | 43 |
protected JPanel contentPane = null; |
43 | 44 |
private JPanel tabPane = null; |
44 |
private JPanel buttonPane = null;
|
|
45 |
protected JPanel buttonPane = null;
|
|
45 | 46 |
private JButton acceptButton = null; |
46 | 47 |
private JButton cancelButton = null; |
47 | 48 |
private JButton applyButton = null; |
48 | 49 |
private int flag = 0; |
49 | 50 |
protected int cWidth = 0, difWidth = 0; |
50 | 51 |
protected int cHeight = 0, difHeight = 0; |
52 |
protected JPanel pButton = null; |
|
51 | 53 |
|
52 | 54 |
/** |
53 | 55 |
* Constructor |
... | ... | |
75 | 77 |
//setBounds(0,0,321,230); |
76 | 78 |
//javax.swing.BoxLayout(jContentPane, javax.swing.BoxLayout.Y_AXIS); |
77 | 79 |
//jContentPane.setLayout(new java.awt.GridLayout(2,1)); |
78 |
GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); |
|
79 |
gridBagConstraints1.insets = new java.awt.Insets(3,22,2,23);
|
|
80 |
gridBagConstraints1.gridy = 1;
|
|
81 |
gridBagConstraints1.gridx = 0;
|
|
80 |
GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
|
|
81 |
gridBagConstraints11.gridx = 0;
|
|
82 |
gridBagConstraints11.insets = new java.awt.Insets(4,0,0,0);
|
|
83 |
gridBagConstraints11.gridy = 1;
|
|
82 | 84 |
GridBagConstraints gridBagConstraints = new GridBagConstraints(); |
83 | 85 |
gridBagConstraints.insets = new java.awt.Insets(5,0,2,0); |
84 | 86 |
gridBagConstraints.gridy = 0; |
... | ... | |
89 | 91 |
//jContentPane.setSize(30, 24); |
90 | 92 |
this.setPreferredSize(new java.awt.Dimension(320, 165)); |
91 | 93 |
this.add(getTabPanel(), gridBagConstraints); |
92 |
this.add(getButtonPanel(), gridBagConstraints1);
|
|
94 |
this.add(getPButton(), gridBagConstraints11);
|
|
93 | 95 |
this.addComponentListener(this); |
94 | 96 |
|
95 | 97 |
} |
... | ... | |
128 | 130 |
} |
129 | 131 |
|
130 | 132 |
/** |
133 |
* This method initializes jPanel |
|
134 |
* |
|
135 |
* @return javax.swing.JPanel |
|
136 |
*/ |
|
137 |
private JPanel getPButton() { |
|
138 |
if (pButton == null) { |
|
139 |
FlowLayout flowLayout1 = new FlowLayout(); |
|
140 |
flowLayout1.setAlignment(java.awt.FlowLayout.RIGHT); |
|
141 |
flowLayout1.setHgap(0); |
|
142 |
flowLayout1.setVgap(0); |
|
143 |
pButton = new JPanel(); |
|
144 |
pButton.setPreferredSize(new java.awt.Dimension(320,25)); |
|
145 |
pButton.setLayout(flowLayout1); |
|
146 |
pButton.add(getButtonPanel(), null); |
|
147 |
} |
|
148 |
return pButton; |
|
149 |
} |
|
150 |
|
|
151 |
|
|
152 |
/** |
|
131 | 153 |
* Obtiene el panel que contiene los botones de Aceptar, Cancelar y Aplicar |
132 | 154 |
* @return |
133 | 155 |
*/ |
134 | 156 |
protected JPanel getButtonPanel() { |
135 | 157 |
if (buttonPane == null) { |
136 |
GridBagConstraints gridBagConstraints5 = new GridBagConstraints(); |
|
137 |
gridBagConstraints5.insets = new java.awt.Insets(1,0,1,0); |
|
138 |
gridBagConstraints5.gridy = 0; |
|
139 |
gridBagConstraints5.gridx = 2; |
|
140 | 158 |
GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); |
141 |
gridBagConstraints4.insets = new java.awt.Insets(1,0,1,8); |
|
159 |
gridBagConstraints4.gridx = 2; |
|
160 |
gridBagConstraints4.insets = new java.awt.Insets(0,3,0,0); |
|
142 | 161 |
gridBagConstraints4.gridy = 0; |
143 |
gridBagConstraints4.gridx = 1; |
|
144 | 162 |
GridBagConstraints gridBagConstraints3 = new GridBagConstraints(); |
145 |
gridBagConstraints3.insets = new java.awt.Insets(1,0,1,8); |
|
163 |
gridBagConstraints3.gridx = 1; |
|
164 |
gridBagConstraints3.insets = new java.awt.Insets(0,3,0,3); |
|
146 | 165 |
gridBagConstraints3.gridy = 0; |
147 |
gridBagConstraints3.gridx = 0; |
|
166 |
GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); |
|
167 |
gridBagConstraints1.insets = new java.awt.Insets(0,0,0,3); |
|
168 |
gridBagConstraints1.gridy = 0; |
|
169 |
gridBagConstraints1.gridx = 0; |
|
148 | 170 |
buttonPane = new JPanel(); |
149 | 171 |
buttonPane.setLayout(new GridBagLayout()); |
150 |
buttonPane.setSize(309, 25); |
|
151 |
buttonPane.setBounds(6, 200, 309, 25); |
|
152 |
buttonPane.add(getAcceptButton(), gridBagConstraints3); |
|
153 |
buttonPane.add(getCancelButton(), gridBagConstraints4); |
|
154 |
buttonPane.add(getApplyButton(), gridBagConstraints5); |
|
172 |
buttonPane.add(getAcceptButton(), gridBagConstraints1); |
|
173 |
buttonPane.add(getCancelButton(), gridBagConstraints3); |
|
174 |
buttonPane.add(getApplyButton(), gridBagConstraints4); |
|
155 | 175 |
} |
156 | 176 |
|
157 | 177 |
return buttonPane; |
... | ... | |
226 | 246 |
difHeight = nHeight - cHeight; |
227 | 247 |
this.tabPane.setSize(this.tabPane.getSize().width + difWidth, this.tabPane.getSize().height + difHeight); |
228 | 248 |
this.tabPane.setLocation(this.tabPane.getLocation().x - difWidth/2, this.tabPane.getLocation().y - difHeight/2); |
249 |
|
|
229 | 250 |
this.contentPane.setSize(this.contentPane.getSize().width + difWidth, this.contentPane.getSize().height + difHeight); |
230 |
this.buttonPane.setLocation(this.buttonPane.getLocation().x + difWidth/2, this.buttonPane.getLocation().y + difHeight/2); |
|
251 |
//this.pButton.setSize(this.getPButton().getWidth() + difWidth/2, 25); |
|
252 |
//this.buttonPane.setLocation(this.buttonPane.getLocation().x + difWidth/2, this.buttonPane.getLocation().y + difHeight/2); |
|
253 |
this.pButton.setLocation(this.pButton.getLocation().x + difWidth/2, this.pButton.getLocation().y + difHeight/2); |
|
231 | 254 |
|
232 | 255 |
} |
233 | 256 |
|
... | ... | |
235 | 258 |
// TODO Auto-generated method stub |
236 | 259 |
|
237 | 260 |
} |
261 |
|
|
262 |
|
|
238 | 263 |
} // @jve:decl-index=0:visual-constraint="12,13" |
Also available in: Unified diff