svn-gvsig-desktop / trunk / extensions / extRasterTools-SE / src / org / gvsig / rastertools / RasterModule.java @ 30938
History | View | Annotate | Download (20 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*/
|
19 |
package org.gvsig.rastertools; |
20 |
|
21 |
import java.util.ArrayList; |
22 |
import java.util.prefs.Preferences; |
23 |
|
24 |
import org.gvsig.fmap.raster.layers.FLyrRasterSE; |
25 |
import org.gvsig.fmap.raster.layers.StatusLayerRaster; |
26 |
import org.gvsig.raster.Configuration; |
27 |
import org.gvsig.raster.ConfigurationEvent; |
28 |
import org.gvsig.raster.ConfigurationListener; |
29 |
import org.gvsig.raster.RasterLibrary; |
30 |
import org.gvsig.raster.filter.grayscale.GrayScaleManager; |
31 |
import org.gvsig.raster.filter.mask.MaskListManager; |
32 |
import org.gvsig.raster.filter.regionalpha.RegionAlphaListManager; |
33 |
import org.gvsig.raster.gui.preferences.RasterPreferences; |
34 |
import org.gvsig.raster.gui.wizards.FileOpenRaster; |
35 |
import org.gvsig.raster.util.RasterToolsUtil; |
36 |
import org.gvsig.rastertools.properties.RasterPropertiesTocMenuEntry; |
37 |
import org.gvsig.rastertools.properties.panels.BandSelectorPanel; |
38 |
import org.gvsig.rastertools.properties.panels.EnhancedPanel; |
39 |
import org.gvsig.rastertools.properties.panels.GeneralPanel; |
40 |
import org.gvsig.rastertools.properties.panels.InfoPanel; |
41 |
import org.gvsig.rastertools.properties.panels.TransparencyPanel; |
42 |
import org.gvsig.rastertools.rasterresolution.ZoomPixelCursorTocMenuEntry; |
43 |
import org.gvsig.rastertools.saveas.SaveAsTocMenuEntry; |
44 |
|
45 |
import com.iver.andami.PluginServices; |
46 |
import com.iver.andami.plugins.Extension; |
47 |
import com.iver.andami.ui.mdiManager.IWindow; |
48 |
import com.iver.cit.gvsig.fmap.MapContext; |
49 |
import com.iver.cit.gvsig.fmap.MapControl; |
50 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
51 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
52 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory; |
53 |
import com.iver.cit.gvsig.project.documents.view.IProjectView; |
54 |
import com.iver.cit.gvsig.project.documents.view.gui.BaseView; |
55 |
import com.iver.cit.gvsig.project.documents.view.gui.View; |
56 |
import com.iver.cit.gvsig.project.documents.view.toc.ITocItem; |
57 |
import com.iver.utiles.extensionPoints.ExtensionPoint; |
58 |
import com.iver.utiles.extensionPoints.ExtensionPoints; |
59 |
import com.iver.utiles.extensionPoints.ExtensionPointsSingleton; |
60 |
/**
|
61 |
* Extensi?n que adapta a FMap y gvSIG la nueva implementaci?n de raster. Para
|
62 |
* el cuadro de Propiedades de visualizaci?n de raster contiene el contenedor
|
63 |
* base se registran la entrada del men? del TOC y los paneles en el cuadro.
|
64 |
* Para la parte de FMap contiene una nueva capa raster y los drivers
|
65 |
* necesarios.
|
66 |
*
|
67 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
68 |
*/
|
69 |
public class RasterModule extends Extension implements ConfigurationListener { |
70 |
|
71 |
/**
|
72 |
* Indica si en el panel de preferencias se refresca automaticamente la vista
|
73 |
* para mostrar los cambios
|
74 |
*/
|
75 |
public static boolean autoRefreshView = true; |
76 |
|
77 |
/**
|
78 |
* Indica si se debe preguntar las coordenadas al cargar una capa que no las
|
79 |
* tenga
|
80 |
*/
|
81 |
public static boolean askCoordinates = false; |
82 |
|
83 |
/*
|
84 |
* (non-Javadoc)
|
85 |
* @see com.iver.andami.plugins.IExtension#execute(java.lang.String)
|
86 |
*/
|
87 |
public void execute(String actionCommand) { |
88 |
|
89 |
} |
90 |
|
91 |
/*
|
92 |
* (non-Javadoc)
|
93 |
* @see com.iver.andami.plugins.IExtension#initialize()
|
94 |
*/
|
95 |
public void initialize() { |
96 |
// Asignamos la configuracion global a FlyrRasterSE
|
97 |
FLyrRasterSE.setConfiguration(Configuration.getSingleton());
|
98 |
|
99 |
Configuration.addValueChangedListener(this); |
100 |
loadConfigurationValues(); |
101 |
|
102 |
registerIcons(); |
103 |
RasterLibrary.wakeUp(); |
104 |
|
105 |
// DiagSignalHandler.install("ALRM");
|
106 |
|
107 |
Preferences prefs = Preferences.userRoot().node("gvsig.foldering"); |
108 |
prefs.put("DataFolder", System.getProperty("user.home")); |
109 |
|
110 |
ExtensionPoints extensionPoints = ExtensionPointsSingleton.getInstance(); |
111 |
|
112 |
// Creaci?n del punto de extensi?n para registrar paneles en el cuadro de propiedades.
|
113 |
if (!extensionPoints.containsKey("RasterSEPropertiesDialog")) { |
114 |
extensionPoints.put(new ExtensionPoint("RasterSEPropertiesDialog", "Raster Properties registrable panels (register instances of javax.swing.JPanel)")); |
115 |
} |
116 |
|
117 |
// A?adimos la configuracion de Raster a gvSIG
|
118 |
extensionPoints.add("AplicationPreferences","RasterPreferences", new RasterPreferences()); |
119 |
|
120 |
// A?adimos paneles al cuadro de propiedades.
|
121 |
extensionPoints.add("RasterSEPropertiesDialog", "info", InfoPanel.class); |
122 |
extensionPoints.add("RasterSEPropertiesDialog", "bands_panel", BandSelectorPanel.class); |
123 |
extensionPoints.add("RasterSEPropertiesDialog", "transparencia", TransparencyPanel.class); |
124 |
extensionPoints.add("RasterSEPropertiesDialog", "realce", EnhancedPanel.class); |
125 |
//extensionPoints.add("RasterSEPropertiesDialog", "pansharp", PanSharpeningPanel.class);
|
126 |
extensionPoints.add("RasterSEPropertiesDialog", "general_panel", GeneralPanel.class); |
127 |
|
128 |
// A?adimos las entradas del men? del toc de raster
|
129 |
extensionPoints.add("View_TocActions", "RasterSEProperties", RasterPropertiesTocMenuEntry.getSingleton()); |
130 |
extensionPoints.add("View_TocActions", "SaveAs", SaveAsTocMenuEntry.getSingleton()); |
131 |
extensionPoints.add("View_TocActions", "ZoomPixelCursor", new ZoomPixelCursorTocMenuEntry()); |
132 |
|
133 |
// A?adimos nuestra extension para el tratamiento de la apertura de ficheros mdentro de gvSIG
|
134 |
extensionPoints.add("FileExtendingOpenDialog", "FileOpenRaster", FileOpenRaster.class); |
135 |
|
136 |
//Alias
|
137 |
LayerFactory.registerLayerClassForName("com.iver.cit.gvsig.fmap.layers.FLyrRaster", FLyrRasterSE.class);
|
138 |
LayerFactory.registerLayerClassForName("com.iver.cit.gvsig.fmap.layers.StatusLayerRaster", StatusLayerRaster.class);
|
139 |
|
140 |
// Registrar filtros
|
141 |
RegionAlphaListManager.register(); |
142 |
MaskListManager.register(); |
143 |
GrayScaleManager.register(); |
144 |
} |
145 |
|
146 |
/**
|
147 |
* Registra los iconos a utilizar en andami.
|
148 |
*/
|
149 |
private void registerIcons(){ |
150 |
PluginServices.getIconTheme().registerDefault( |
151 |
"forward-icon",
|
152 |
this.getClass().getClassLoader().getResource("images/forward.png") |
153 |
); |
154 |
PluginServices.getIconTheme().registerDefault( |
155 |
"backward-icon",
|
156 |
this.getClass().getClassLoader().getResource("images/backward.png") |
157 |
); |
158 |
PluginServices.getIconTheme().registerDefault( |
159 |
"map-ok-ico",
|
160 |
MapControl.class.getResource("images/map_ico_ok.gif")
|
161 |
); |
162 |
PluginServices.getIconTheme().registerDefault( |
163 |
"crux-cursor",
|
164 |
MapControl.class.getResource("images/CruxCursor.png")
|
165 |
); |
166 |
PluginServices.getIconTheme().registerDefault( |
167 |
"blank-icon",
|
168 |
getClass().getClassLoader().getResource("images/blank.png")
|
169 |
); |
170 |
PluginServices.getIconTheme().registerDefault( |
171 |
"addlayer-icon",
|
172 |
this.getClass().getClassLoader().getResource("images/addlayer.png") |
173 |
); |
174 |
PluginServices.getIconTheme().registerDefault( |
175 |
"delall-icon",
|
176 |
this.getClass().getClassLoader().getResource("images/delall.png") |
177 |
); |
178 |
PluginServices.getIconTheme().registerDefault( |
179 |
"rotar-icon",
|
180 |
this.getClass().getClassLoader().getResource("images/Rotar.gif") |
181 |
); |
182 |
PluginServices.getIconTheme().registerDefault( |
183 |
"hor-arrow-icon",
|
184 |
this.getClass().getClassLoader().getResource("images/FlechaHorizCursor.gif") |
185 |
); |
186 |
PluginServices.getIconTheme().registerDefault( |
187 |
"ver-arrow-icon",
|
188 |
this.getClass().getClassLoader().getResource("images/FlechaVertCursor.gif") |
189 |
); |
190 |
PluginServices.getIconTheme().registerDefault( |
191 |
"inclder-arrow-icon",
|
192 |
this.getClass().getClassLoader().getResource("images/FlechaInclDerCursor.gif") |
193 |
); |
194 |
PluginServices.getIconTheme().registerDefault( |
195 |
"inclizq-arrow-icon",
|
196 |
this.getClass().getClassLoader().getResource("images/FlechaInclIzqCursor.gif") |
197 |
); |
198 |
PluginServices.getIconTheme().registerDefault( |
199 |
"shear-y-icon",
|
200 |
this.getClass().getClassLoader().getResource("images/y.gif") |
201 |
); |
202 |
PluginServices.getIconTheme().registerDefault( |
203 |
"shear-x-icon",
|
204 |
this.getClass().getClassLoader().getResource("images/x.gif") |
205 |
); |
206 |
PluginServices.getIconTheme().registerDefault( |
207 |
"hand-icon",
|
208 |
this.getClass().getClassLoader().getResource("images/Hand.gif") |
209 |
); |
210 |
PluginServices.getIconTheme().registerDefault( |
211 |
"back-icon",
|
212 |
this.getClass().getClassLoader().getResource("images/back.png") |
213 |
); |
214 |
PluginServices.getIconTheme().registerDefault( |
215 |
"next-icon",
|
216 |
this.getClass().getClassLoader().getResource("images/next.png") |
217 |
); |
218 |
PluginServices.getIconTheme().registerDefault( |
219 |
"undo-icon",
|
220 |
this.getClass().getClassLoader().getResource("images/undo.png") |
221 |
); |
222 |
PluginServices.getIconTheme().registerDefault( |
223 |
"zoom-pixel-cursor",
|
224 |
this.getClass().getClassLoader().getResource("images/ZoomPixelCursor.gif") |
225 |
); |
226 |
PluginServices.getIconTheme().registerDefault( |
227 |
"save-raster",
|
228 |
this.getClass().getClassLoader().getResource("images/Rectangle.png") |
229 |
); |
230 |
PluginServices.getIconTheme().registerDefault( |
231 |
"pixel-increase",
|
232 |
this.getClass().getClassLoader().getResource("images/increase.png") |
233 |
); |
234 |
PluginServices.getIconTheme().registerDefault( |
235 |
"select-raster",
|
236 |
this.getClass().getClassLoader().getResource("images/stock_toggle-info.png") |
237 |
); |
238 |
PluginServices.getIconTheme().registerDefault( |
239 |
"select-raster",
|
240 |
this.getClass().getClassLoader().getResource("images/stock_toggle-info.png") |
241 |
); |
242 |
PluginServices.getIconTheme().registerDefault( |
243 |
"export-icon",
|
244 |
this.getClass().getClassLoader().getResource("images/export.png") |
245 |
); |
246 |
PluginServices.getIconTheme().registerDefault( |
247 |
"pref-raster-icon",
|
248 |
this.getClass().getClassLoader().getResource("images/raster-pref.png") |
249 |
); |
250 |
PluginServices.getIconTheme().registerDefault( |
251 |
"import-icon",
|
252 |
this.getClass().getClassLoader().getResource("images/import.png") |
253 |
); |
254 |
PluginServices.getIconTheme().registerDefault( |
255 |
"save-icon",
|
256 |
this.getClass().getClassLoader().getResource("images/savefile.png") |
257 |
); |
258 |
PluginServices.getIconTheme().registerDefault( |
259 |
"reset-icon",
|
260 |
this.getClass().getClassLoader().getResource("images/reset.png") |
261 |
); |
262 |
PluginServices.getIconTheme().registerDefault( |
263 |
"tfwload-icon",
|
264 |
this.getClass().getClassLoader().getResource("images/load.png") |
265 |
); |
266 |
PluginServices.getIconTheme().registerDefault( |
267 |
"centerraster-icon",
|
268 |
this.getClass().getClassLoader().getResource("images/center_image.png") |
269 |
); |
270 |
PluginServices.getIconTheme().registerDefault( |
271 |
"increase-icon",
|
272 |
this.getClass().getClassLoader().getResource("images/aumentar.png") |
273 |
); |
274 |
PluginServices.getIconTheme().registerDefault( |
275 |
"decrease-icon",
|
276 |
this.getClass().getClassLoader().getResource("images/disminuir.png") |
277 |
); |
278 |
PluginServices.getIconTheme().registerDefault( |
279 |
"selectzoomarea-icon",
|
280 |
this.getClass().getClassLoader().getResource("images/view-zoom-to-seleccion.png") |
281 |
); |
282 |
PluginServices.getIconTheme().registerDefault( |
283 |
"prevzoom-icon",
|
284 |
this.getClass().getClassLoader().getResource("images/view-zoom-back.png") |
285 |
); |
286 |
PluginServices.getIconTheme().registerDefault( |
287 |
"fullview-icon",
|
288 |
this.getClass().getClassLoader().getResource("images/view-zoom-map-contents.png") |
289 |
); |
290 |
PluginServices.getIconTheme().register( |
291 |
"geolocalization-icon",
|
292 |
this.getClass().getClassLoader().getResource("images/georef.png") |
293 |
); |
294 |
PluginServices.getIconTheme().register( |
295 |
"exporttoascii-icon",
|
296 |
this.getClass().getClassLoader().getResource("images/exportToAscii.png") |
297 |
); |
298 |
PluginServices.getIconTheme().register( |
299 |
"exporttocsv-icon",
|
300 |
this.getClass().getClassLoader().getResource("images/exportToCSV.png") |
301 |
); |
302 |
PluginServices.getIconTheme().register( |
303 |
"importfromcsv-icon",
|
304 |
this.getClass().getClassLoader().getResource("images/importFromCSV.png") |
305 |
); |
306 |
PluginServices.getIconTheme().register( |
307 |
"exit-icon",
|
308 |
this.getClass().getClassLoader().getResource("images/ico_exit.gif") |
309 |
); |
310 |
PluginServices.getIconTheme().register( |
311 |
"options-icon",
|
312 |
this.getClass().getClassLoader().getResource("images/ico_options.gif") |
313 |
); |
314 |
PluginServices.getIconTheme().register( |
315 |
"add-icon",
|
316 |
this.getClass().getClassLoader().getResource("images/add-ico.gif") |
317 |
); |
318 |
PluginServices.getIconTheme().register( |
319 |
"centerpoint-icon",
|
320 |
this.getClass().getClassLoader().getResource("images/icon_centerpoint.gif") |
321 |
); |
322 |
PluginServices.getIconTheme().register( |
323 |
"hand-icon",
|
324 |
this.getClass().getClassLoader().getResource("images/Hand.gif") |
325 |
); |
326 |
PluginServices.getIconTheme().register( |
327 |
"analisis-icon",
|
328 |
this.getClass().getClassLoader().getResource("images/prismaticos.gif") |
329 |
); |
330 |
PluginServices.getIconTheme().registerDefault( |
331 |
"clipping-icon",
|
332 |
getClass().getClassLoader().getResource("images/clipping.gif")
|
333 |
); |
334 |
PluginServices.getIconTheme().registerDefault( |
335 |
"filter-icon",
|
336 |
getClass().getClassLoader().getResource("images/raster-filter.png")
|
337 |
); |
338 |
PluginServices.getIconTheme().registerDefault( |
339 |
"histogram-icon",
|
340 |
getClass().getClassLoader().getResource("images/histogram.png")
|
341 |
); |
342 |
PluginServices.getIconTheme().registerDefault( |
343 |
"overviews-icon",
|
344 |
getClass().getClassLoader().getResource("images/overviews.gif")
|
345 |
); |
346 |
PluginServices.getIconTheme().registerDefault( |
347 |
"properties-icon",
|
348 |
getClass().getClassLoader().getResource("images/properties.gif")
|
349 |
); |
350 |
PluginServices.getIconTheme().registerDefault( |
351 |
"colortable-icon",
|
352 |
getClass().getClassLoader().getResource("images/colortable.png")
|
353 |
); |
354 |
PluginServices.getIconTheme().registerDefault( |
355 |
"rois-icon",
|
356 |
getClass().getClassLoader().getResource("images/rois.png")
|
357 |
); |
358 |
PluginServices.getIconTheme().registerDefault( |
359 |
"brush-icon",
|
360 |
getClass().getClassLoader().getResource("images/brush.png")
|
361 |
); |
362 |
PluginServices.getIconTheme().registerDefault( |
363 |
"selectrgb-icon",
|
364 |
getClass().getClassLoader().getResource("images/select_rgb.gif")
|
365 |
); |
366 |
PluginServices.getIconTheme().registerDefault( |
367 |
"reproj-icon",
|
368 |
getClass().getClassLoader().getResource("images/reproject.png")
|
369 |
); |
370 |
PluginServices.getIconTheme().registerDefault( |
371 |
"vectorization-icon",
|
372 |
getClass().getClassLoader().getResource("images/vectorT.png")
|
373 |
); |
374 |
PluginServices.getIconTheme().registerDefault( |
375 |
"focus-icon",
|
376 |
getClass().getClassLoader().getResource("images/focus.png")
|
377 |
); |
378 |
} |
379 |
/*
|
380 |
* (non-Javadoc)
|
381 |
* @see com.iver.andami.plugins.IExtension#isEnabled()
|
382 |
*/
|
383 |
public boolean isEnabled() { |
384 |
com.iver.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager().getActiveWindow(); |
385 |
if (f == null) { |
386 |
return false; |
387 |
} |
388 |
if (f.getClass() == View.class) { |
389 |
BaseView vista = (BaseView) f; |
390 |
IProjectView model = vista.getModel(); |
391 |
MapContext mapa = model.getMapContext(); |
392 |
FLayers layers = mapa.getLayers(); |
393 |
for (int i = 0; i < layers.getLayersCount(); i++) |
394 |
if (layers.getLayer(i) instanceof FLyrRasterSE) |
395 |
return true; |
396 |
} |
397 |
return false; |
398 |
} |
399 |
|
400 |
/**
|
401 |
* Mostramos el control si hay alguna capa cargada.
|
402 |
*/
|
403 |
public boolean isVisible() { |
404 |
com.iver.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager().getActiveWindow(); |
405 |
if (f == null) |
406 |
return false; |
407 |
|
408 |
if (f instanceof View) { |
409 |
View vista = (View) f; |
410 |
IProjectView model = vista.getModel(); |
411 |
MapContext mapa = model.getMapContext(); |
412 |
if (mapa.getLayers().getLayersCount() > 0) |
413 |
return true; |
414 |
} |
415 |
|
416 |
return false; |
417 |
} |
418 |
|
419 |
/**
|
420 |
* Carga los valores de configuracion iniciales
|
421 |
*/
|
422 |
private void loadConfigurationValues() { |
423 |
autoRefreshView = Configuration.getValue("general_auto_preview", Boolean.TRUE).booleanValue(); |
424 |
askCoordinates = Configuration.getValue("general_ask_coordinates", Boolean.FALSE).booleanValue(); |
425 |
RasterLibrary.defaultNumberOfClasses = Configuration.getValue("general_defaultNumberOfClasses", Integer.valueOf(RasterLibrary.defaultNumberOfClasses)).intValue(); |
426 |
RasterLibrary.cacheSize = Configuration.getValue("cache_size", Long.valueOf(RasterLibrary.cacheSize)).longValue(); |
427 |
RasterLibrary.pageSize = Configuration.getValue("cache_pagesize", Double.valueOf(RasterLibrary.pageSize)).doubleValue(); |
428 |
RasterLibrary.pagsPerGroup = Configuration.getValue("cache_pagspergroup", Integer.valueOf(RasterLibrary.pagsPerGroup)).intValue(); |
429 |
RasterLibrary.blockHeight = Configuration.getValue("cache_blockheight", Integer.valueOf(RasterLibrary.blockHeight)).intValue(); |
430 |
RasterLibrary.defaultNoDataValue = Configuration.getValue("nodata_value", Double.valueOf(RasterLibrary.defaultNoDataValue)).doubleValue(); |
431 |
} |
432 |
|
433 |
/*
|
434 |
* (non-Javadoc)
|
435 |
* @see org.gvsig.raster.util.ConfigurationListener#actionConfigurationChanged(org.gvsig.raster.util.ConfigurationEvent)
|
436 |
*/
|
437 |
public void actionConfigurationChanged(ConfigurationEvent e) { |
438 |
if (e.getKey().equals("nodata_transparency_enabled")) { |
439 |
boolean noDataTransparent = ((Boolean) e.getValue()).booleanValue(); |
440 |
IWindow[] f = PluginServices.getMDIManager().getAllWindows();
|
441 |
if (f == null) |
442 |
return;
|
443 |
for (int i = 0; i < f.length; i++) { |
444 |
if (f[i] instanceof View) { |
445 |
View vista = (View) f[i]; |
446 |
IProjectView model = vista.getModel(); |
447 |
MapContext map = model.getMapContext(); |
448 |
FLayers lyrs = map.getLayers(); |
449 |
|
450 |
ArrayList list = RasterToolsUtil.getRasterLayerList(lyrs, null); |
451 |
for (int j = 0; j < list.size(); j++) { |
452 |
if(list.get(j) instanceof FLyrRasterSE) |
453 |
((FLyrRasterSE)list.get(j)).getDataSource().getTransparencyFilesStatus().activeNoData(noDataTransparent); |
454 |
} |
455 |
} |
456 |
} |
457 |
|
458 |
return;
|
459 |
} |
460 |
|
461 |
if (e.getKey().equals("general_auto_preview")) { |
462 |
if(e.getValue() instanceof String) |
463 |
autoRefreshView = new Boolean((String) e.getValue()).booleanValue(); |
464 |
if(e.getValue() instanceof Boolean) |
465 |
autoRefreshView = ((Boolean) e.getValue()).booleanValue();
|
466 |
return;
|
467 |
} |
468 |
|
469 |
if (e.getKey().equals("general_ask_coordinates")) { |
470 |
if(e.getValue() instanceof String) |
471 |
askCoordinates = new Boolean((String) e.getValue()).booleanValue(); |
472 |
if(e.getValue() instanceof Boolean) |
473 |
askCoordinates = ((Boolean) e.getValue()).booleanValue();
|
474 |
return;
|
475 |
} |
476 |
|
477 |
if (e.getKey().equals("general_defaultNumberOfClasses")) { |
478 |
if(e.getValue() instanceof String) |
479 |
RasterLibrary.defaultNumberOfClasses = new Integer((String) e.getValue()).intValue(); |
480 |
if(e.getValue() instanceof Integer) |
481 |
RasterLibrary.defaultNumberOfClasses = ((Integer) e.getValue()).intValue();
|
482 |
return;
|
483 |
} |
484 |
|
485 |
if (e.getKey().equals("cache_size")) { |
486 |
if(e.getValue() instanceof String) |
487 |
RasterLibrary.cacheSize = new Long((String) e.getValue()).longValue(); |
488 |
if(e.getValue() instanceof Long) |
489 |
RasterLibrary.cacheSize = ((Long) e.getValue()).longValue();
|
490 |
return;
|
491 |
} |
492 |
|
493 |
if (e.getKey().equals("cache_pagesize")) { |
494 |
if(e.getValue() instanceof String) |
495 |
RasterLibrary.pageSize = new Double((String) e.getValue()).doubleValue(); |
496 |
if(e.getValue() instanceof Double) |
497 |
RasterLibrary.pageSize = ((Double) e.getValue()).doubleValue();
|
498 |
return;
|
499 |
} |
500 |
|
501 |
if (e.getKey().equals("cache_pagspergroup")) { |
502 |
if(e.getValue() instanceof String) |
503 |
RasterLibrary.pagsPerGroup = new Integer((String) e.getValue()).intValue(); |
504 |
if(e.getValue() instanceof Integer) |
505 |
RasterLibrary.pagsPerGroup = ((Integer) e.getValue()).intValue();
|
506 |
return;
|
507 |
} |
508 |
|
509 |
if (e.getKey().equals("cache_blockheight")) { |
510 |
if(e.getValue() instanceof String) |
511 |
RasterLibrary.blockHeight = new Integer((String) e.getValue()).intValue(); |
512 |
if(e.getValue() instanceof Integer) |
513 |
RasterLibrary.blockHeight = ((Integer) e.getValue()).intValue();
|
514 |
return;
|
515 |
} |
516 |
|
517 |
if (e.getKey().equals("nodata_value")) { |
518 |
if(e.getValue() instanceof String) |
519 |
RasterLibrary.defaultNoDataValue = new Double((String) e.getValue()).doubleValue(); |
520 |
if(e.getValue() instanceof Double) |
521 |
RasterLibrary.defaultNoDataValue = ((Double) e.getValue()).doubleValue();
|
522 |
return;
|
523 |
} |
524 |
} |
525 |
|
526 |
/*
|
527 |
* (non-Javadoc)
|
528 |
* @see org.gvsig.raster.gui.IGenericToolBarMenuItem#execute(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
|
529 |
*/
|
530 |
public void execute(ITocItem item, FLayer[] selectedItems) { |
531 |
this.execute("SELECTIMAGE"); |
532 |
} |
533 |
} |