svn-gvsig-desktop / branches / CqCMSDvp / libraries / libCq CMS for java.old / src / org / cresques / ui / raster / RasterTransparencyPanel.java @ 1752
History | View | Annotate | Download (7.51 KB)
1 |
package org.cresques.ui.raster; |
---|---|
2 |
|
3 |
import java.awt.BorderLayout; |
4 |
|
5 |
import javax.swing.JPanel; |
6 |
|
7 |
import javax.swing.JCheckBox; |
8 |
import java.awt.FlowLayout; |
9 |
import javax.swing.JSlider; |
10 |
import javax.swing.JLabel; |
11 |
import javax.swing.JTextField; |
12 |
import java.awt.GridBagLayout; |
13 |
import java.awt.GridBagConstraints; |
14 |
import java.awt.CardLayout; |
15 |
import java.awt.GridLayout; |
16 |
import javax.swing.BoxLayout; |
17 |
|
18 |
/**
|
19 |
*
|
20 |
* @author Nacho Brodin <brodin_ign@gva.es>
|
21 |
*
|
22 |
*/
|
23 |
public class RasterTransparencyPanel extends JPanel{ |
24 |
|
25 |
String nom = "Transparencia"; |
26 |
FilterRasterDialogPanel parent = null;
|
27 |
|
28 |
private JPanel jPanel = null; |
29 |
private JPanel jPanel1 = null; |
30 |
private JPanel jPanel2 = null; |
31 |
private JPanel jPanel3 = null; |
32 |
private JCheckBox cbTransparencia = null; |
33 |
private JLabel jLabel = null; |
34 |
private JTextField tRojo = null; |
35 |
private JLabel jLabel1 = null; |
36 |
private JTextField tVerde = null; |
37 |
private JLabel jLabel2 = null; |
38 |
private JTextField tAzul = null; |
39 |
private JPanel jPanel4 = null; |
40 |
private JCheckBox cbOpacidad = null; |
41 |
private JSlider slOpacidad = null; |
42 |
private JTextField tOpacidad = null; |
43 |
private JPanel jPanel5 = null; |
44 |
private JLabel jLabel3 = null; |
45 |
public RasterTransparencyPanel(FilterRasterDialogPanel parent){
|
46 |
|
47 |
this.parent = parent;
|
48 |
initialize(); |
49 |
} |
50 |
|
51 |
/**
|
52 |
* This method initializes this
|
53 |
*
|
54 |
* @return void
|
55 |
*/
|
56 |
private void initialize() { |
57 |
|
58 |
this.setLayout(new BorderLayout()); |
59 |
this.setSize(350, 210); |
60 |
this.add(getJPanel(), java.awt.BorderLayout.CENTER);
|
61 |
initControls(); |
62 |
|
63 |
} |
64 |
|
65 |
/**
|
66 |
*
|
67 |
*
|
68 |
*/
|
69 |
public void initControls(){ |
70 |
|
71 |
this.getCbTransparencia().setSelected(true); |
72 |
this.getTRojo().setEnabled(true); |
73 |
this.getTVerde().setEnabled(true); |
74 |
this.getTAzul().setEnabled(true); |
75 |
this.getCbOpacidad().setSelected(false); |
76 |
this.getSlOpacidad().setEnabled(false); |
77 |
this.getSlOpacidad().setValue(100); |
78 |
this.getTOpacidad().setEnabled(false); |
79 |
this.getTOpacidad().setText("100"); |
80 |
|
81 |
} |
82 |
|
83 |
/**
|
84 |
* This method initializes jPanel
|
85 |
*
|
86 |
* @return javax.swing.JPanel
|
87 |
*/
|
88 |
private JPanel getJPanel() { |
89 |
if (jPanel == null) { |
90 |
GridBagConstraints gridBagConstraints9 = new GridBagConstraints(); |
91 |
GridBagConstraints gridBagConstraints8 = new GridBagConstraints(); |
92 |
GridBagConstraints gridBagConstraints7 = new GridBagConstraints(); |
93 |
GridBagConstraints gridBagConstraints6 = new GridBagConstraints(); |
94 |
GridBagConstraints gridBagConstraints5 = new GridBagConstraints(); |
95 |
jPanel = new JPanel(); |
96 |
jPanel.setLayout(new GridBagLayout()); |
97 |
gridBagConstraints5.fill = java.awt.GridBagConstraints.NONE; |
98 |
gridBagConstraints5.ipady = 0;
|
99 |
gridBagConstraints5.gridheight = 1;
|
100 |
gridBagConstraints5.gridwidth = 0;
|
101 |
gridBagConstraints5.anchor = java.awt.GridBagConstraints.WEST; |
102 |
gridBagConstraints5.insets = new java.awt.Insets(0,0,0,0); |
103 |
gridBagConstraints6.gridwidth = 0;
|
104 |
gridBagConstraints6.anchor = java.awt.GridBagConstraints.WEST; |
105 |
gridBagConstraints7.gridwidth = 1;
|
106 |
gridBagConstraints7.insets = new java.awt.Insets(20,0,0,0); |
107 |
gridBagConstraints8.gridwidth = 0;
|
108 |
gridBagConstraints8.anchor = java.awt.GridBagConstraints.WEST; |
109 |
jPanel.setPreferredSize(new java.awt.Dimension(333,113)); |
110 |
gridBagConstraints9.gridx = 0;
|
111 |
gridBagConstraints9.gridy = 1;
|
112 |
gridBagConstraints9.insets = new java.awt.Insets(0,180,0,0); |
113 |
jPanel.add(getJPanel1(), gridBagConstraints5); |
114 |
jPanel.add(getJPanel2(), gridBagConstraints6); |
115 |
jPanel.add(getJPanel3(), gridBagConstraints8); |
116 |
jPanel.add(getJPanel4(), gridBagConstraints7); |
117 |
jPanel.add(getJPanel5(), gridBagConstraints9); |
118 |
} |
119 |
return jPanel;
|
120 |
} |
121 |
/**
|
122 |
* This method initializes jPanel1
|
123 |
*
|
124 |
* @return javax.swing.JPanel
|
125 |
*/
|
126 |
private JPanel getJPanel1() { |
127 |
if (jPanel1 == null) { |
128 |
jLabel = new JLabel(); |
129 |
jPanel1 = new JPanel(); |
130 |
jPanel1.setLayout(new BorderLayout()); |
131 |
jLabel.setText("Valor Rojo: ");
|
132 |
jPanel1.setPreferredSize(new java.awt.Dimension(170,42)); |
133 |
jPanel1.add(getCbTransparencia(), java.awt.BorderLayout.NORTH); |
134 |
jPanel1.add(jLabel, java.awt.BorderLayout.WEST); |
135 |
jPanel1.add(getTRojo(), java.awt.BorderLayout.EAST); |
136 |
} |
137 |
return jPanel1;
|
138 |
} |
139 |
/**
|
140 |
* This method initializes jPanel2
|
141 |
*
|
142 |
* @return javax.swing.JPanel
|
143 |
*/
|
144 |
private JPanel getJPanel2() { |
145 |
if (jPanel2 == null) { |
146 |
jLabel1 = new JLabel(); |
147 |
jPanel2 = new JPanel(); |
148 |
jPanel2.setLayout(new BorderLayout()); |
149 |
jLabel1.setText("Valor Verde: ");
|
150 |
jPanel2.setPreferredSize(new java.awt.Dimension(170,19)); |
151 |
jPanel2.add(jLabel1, java.awt.BorderLayout.WEST); |
152 |
jPanel2.add(getTVerde(), java.awt.BorderLayout.EAST); |
153 |
} |
154 |
return jPanel2;
|
155 |
} |
156 |
/**
|
157 |
* This method initializes jPanel3
|
158 |
*
|
159 |
* @return javax.swing.JPanel
|
160 |
*/
|
161 |
private JPanel getJPanel3() { |
162 |
if (jPanel3 == null) { |
163 |
jLabel2 = new JLabel(); |
164 |
jPanel3 = new JPanel(); |
165 |
jPanel3.setLayout(new BorderLayout()); |
166 |
jLabel2.setText("Valor Azul: ");
|
167 |
jPanel3.setPreferredSize(new java.awt.Dimension(170,19)); |
168 |
jPanel3.add(jLabel2, java.awt.BorderLayout.WEST); |
169 |
jPanel3.add(getTAzul(), java.awt.BorderLayout.EAST); |
170 |
} |
171 |
return jPanel3;
|
172 |
} |
173 |
/**
|
174 |
* This method initializes jCheckBox
|
175 |
*
|
176 |
* @return javax.swing.JCheckBox
|
177 |
*/
|
178 |
public JCheckBox getCbTransparencia() { |
179 |
if (cbTransparencia == null) { |
180 |
cbTransparencia = new JCheckBox(); |
181 |
cbTransparencia.setText("Transparencia");
|
182 |
} |
183 |
return cbTransparencia;
|
184 |
} |
185 |
/**
|
186 |
* This method initializes jTextField
|
187 |
*
|
188 |
* @return javax.swing.JTextField
|
189 |
*/
|
190 |
public JTextField getTRojo() { |
191 |
if (tRojo == null) { |
192 |
tRojo = new JTextField(); |
193 |
tRojo.setPreferredSize(new java.awt.Dimension(80,19)); |
194 |
} |
195 |
return tRojo;
|
196 |
} |
197 |
/**
|
198 |
* This method initializes jTextField1
|
199 |
*
|
200 |
* @return javax.swing.JTextField
|
201 |
*/
|
202 |
public JTextField getTVerde() { |
203 |
if (tVerde == null) { |
204 |
tVerde = new JTextField(); |
205 |
tVerde.setPreferredSize(new java.awt.Dimension(80,19)); |
206 |
} |
207 |
return tVerde;
|
208 |
} |
209 |
/**
|
210 |
* This method initializes jTextField2
|
211 |
*
|
212 |
* @return javax.swing.JTextField
|
213 |
*/
|
214 |
public JTextField getTAzul() { |
215 |
if (tAzul == null) { |
216 |
tAzul = new JTextField(); |
217 |
tAzul.setPreferredSize(new java.awt.Dimension(80,19)); |
218 |
} |
219 |
return tAzul;
|
220 |
} |
221 |
/**
|
222 |
* This method initializes jPanel4
|
223 |
*
|
224 |
* @return javax.swing.JPanel
|
225 |
*/
|
226 |
private JPanel getJPanel4() { |
227 |
if (jPanel4 == null) { |
228 |
jPanel4 = new JPanel(); |
229 |
jPanel4.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray,1));
|
230 |
jPanel4.add(getCbOpacidad(), null);
|
231 |
jPanel4.add(getSlOpacidad(), null);
|
232 |
jPanel4.add(getTOpacidad(), null);
|
233 |
} |
234 |
return jPanel4;
|
235 |
} |
236 |
/**
|
237 |
* This method initializes jCheckBox1
|
238 |
*
|
239 |
* @return javax.swing.JCheckBox
|
240 |
*/
|
241 |
public JCheckBox getCbOpacidad() { |
242 |
if (cbOpacidad == null) { |
243 |
cbOpacidad = new JCheckBox(); |
244 |
cbOpacidad.setText("Opacidad");
|
245 |
} |
246 |
return cbOpacidad;
|
247 |
} |
248 |
/**
|
249 |
* This method initializes jSlider
|
250 |
*
|
251 |
* @return javax.swing.JSlider
|
252 |
*/
|
253 |
public JSlider getSlOpacidad() { |
254 |
if (slOpacidad == null) { |
255 |
slOpacidad = new JSlider(); |
256 |
} |
257 |
return slOpacidad;
|
258 |
} |
259 |
/**
|
260 |
* This method initializes jTextField3
|
261 |
*
|
262 |
* @return javax.swing.JTextField
|
263 |
*/
|
264 |
public JTextField getTOpacidad() { |
265 |
if (tOpacidad == null) { |
266 |
tOpacidad = new JTextField(); |
267 |
tOpacidad.setPreferredSize(new java.awt.Dimension(30,19)); |
268 |
} |
269 |
return tOpacidad;
|
270 |
} |
271 |
/**
|
272 |
* This method initializes jPanel5
|
273 |
*
|
274 |
* @return javax.swing.JPanel
|
275 |
*/
|
276 |
private JPanel getJPanel5() { |
277 |
if (jPanel5 == null) { |
278 |
jLabel3 = new JLabel(); |
279 |
jPanel5 = new JPanel(); |
280 |
jLabel3.setText("Usa un rango: 1,3,5:8");
|
281 |
jPanel5.add(jLabel3, null);
|
282 |
} |
283 |
return jPanel5;
|
284 |
} |
285 |
} // @jve:decl-index=0:visual-constraint="36,15"
|