Revision 17491 trunk/extensions/extRasterTools-SE/src/org/gvsig/raster/gui/preferences/RasterPreferences.java
RasterPreferences.java | ||
---|---|---|
21 | 21 |
import java.awt.BorderLayout; |
22 | 22 |
import java.awt.GridBagConstraints; |
23 | 23 |
import java.awt.GridBagLayout; |
24 |
import java.awt.Insets; |
|
25 | 24 |
|
26 |
import javax.swing.BorderFactory; |
|
27 |
import javax.swing.ButtonGroup; |
|
28 |
import javax.swing.DefaultComboBoxModel; |
|
29 | 25 |
import javax.swing.ImageIcon; |
30 |
import javax.swing.JButton; |
|
31 |
import javax.swing.JCheckBox; |
|
32 |
import javax.swing.JComboBox; |
|
33 |
import javax.swing.JLabel; |
|
34 | 26 |
import javax.swing.JPanel; |
35 |
import javax.swing.JRadioButton; |
|
36 | 27 |
import javax.swing.JScrollPane; |
37 |
import javax.swing.JTextField;
|
|
28 |
import javax.swing.border.EmptyBorder;
|
|
38 | 29 |
|
39 | 30 |
import org.gvsig.raster.gui.preferences.panels.PreferenceCache; |
31 |
import org.gvsig.raster.gui.preferences.panels.PreferenceGeneral; |
|
32 |
import org.gvsig.raster.gui.preferences.panels.PreferenceLoadLayer; |
|
40 | 33 |
import org.gvsig.raster.gui.preferences.panels.PreferenceNoData; |
41 | 34 |
import org.gvsig.raster.gui.preferences.panels.PreferenceOverviews; |
35 |
import org.gvsig.raster.gui.preferences.panels.PreferenceTemporal; |
|
42 | 36 |
|
43 | 37 |
import com.iver.andami.PluginServices; |
44 | 38 |
import com.iver.andami.preferences.AbstractPreferencePage; |
... | ... | |
57 | 51 |
private PreferenceNoData noData = null; |
58 | 52 |
private PreferenceOverviews overviews = null; |
59 | 53 |
private PreferenceCache cache = null; |
54 |
private PreferenceTemporal temporal = null; |
|
55 |
private PreferenceGeneral general = null; |
|
56 |
private PreferenceLoadLayer loadLayer = null; |
|
60 | 57 |
|
61 | 58 |
public RasterPreferences() { |
62 | 59 |
super(); |
... | ... | |
65 | 62 |
} |
66 | 63 |
|
67 | 64 |
private void initialize() { |
68 |
ButtonGroup buttonGroup1;
|
|
69 |
JScrollPane jScrollPane1; |
|
65 |
setTitle("Frame");
|
|
66 |
|
|
70 | 67 |
GridBagConstraints gridBagConstraints; |
71 |
JButton jButton1; |
|
72 |
JCheckBox jCheckBox4; |
|
73 |
JCheckBox jCheckBox5; |
|
74 |
JCheckBox jCheckBox6; |
|
75 |
JComboBox jComboBox2; |
|
76 |
JComboBox jComboBox3; |
|
77 |
JLabel jLabel6; |
|
78 |
JLabel jLabel8; |
|
79 |
JLabel jLabel9; |
|
80 |
JPanel jPanel2; |
|
81 |
JPanel jPanel4; |
|
82 |
JPanel jPanel5; |
|
83 |
JPanel jPanel6; |
|
84 |
JPanel jPanel7; |
|
85 |
JRadioButton jRadioButton1; |
|
86 |
JRadioButton jRadioButton2; |
|
87 |
JTextField jTextField4; |
|
88 | 68 |
|
89 |
buttonGroup1 = new ButtonGroup(); |
|
90 |
jScrollPane1 = new javax.swing.JScrollPane(); |
|
69 |
JScrollPane scrollPane = new JScrollPane(); |
|
91 | 70 |
|
92 |
jScrollPane1.getVerticalScrollBar().setUnitIncrement(20);
|
|
71 |
scrollPane.getVerticalScrollBar().setUnitIncrement(20);
|
|
93 | 72 |
|
94 |
jPanel5 = new JPanel(); |
|
95 |
jPanel6 = new JPanel(); |
|
96 |
jPanel2 = new JPanel(); |
|
97 |
jLabel6 = new JLabel(); |
|
98 |
jTextField4 = new JTextField(); |
|
99 |
jButton1 = new JButton(); |
|
100 |
jPanel4 = new JPanel(); |
|
101 |
jCheckBox4 = new JCheckBox(); |
|
102 |
jCheckBox5 = new JCheckBox(); |
|
103 |
jLabel8 = new JLabel(); |
|
104 |
jComboBox2 = new JComboBox(); |
|
105 |
jCheckBox6 = new JCheckBox(); |
|
106 |
jPanel7 = new JPanel(); |
|
107 |
jLabel9 = new JLabel(); |
|
108 |
jRadioButton1 = new JRadioButton(); |
|
109 |
jRadioButton2 = new JRadioButton(); |
|
110 |
jComboBox3 = new JComboBox(); |
|
73 |
JPanel panel = new JPanel(); |
|
111 | 74 |
|
112 |
setTitle("Frame"); |
|
113 |
jPanel5.setLayout(new GridBagLayout()); |
|
75 |
panel.setLayout(new GridBagLayout()); |
|
114 | 76 |
|
115 | 77 |
gridBagConstraints = new GridBagConstraints(); |
116 | 78 |
gridBagConstraints.gridx = 0; |
117 |
gridBagConstraints.gridy = 6; |
|
118 |
gridBagConstraints.weightx = 1.0; |
|
119 |
gridBagConstraints.weighty = 1.0; |
|
120 |
jPanel5.add(jPanel6, gridBagConstraints); |
|
121 |
|
|
122 |
gridBagConstraints = new GridBagConstraints(); |
|
123 |
gridBagConstraints.gridx = 0; |
|
124 |
gridBagConstraints.gridy = 5; |
|
79 |
gridBagConstraints.gridy = 0; |
|
125 | 80 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
126 |
jPanel5.add(getPreferenceCache().getPanel(), gridBagConstraints);
|
|
81 |
panel.add(getPreferenceGeneral().getPanel(), gridBagConstraints);
|
|
127 | 82 |
|
128 |
jPanel2.setLayout(new GridBagLayout()); |
|
129 |
|
|
130 |
jPanel2.setBorder(BorderFactory.createTitledBorder("Rutas")); |
|
131 |
jLabel6.setText("Temporales:"); |
|
132 | 83 |
gridBagConstraints = new GridBagConstraints(); |
133 |
gridBagConstraints.insets = new Insets(5, 5, 5, 2); |
|
134 |
jPanel2.add(jLabel6, gridBagConstraints); |
|
135 |
|
|
136 |
gridBagConstraints = new GridBagConstraints(); |
|
137 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
|
138 |
gridBagConstraints.weightx = 1.0; |
|
139 |
gridBagConstraints.insets = new Insets(5, 2, 5, 2); |
|
140 |
jPanel2.add(jTextField4, gridBagConstraints); |
|
141 |
|
|
142 |
jButton1.setText("Abrir"); |
|
143 |
gridBagConstraints = new GridBagConstraints(); |
|
144 |
gridBagConstraints.insets = new Insets(5, 2, 5, 5); |
|
145 |
jPanel2.add(jButton1, gridBagConstraints); |
|
146 |
|
|
147 |
gridBagConstraints = new GridBagConstraints(); |
|
148 | 84 |
gridBagConstraints.gridx = 0; |
149 |
gridBagConstraints.gridy = 3;
|
|
85 |
gridBagConstraints.gridy = 1;
|
|
150 | 86 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
151 |
jPanel5.add(jPanel2, gridBagConstraints);
|
|
87 |
panel.add(getPreferenceLoadLayer().getPanel(), gridBagConstraints);
|
|
152 | 88 |
|
153 | 89 |
gridBagConstraints = new GridBagConstraints(); |
154 | 90 |
gridBagConstraints.gridx = 0; |
155 | 91 |
gridBagConstraints.gridy = 2; |
156 | 92 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
157 |
jPanel5.add(getPreferenceNoData().getPanel(), gridBagConstraints);
|
|
93 |
panel.add(getPreferenceNoData().getPanel(), gridBagConstraints);
|
|
158 | 94 |
|
159 |
jPanel4.setLayout(new GridBagLayout()); |
|
160 |
|
|
161 |
jPanel4.setBorder(BorderFactory.createTitledBorder("General")); |
|
162 |
|
|
163 |
jCheckBox4.setText("Generar estad\u00edsticas al cargar el raster"); |
|
164 |
jCheckBox4.setToolTipText("Generar estad\u00edsticas al cargar el raster"); |
|
165 |
jCheckBox4.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
166 |
jCheckBox4.setMargin(new Insets(0, 0, 0, 0)); |
|
167 | 95 |
gridBagConstraints = new GridBagConstraints(); |
168 | 96 |
gridBagConstraints.gridx = 0; |
169 |
gridBagConstraints.gridy = 0; |
|
170 |
gridBagConstraints.gridwidth = 2; |
|
171 |
gridBagConstraints.fill = GridBagConstraints.BOTH; |
|
172 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
|
173 |
gridBagConstraints.weighty = 1.0; |
|
174 |
gridBagConstraints.insets = new Insets(2, 5, 2, 5); |
|
175 |
jPanel4.add(jCheckBox4, gridBagConstraints); |
|
176 |
|
|
177 |
jCheckBox5.setText("Previsualizar autom\u00e1ticamente al cambiar las propiedades de raster"); |
|
178 |
jCheckBox5.setToolTipText("Previsualizar autom\u00e1ticamente al cambiar las propiedades de raster"); |
|
179 |
jCheckBox5.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
180 |
jCheckBox5.setMargin(new Insets(0, 0, 0, 0)); |
|
181 |
gridBagConstraints = new GridBagConstraints(); |
|
182 |
gridBagConstraints.gridx = 0; |
|
183 |
gridBagConstraints.gridy = 1; |
|
184 |
gridBagConstraints.gridwidth = 2; |
|
185 |
gridBagConstraints.fill = GridBagConstraints.BOTH; |
|
186 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
|
187 |
gridBagConstraints.weighty = 1.0; |
|
188 |
gridBagConstraints.insets = new Insets(2, 5, 2, 5); |
|
189 |
jPanel4.add(jCheckBox5, gridBagConstraints); |
|
190 |
|
|
191 |
jLabel8.setText("N\u00ba de clases:"); |
|
192 |
gridBagConstraints = new GridBagConstraints(); |
|
193 |
gridBagConstraints.gridx = 0; |
|
194 |
gridBagConstraints.gridy = 2; |
|
195 |
gridBagConstraints.anchor = GridBagConstraints.EAST; |
|
196 |
gridBagConstraints.insets = new Insets(2, 5, 2, 2); |
|
197 |
jPanel4.add(jLabel8, gridBagConstraints); |
|
198 |
|
|
199 |
jComboBox2.setModel(new DefaultComboBoxModel(new String[] { "32", "64", "128", "256" })); |
|
200 |
gridBagConstraints = new GridBagConstraints(); |
|
201 |
gridBagConstraints.gridx = 1; |
|
202 |
gridBagConstraints.gridy = 2; |
|
203 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
|
204 |
gridBagConstraints.weightx = 1.0; |
|
205 |
gridBagConstraints.insets = new Insets(2, 2, 2, 5); |
|
206 |
jPanel4.add(jComboBox2, gridBagConstraints); |
|
207 |
|
|
208 |
jCheckBox6.setText("Pedir las coordenadas de georreferenciaci\u00f3n al cargar un raster que no lo tengo"); |
|
209 |
jCheckBox6.setToolTipText("Pedir las coordenadas de georreferenciaci\u00f3n al cargar un raster que no lo tengo"); |
|
210 |
jCheckBox6.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
211 |
jCheckBox6.setMargin(new Insets(0, 0, 0, 0)); |
|
212 |
gridBagConstraints = new GridBagConstraints(); |
|
213 |
gridBagConstraints.gridx = 0; |
|
214 | 97 |
gridBagConstraints.gridy = 3; |
215 |
gridBagConstraints.gridwidth = 2; |
|
216 | 98 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
217 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
|
218 |
gridBagConstraints.insets = new Insets(2, 5, 5, 5); |
|
219 |
jPanel4.add(jCheckBox6, gridBagConstraints); |
|
99 |
panel.add(getPreferenceTemporal().getPanel(), gridBagConstraints); |
|
220 | 100 |
|
221 | 101 |
gridBagConstraints = new GridBagConstraints(); |
222 | 102 |
gridBagConstraints.gridx = 0; |
223 |
gridBagConstraints.gridy = 0;
|
|
103 |
gridBagConstraints.gridy = 4;
|
|
224 | 104 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
225 |
jPanel5.add(jPanel4, gridBagConstraints);
|
|
105 |
panel.add(getPreferenceOverviews().getPanel(), gridBagConstraints);
|
|
226 | 106 |
|
227 |
jPanel7.setLayout(new GridBagLayout()); |
|
228 |
|
|
229 |
jPanel7.setBorder(BorderFactory.createTitledBorder("Carga de capas")); |
|
230 |
jLabel9.setText("Al cargar una imagen no RGB, aplicarle:"); |
|
231 |
jLabel9.setToolTipText("Al cargar una imagen No RGB"); |
|
232 | 107 |
gridBagConstraints = new GridBagConstraints(); |
233 | 108 |
gridBagConstraints.gridx = 0; |
234 |
gridBagConstraints.gridy = 0; |
|
235 |
gridBagConstraints.gridwidth = 2; |
|
109 |
gridBagConstraints.gridy = 5; |
|
236 | 110 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
237 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
|
238 |
gridBagConstraints.insets = new Insets(5, 5, 2, 5); |
|
239 |
jPanel7.add(jLabel9, gridBagConstraints); |
|
111 |
panel.add(getPreferenceCache().getPanel(), gridBagConstraints); |
|
240 | 112 |
|
241 |
buttonGroup1.add(jRadioButton1); |
|
242 |
jRadioButton1.setSelected(true); |
|
243 |
jRadioButton1.setText("Realce"); |
|
244 |
jRadioButton1.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
245 |
jRadioButton1.setMargin(new Insets(0, 0, 0, 0)); |
|
246 | 113 |
gridBagConstraints = new GridBagConstraints(); |
247 | 114 |
gridBagConstraints.gridx = 0; |
248 |
gridBagConstraints.gridy = 1; |
|
249 |
gridBagConstraints.gridwidth = 2; |
|
250 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
|
251 |
gridBagConstraints.insets = new Insets(2, 5, 2, 5); |
|
252 |
jPanel7.add(jRadioButton1, gridBagConstraints); |
|
253 |
|
|
254 |
buttonGroup1.add(jRadioButton2); |
|
255 |
jRadioButton2.setText("Tabla de color"); |
|
256 |
jRadioButton2.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
257 |
jRadioButton2.setMargin(new Insets(0, 0, 0, 0)); |
|
258 |
gridBagConstraints = new GridBagConstraints(); |
|
259 |
gridBagConstraints.gridx = 0; |
|
260 |
gridBagConstraints.gridy = 2; |
|
261 |
gridBagConstraints.anchor = GridBagConstraints.WEST; |
|
262 |
gridBagConstraints.insets = new Insets(2, 5, 5, 2); |
|
263 |
jPanel7.add(jRadioButton2, gridBagConstraints); |
|
264 |
|
|
265 |
gridBagConstraints = new GridBagConstraints(); |
|
266 |
gridBagConstraints.gridx = 1; |
|
267 |
gridBagConstraints.gridy = 2; |
|
268 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
|
115 |
gridBagConstraints.gridy = 6; |
|
269 | 116 |
gridBagConstraints.weightx = 1.0; |
270 |
gridBagConstraints.insets = new Insets(2, 2, 5, 5);
|
|
271 |
jPanel7.add(jComboBox3, gridBagConstraints);
|
|
117 |
gridBagConstraints.weighty = 1.0;
|
|
118 |
panel.add(new JPanel(), gridBagConstraints);
|
|
272 | 119 |
|
273 |
gridBagConstraints = new GridBagConstraints(); |
|
274 |
gridBagConstraints.gridx = 0; |
|
275 |
gridBagConstraints.gridy = 1; |
|
276 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
|
277 |
jPanel5.add(jPanel7, gridBagConstraints); |
|
120 |
panel.setBorder(new EmptyBorder(5, 5, 5, 5)); |
|
278 | 121 |
|
279 |
gridBagConstraints = new GridBagConstraints(); |
|
280 |
gridBagConstraints.gridx = 0; |
|
281 |
gridBagConstraints.gridy = 4; |
|
282 |
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
|
283 |
jPanel5.add(getPreferenceOverviews().getPanel(), gridBagConstraints); |
|
122 |
scrollPane.setViewportView(panel); |
|
284 | 123 |
|
285 |
jScrollPane1.setViewportView(jPanel5); |
|
286 |
|
|
287 |
this.setLayout(new BorderLayout()); |
|
288 |
this.add(jScrollPane1, BorderLayout.CENTER); |
|
124 |
setLayout(new BorderLayout()); |
|
125 |
add(scrollPane, BorderLayout.CENTER); |
|
289 | 126 |
} |
290 | 127 |
|
291 | 128 |
private PreferenceNoData getPreferenceNoData() { |
... | ... | |
295 | 132 |
return noData; |
296 | 133 |
} |
297 | 134 |
|
135 |
private PreferenceGeneral getPreferenceGeneral() { |
|
136 |
if (general == null) { |
|
137 |
general = new PreferenceGeneral(); |
|
138 |
} |
|
139 |
return general; |
|
140 |
} |
|
141 |
|
|
298 | 142 |
private PreferenceOverviews getPreferenceOverviews() { |
299 | 143 |
if (overviews == null) { |
300 | 144 |
overviews = new PreferenceOverviews(); |
... | ... | |
309 | 153 |
return cache; |
310 | 154 |
} |
311 | 155 |
|
156 |
private PreferenceTemporal getPreferenceTemporal() { |
|
157 |
if (temporal == null) { |
|
158 |
temporal = new PreferenceTemporal(); |
|
159 |
} |
|
160 |
return temporal; |
|
161 |
} |
|
162 |
|
|
163 |
private PreferenceLoadLayer getPreferenceLoadLayer() { |
|
164 |
if (loadLayer == null) { |
|
165 |
loadLayer = new PreferenceLoadLayer(); |
|
166 |
} |
|
167 |
return loadLayer; |
|
168 |
} |
|
169 |
|
|
312 | 170 |
/* |
313 | 171 |
* (non-Javadoc) |
314 | 172 |
* @see com.iver.andami.preferences.IPreference#initializeValues() |
... | ... | |
317 | 175 |
getPreferenceNoData().initializeValues(); |
318 | 176 |
getPreferenceOverviews().initializeValues(); |
319 | 177 |
getPreferenceCache().initializeValues(); |
178 |
getPreferenceTemporal().initializeValues(); |
|
179 |
getPreferenceGeneral().initializeValues(); |
|
180 |
getPreferenceLoadLayer().initializeValues(); |
|
320 | 181 |
} |
321 | 182 |
|
322 | 183 |
/* |
... | ... | |
327 | 188 |
getPreferenceNoData().storeValues(); |
328 | 189 |
getPreferenceOverviews().storeValues(); |
329 | 190 |
getPreferenceCache().storeValues(); |
191 |
getPreferenceTemporal().storeValues(); |
|
192 |
getPreferenceGeneral().storeValues(); |
|
193 |
getPreferenceLoadLayer().storeValues(); |
|
330 | 194 |
} |
331 | 195 |
|
332 | 196 |
/* |
... | ... | |
337 | 201 |
getPreferenceNoData().initializeDefaults(); |
338 | 202 |
getPreferenceOverviews().initializeDefaults(); |
339 | 203 |
getPreferenceCache().initializeDefaults(); |
204 |
getPreferenceTemporal().initializeDefaults(); |
|
205 |
getPreferenceGeneral().initializeDefaults(); |
|
206 |
getPreferenceLoadLayer().initializeDefaults(); |
|
340 | 207 |
} |
341 | 208 |
|
342 | 209 |
/* |
Also available in: Unified diff