Revision 4269 trunk/extensions/extRasterTools/src/com/iver/cit/gvsig/rasterTools/saveRaster/pruebas2/InputScaleDataPanel.java
InputScaleDataPanel.java | ||
---|---|---|
1 | 1 |
package com.iver.cit.gvsig.rasterTools.saveRaster.pruebas2; |
2 | 2 |
|
3 |
import javax.swing.JPanel; |
|
3 |
import java.awt.Color; |
|
4 |
import java.awt.FlowLayout; |
|
5 |
import java.awt.GridBagConstraints; |
|
4 | 6 |
import java.awt.GridBagLayout; |
5 |
import java.awt.GridBagConstraints; |
|
7 |
|
|
8 |
import javax.swing.JComboBox; |
|
6 | 9 |
import javax.swing.JLabel; |
10 |
import javax.swing.JPanel; |
|
7 | 11 |
import javax.swing.JTextField; |
8 |
import javax.swing.JComboBox; |
|
9 |
import java.awt.FlowLayout; |
|
10 | 12 |
|
11 | 13 |
public class InputScaleDataPanel extends JPanel { |
12 | 14 |
|
... | ... | |
25 | 27 |
public InputScaleDataPanel() { |
26 | 28 |
super(); |
27 | 29 |
initialize(); |
30 |
setActiveScale(0); |
|
28 | 31 |
} |
29 | 32 |
|
30 | 33 |
/** |
... | ... | |
87 | 90 |
pResolution.setLayout(flowLayout1); |
88 | 91 |
pResolution.setPreferredSize(new java.awt.Dimension(180,34)); |
89 | 92 |
pResolution.add(lResolution, null); |
90 |
pResolution.add(getCResolution(), null); |
|
93 |
pResolution.add(getCbResolution(), null);
|
|
91 | 94 |
} |
92 | 95 |
return pResolution; |
93 | 96 |
} |
... | ... | |
143 | 146 |
* |
144 | 147 |
* @return javax.swing.JComboBox |
145 | 148 |
*/ |
146 |
private JComboBox getCResolution() { |
|
149 |
private JComboBox getCbResolution() {
|
|
147 | 150 |
if (cResolution == null) { |
148 | 151 |
cResolution = new JComboBox(); |
149 | 152 |
cResolution.setPreferredSize(new java.awt.Dimension(80,24)); |
153 |
cResolution.addItem(75+""); |
|
154 |
cResolution.addItem(150+""); |
|
155 |
cResolution.addItem(300+""); |
|
150 | 156 |
} |
151 | 157 |
return cResolution; |
152 | 158 |
} |
153 | 159 |
|
160 |
/** |
|
161 |
* Pone como activo el input scale o mts por pixel dependiendo del |
|
162 |
* valor del par?metro. |
|
163 |
* @param active Si vale 0 activa la Escala y desactiva mts/pixel. |
|
164 |
* Si vale 1 activa mts/pixel y desactiva la Escala. |
|
165 |
* Si vale 2 desactiva ambos. |
|
166 |
*/ |
|
167 |
public void setActiveScale(int active){ |
|
168 |
Color backgroudColor = getBackground(); |
|
169 |
this.getCbResolution().setEnabled(true); |
|
170 |
|
|
171 |
if(active == 0){ |
|
172 |
getTScale().setEnabled(true); |
|
173 |
getTMtsPixel().setEnabled(false); |
|
174 |
getTScale().setBackground(Color.white); |
|
175 |
getTMtsPixel().setBackground(backgroudColor); |
|
176 |
}else if(active == 1){ |
|
177 |
getTScale().setEnabled(false); |
|
178 |
getTMtsPixel().setEnabled(true); |
|
179 |
getTScale().setBackground(backgroudColor); |
|
180 |
getTMtsPixel().setBackground(Color.white); |
|
181 |
}else if(active == 2){ |
|
182 |
getTScale().setEnabled(false); |
|
183 |
getTMtsPixel().setEnabled(false); |
|
184 |
getTScale().setBackground(backgroudColor); |
|
185 |
getTMtsPixel().setBackground(backgroudColor); |
|
186 |
} |
|
187 |
} |
|
154 | 188 |
} |
Also available in: Unified diff