svn-gvsig-desktop / trunk / extensions / extRasterTools-SE / src / org / gvsig / rastertools / RasterModule.java @ 18014
History | View | Annotate | Download (19 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.gui.preferences.RasterPreferences; |
31 |
import org.gvsig.raster.gui.properties.dialog.RasterPropertiesTocMenuEntry; |
32 |
import org.gvsig.raster.gui.wizards.FileOpenRaster; |
33 |
import org.gvsig.rastertools.analysisview.ViewRasterAnalysisTocMenuEntry; |
34 |
import org.gvsig.rastertools.clipping.ClippingTocMenuEntry; |
35 |
import org.gvsig.rastertools.colortable.ColorTableTocMenuEntry; |
36 |
import org.gvsig.rastertools.filter.FilterTocMenuEntry; |
37 |
import org.gvsig.rastertools.geolocation.GeoLocationTocMenuEntry; |
38 |
import org.gvsig.rastertools.histogram.HistogramTocMenuEntry; |
39 |
import org.gvsig.rastertools.overviews.OverviewsTocMenuEntry; |
40 |
import org.gvsig.rastertools.properties.panels.BandSetupPanel; |
41 |
import org.gvsig.rastertools.properties.panels.EnhancedPanel; |
42 |
import org.gvsig.rastertools.properties.panels.InfoPanel; |
43 |
import org.gvsig.rastertools.properties.panels.PanSharpeningPanel; |
44 |
import org.gvsig.rastertools.properties.panels.ScalePanel; |
45 |
import org.gvsig.rastertools.properties.panels.StatisticsPanel; |
46 |
import org.gvsig.rastertools.properties.panels.TransparencyPanel; |
47 |
import org.gvsig.rastertools.rasterresolution.ZoomPixelCursorTocMenuEntry; |
48 |
import org.gvsig.rastertools.roi.ui.ROIManagerTocMenuEntry; |
49 |
import org.gvsig.rastertools.saveas.SaveAsTocMenuEntry; |
50 |
import org.gvsig.rastertools.selectrasterlayer.SelectImageListener; |
51 |
|
52 |
import com.iver.andami.PluginServices; |
53 |
import com.iver.andami.plugins.Extension; |
54 |
import com.iver.cit.gvsig.fmap.MapContext; |
55 |
import com.iver.cit.gvsig.fmap.MapControl; |
56 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
57 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory; |
58 |
import com.iver.cit.gvsig.fmap.tools.Behavior.Behavior; |
59 |
import com.iver.cit.gvsig.fmap.tools.Behavior.MouseMovementBehavior; |
60 |
import com.iver.cit.gvsig.fmap.tools.Behavior.PointBehavior; |
61 |
import com.iver.cit.gvsig.project.documents.view.IProjectView; |
62 |
import com.iver.cit.gvsig.project.documents.view.gui.View; |
63 |
import com.iver.cit.gvsig.project.documents.view.toolListeners.StatusBarListener; |
64 |
import com.iver.utiles.extensionPoints.ExtensionPoint; |
65 |
import com.iver.utiles.extensionPoints.ExtensionPoints; |
66 |
import com.iver.utiles.extensionPoints.ExtensionPointsSingleton; |
67 |
/**
|
68 |
* Extensi?n que adapta a FMap y gvSIG la nueva implementaci?n de raster. Para
|
69 |
* el cuadro de Propiedades de visualizaci?n de raster contiene el contenedor
|
70 |
* base se registran la entrada del men? del TOC y los paneles en el cuadro.
|
71 |
* Para la parte de FMap contiene una nueva capa raster y los drivers
|
72 |
* necesarios.
|
73 |
*
|
74 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
75 |
*/
|
76 |
public class RasterModule extends Extension implements ConfigurationListener { |
77 |
/**
|
78 |
* Contador global de las capas generadas para raster
|
79 |
*/
|
80 |
private static int layerCount = 1; |
81 |
private static ArrayList propetiesListeners = new ArrayList(); |
82 |
|
83 |
/**
|
84 |
* Indica si en el panel de preferencias se refresca automaticamente la vista
|
85 |
* para mostrar los cambios
|
86 |
*/
|
87 |
public static boolean autoRefreshView = true; |
88 |
|
89 |
/**
|
90 |
* Indica si se debe preguntar las coordenadas al cargar una capa que no las
|
91 |
* tenga
|
92 |
*/
|
93 |
public static boolean askCoordinates = false; |
94 |
|
95 |
/**
|
96 |
* La gesti?n de nombres ?nicos en la generaci?n de capas se lleva de forma
|
97 |
* autom?tica. Cuando alguien crea una capa nueva, si esta no tiene nombre especifico,
|
98 |
* obtiene su nombre mediante este m?todo. La siguiente vez que se llame dar? un nombre
|
99 |
* distinto. El nombre de la capa ser? NewLayer_ seguido de un contador de actualizaci?n
|
100 |
* autom?tica cada vez que se usa.
|
101 |
* @return Nombre ?nico para la capa.
|
102 |
*/
|
103 |
public static String usesOnlyLayerName() { |
104 |
String oldValue = getOnlyLayerName();
|
105 |
String newValue = "NewLayer_" + (++RasterModule.layerCount); |
106 |
for (int i = 0; i < propetiesListeners.size(); i++) { |
107 |
if(propetiesListeners.get(i) instanceof PropertyListener) |
108 |
((PropertyListener)propetiesListeners.get(i)).actionValueChanged(new PropertyEvent(oldValue, "NewLayer", newValue, oldValue)); |
109 |
} |
110 |
return newValue;
|
111 |
} |
112 |
|
113 |
/**
|
114 |
* Obtiene el nombre ?nico de la siguiente capa sin actualizar el contador. Es
|
115 |
* solo para consulta. La siguiente vez que se llama a getOnlyLayerName o usesOnlyLayerName
|
116 |
* devolver? el mismo nomnbre.
|
117 |
* @return Nombre ?nico para la capa.
|
118 |
*/
|
119 |
public static String getOnlyLayerName() { |
120 |
return "NewLayer_" + RasterModule.layerCount; |
121 |
} |
122 |
|
123 |
/**
|
124 |
* A?adir un listener a la lista de eventos
|
125 |
* @param listener
|
126 |
*/
|
127 |
public static void addOnlyLayerNameListener(PropertyListener listener) { |
128 |
if (!propetiesListeners.contains(listener))
|
129 |
propetiesListeners.add(listener); |
130 |
} |
131 |
|
132 |
/**
|
133 |
* Elimina un listener de la lista de eventos
|
134 |
* @param listener
|
135 |
*/
|
136 |
public static void removeOnlyLayerNameListener(PropertyListener listener) { |
137 |
for (int i = 0; i < propetiesListeners.size(); i++) |
138 |
if(propetiesListeners.get(i) == listener)
|
139 |
propetiesListeners.remove(i); |
140 |
} |
141 |
|
142 |
/*
|
143 |
* (non-Javadoc)
|
144 |
* @see com.iver.andami.plugins.IExtension#execute(java.lang.String)
|
145 |
*/
|
146 |
public void execute(String actionCommand) { |
147 |
View theView = (View) PluginServices.getMDIManager().getActiveWindow(); |
148 |
MapControl mapCtrl = theView.getMapControl(); |
149 |
|
150 |
// Listener de eventos de movimiento que pone las coordenadas del rat?n en
|
151 |
// la barra de estado
|
152 |
StatusBarListener sbl = new StatusBarListener(mapCtrl);
|
153 |
|
154 |
if (actionCommand.equals("SELECTIMAGE")) { |
155 |
loadSelectRasterListener(mapCtrl, sbl); |
156 |
mapCtrl.setTool("selectRasterLayer");
|
157 |
} |
158 |
} |
159 |
|
160 |
/**
|
161 |
* Carga el listener de selecci?n de raster en el MapControl.
|
162 |
*/
|
163 |
private void loadSelectRasterListener(MapControl mapCtrl, StatusBarListener sbl) { |
164 |
if (mapCtrl.getNamesMapTools().get("selectRasterLayer") == null) { |
165 |
SelectImageListener sil = new SelectImageListener(mapCtrl);
|
166 |
mapCtrl.addMapTool("selectRasterLayer", new Behavior[] { new PointBehavior(sil), new MouseMovementBehavior(sbl) }); |
167 |
mapCtrl.setTool("selectRasterLayer");
|
168 |
} |
169 |
} |
170 |
|
171 |
/*
|
172 |
* (non-Javadoc)
|
173 |
* @see com.iver.andami.plugins.IExtension#initialize()
|
174 |
*/
|
175 |
public void initialize() { |
176 |
Configuration.addValueChangedListener(this); |
177 |
loadConfigurationValues(); |
178 |
|
179 |
registerIcons(); |
180 |
RasterLibrary.wakeUp(); |
181 |
|
182 |
// DiagSignalHandler.install("ALRM");
|
183 |
|
184 |
Preferences prefs = Preferences.userRoot().node("gvsig.foldering"); |
185 |
prefs.put("DataFolder", System.getProperty("user.home")); |
186 |
|
187 |
ExtensionPoints extensionPoints = ExtensionPointsSingleton.getInstance(); |
188 |
|
189 |
// Creaci?n del punto de extensi?n para registrar paneles en el cuadro de propiedades.
|
190 |
if (!extensionPoints.containsKey("RasterSEPropertiesDialog")) { |
191 |
extensionPoints.put(new ExtensionPoint("RasterSEPropertiesDialog", "Raster Properties registrable panels (register instances of javax.swing.JPanel)")); |
192 |
} |
193 |
|
194 |
// A?adimos la configuracion de Raster a gvSIG
|
195 |
extensionPoints.add("AplicationPreferences","RasterPreferences", new RasterPreferences()); |
196 |
|
197 |
// A?adimos paneles al cuadro de propiedades.
|
198 |
extensionPoints.add("RasterSEPropertiesDialog", "info", InfoPanel.class); |
199 |
extensionPoints.add("RasterSEPropertiesDialog", "bands_panel", BandSetupPanel.class); |
200 |
extensionPoints.add("RasterSEPropertiesDialog", "transparencia", TransparencyPanel.class); |
201 |
extensionPoints.add("RasterSEPropertiesDialog", "realce", EnhancedPanel.class); |
202 |
extensionPoints.add("RasterSEPropertiesDialog", "pansharp", PanSharpeningPanel.class); |
203 |
extensionPoints.add("RasterSEPropertiesDialog", "scale_panel", ScalePanel.class); |
204 |
extensionPoints.add("RasterSEPropertiesDialog", "stats_panel", StatisticsPanel.class); |
205 |
|
206 |
// A?adimos las entradas del men? del toc de raster
|
207 |
extensionPoints.add("View_TocActions", "HistogramPanel", new HistogramTocMenuEntry()); |
208 |
extensionPoints.add("View_TocActions", "ClippingPanel", new ClippingTocMenuEntry()); |
209 |
extensionPoints.add("View_TocActions", "FilterPanel", new FilterTocMenuEntry()); |
210 |
extensionPoints.add("View_TocActions", "RasterSEProperties", new RasterPropertiesTocMenuEntry()); |
211 |
extensionPoints.add("View_TocActions", "ZoomPixelCursor", new ZoomPixelCursorTocMenuEntry()); |
212 |
extensionPoints.add("View_TocActions", "SaveAs", new SaveAsTocMenuEntry()); |
213 |
extensionPoints.add("View_TocActions", "ViewRasterAnalysis", new ViewRasterAnalysisTocMenuEntry()); |
214 |
extensionPoints.add("View_TocActions", "ViewColorTable", new ColorTableTocMenuEntry()); |
215 |
extensionPoints.add("View_TocActions", "GeoLocation", new GeoLocationTocMenuEntry()); |
216 |
extensionPoints.add("View_TocActions", "RoisManager", new ROIManagerTocMenuEntry()); |
217 |
extensionPoints.add("View_TocActions", "Overviews", new OverviewsTocMenuEntry()); |
218 |
|
219 |
// A?adimos nuestra extension para el tratamiento de la apertura de ficheros
|
220 |
// dentro de gvSIG
|
221 |
extensionPoints.add("FileExtendingOpenDialog", "FileOpenRaster", FileOpenRaster.class); |
222 |
|
223 |
//Alias
|
224 |
LayerFactory.registerLayerClassForName("com.iver.cit.gvsig.fmap.layers.FLyrRaster", FLyrRasterSE.class);
|
225 |
LayerFactory.registerLayerClassForName("com.iver.cit.gvsig.fmap.layers.StatusLayerRaster", StatusLayerRaster.class);
|
226 |
} |
227 |
|
228 |
/**
|
229 |
* Registra los iconos a utilizar en andami.
|
230 |
*/
|
231 |
private void registerIcons(){ |
232 |
PluginServices.getIconTheme().registerDefault( |
233 |
"forward-icon",
|
234 |
this.getClass().getClassLoader().getResource("images/forward.png") |
235 |
); |
236 |
PluginServices.getIconTheme().registerDefault( |
237 |
"backward-icon",
|
238 |
this.getClass().getClassLoader().getResource("images/backward.png") |
239 |
); |
240 |
PluginServices.getIconTheme().registerDefault( |
241 |
"map-ok-ico",
|
242 |
MapControl.class.getResource("images/map_ico_ok.gif")
|
243 |
); |
244 |
PluginServices.getIconTheme().registerDefault( |
245 |
"crux-cursor",
|
246 |
MapControl.class.getResource("images/CruxCursor.png")
|
247 |
); |
248 |
PluginServices.getIconTheme().registerDefault( |
249 |
"addlayer-icon",
|
250 |
this.getClass().getClassLoader().getResource("images/addlayer.png") |
251 |
); |
252 |
PluginServices.getIconTheme().registerDefault( |
253 |
"delall-icon",
|
254 |
this.getClass().getClassLoader().getResource("images/delall.png") |
255 |
); |
256 |
PluginServices.getIconTheme().registerDefault( |
257 |
"rotar-icon",
|
258 |
this.getClass().getClassLoader().getResource("images/Rotar.gif") |
259 |
); |
260 |
PluginServices.getIconTheme().registerDefault( |
261 |
"hor-arrow-icon",
|
262 |
this.getClass().getClassLoader().getResource("images/FlechaHorizCursor.gif") |
263 |
); |
264 |
PluginServices.getIconTheme().registerDefault( |
265 |
"ver-arrow-icon",
|
266 |
this.getClass().getClassLoader().getResource("images/FlechaVertCursor.gif") |
267 |
); |
268 |
PluginServices.getIconTheme().registerDefault( |
269 |
"inclder-arrow-icon",
|
270 |
this.getClass().getClassLoader().getResource("images/FlechaInclDerCursor.gif") |
271 |
); |
272 |
PluginServices.getIconTheme().registerDefault( |
273 |
"inclizq-arrow-icon",
|
274 |
this.getClass().getClassLoader().getResource("images/FlechaInclIzqCursor.gif") |
275 |
); |
276 |
PluginServices.getIconTheme().registerDefault( |
277 |
"shear-y-icon",
|
278 |
this.getClass().getClassLoader().getResource("images/y.gif") |
279 |
); |
280 |
PluginServices.getIconTheme().registerDefault( |
281 |
"shear-x-icon",
|
282 |
this.getClass().getClassLoader().getResource("images/x.gif") |
283 |
); |
284 |
PluginServices.getIconTheme().registerDefault( |
285 |
"hand-icon",
|
286 |
this.getClass().getClassLoader().getResource("images/Hand.gif") |
287 |
); |
288 |
PluginServices.getIconTheme().registerDefault( |
289 |
"back-icon",
|
290 |
this.getClass().getClassLoader().getResource("images/back.png") |
291 |
); |
292 |
PluginServices.getIconTheme().registerDefault( |
293 |
"next-icon",
|
294 |
this.getClass().getClassLoader().getResource("images/next.png") |
295 |
); |
296 |
PluginServices.getIconTheme().registerDefault( |
297 |
"undo-icon",
|
298 |
this.getClass().getClassLoader().getResource("images/undo.png") |
299 |
); |
300 |
PluginServices.getIconTheme().registerDefault( |
301 |
"zoom-pixel-cursor",
|
302 |
this.getClass().getClassLoader().getResource("images/ZoomPixelCursor.gif") |
303 |
); |
304 |
PluginServices.getIconTheme().registerDefault( |
305 |
"save-raster",
|
306 |
this.getClass().getClassLoader().getResource("images/Rectangle.png") |
307 |
); |
308 |
PluginServices.getIconTheme().registerDefault( |
309 |
"pixel-increase",
|
310 |
this.getClass().getClassLoader().getResource("images/increase.png") |
311 |
); |
312 |
PluginServices.getIconTheme().registerDefault( |
313 |
"select-raster",
|
314 |
this.getClass().getClassLoader().getResource("images/stock_toggle-info.png") |
315 |
); |
316 |
PluginServices.getIconTheme().registerDefault( |
317 |
"select-raster",
|
318 |
this.getClass().getClassLoader().getResource("images/stock_toggle-info.png") |
319 |
); |
320 |
PluginServices.getIconTheme().registerDefault( |
321 |
"export-icon",
|
322 |
this.getClass().getClassLoader().getResource("images/export.png") |
323 |
); |
324 |
PluginServices.getIconTheme().registerDefault( |
325 |
"pref-raster-icon",
|
326 |
this.getClass().getClassLoader().getResource("images/raster-pref.png") |
327 |
); |
328 |
PluginServices.getIconTheme().registerDefault( |
329 |
"import-icon",
|
330 |
this.getClass().getClassLoader().getResource("images/import.png") |
331 |
); |
332 |
PluginServices.getIconTheme().registerDefault( |
333 |
"save-icon",
|
334 |
this.getClass().getClassLoader().getResource("images/save.png") |
335 |
); |
336 |
PluginServices.getIconTheme().registerDefault( |
337 |
"reset-icon",
|
338 |
this.getClass().getClassLoader().getResource("images/reset.png") |
339 |
); |
340 |
PluginServices.getIconTheme().registerDefault( |
341 |
"tfwload-icon",
|
342 |
this.getClass().getClassLoader().getResource("images/load.png") |
343 |
); |
344 |
PluginServices.getIconTheme().registerDefault( |
345 |
"centerraster-icon",
|
346 |
this.getClass().getClassLoader().getResource("images/center_image.png") |
347 |
); |
348 |
PluginServices.getIconTheme().registerDefault( |
349 |
"increase-icon",
|
350 |
this.getClass().getClassLoader().getResource("images/aumentar.png") |
351 |
); |
352 |
PluginServices.getIconTheme().registerDefault( |
353 |
"decrease-icon",
|
354 |
this.getClass().getClassLoader().getResource("images/disminuir.png") |
355 |
); |
356 |
PluginServices.getIconTheme().registerDefault( |
357 |
"selectzoomarea-icon",
|
358 |
this.getClass().getClassLoader().getResource("images/view-zoom-to-seleccion.png") |
359 |
); |
360 |
PluginServices.getIconTheme().registerDefault( |
361 |
"prevzoom-icon",
|
362 |
this.getClass().getClassLoader().getResource("images/view-zoom-back.png") |
363 |
); |
364 |
PluginServices.getIconTheme().registerDefault( |
365 |
"fullview-icon",
|
366 |
this.getClass().getClassLoader().getResource("images/view-zoom-map-contents.png") |
367 |
); |
368 |
PluginServices.getIconTheme().register( |
369 |
"georeferencing-icon",
|
370 |
this.getClass().getClassLoader().getResource("images/georef.png") |
371 |
); |
372 |
PluginServices.getIconTheme().register( |
373 |
"geolocalization-icon",
|
374 |
this.getClass().getClassLoader().getResource("images/geoloc.gif") |
375 |
); |
376 |
PluginServices.getIconTheme().register( |
377 |
"exporttoascii-icon",
|
378 |
this.getClass().getClassLoader().getResource("images/exportToAscii.png") |
379 |
); |
380 |
PluginServices.getIconTheme().register( |
381 |
"exporttocsv-icon",
|
382 |
this.getClass().getClassLoader().getResource("images/exportToCSV.png") |
383 |
); |
384 |
PluginServices.getIconTheme().register( |
385 |
"importfromcsv-icon",
|
386 |
this.getClass().getClassLoader().getResource("images/importFromCSV.png") |
387 |
); |
388 |
} |
389 |
/*
|
390 |
* (non-Javadoc)
|
391 |
* @see com.iver.andami.plugins.IExtension#isEnabled()
|
392 |
*/
|
393 |
public boolean isEnabled() { |
394 |
com.iver.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager().getActiveWindow(); |
395 |
if (f == null) { |
396 |
return false; |
397 |
} |
398 |
if (f.getClass() == View.class) { |
399 |
View vista = (View) f; |
400 |
IProjectView model = vista.getModel(); |
401 |
MapContext mapa = model.getMapContext(); |
402 |
FLayers layers = mapa.getLayers(); |
403 |
for (int i = 0; i < layers.getLayersCount(); i++) |
404 |
if (layers.getLayer(i) instanceof FLyrRasterSE) |
405 |
return true; |
406 |
} |
407 |
return false; |
408 |
} |
409 |
|
410 |
/**
|
411 |
* Mostramos el control si hay alguna capa cargada.
|
412 |
*/
|
413 |
public boolean isVisible() { |
414 |
com.iver.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager().getActiveWindow(); |
415 |
if (f == null) |
416 |
return false; |
417 |
|
418 |
if (f instanceof View) { |
419 |
View vista = (View) f; |
420 |
IProjectView model = vista.getModel(); |
421 |
MapContext mapa = model.getMapContext(); |
422 |
if (mapa.getLayers().getLayersCount() > 0) |
423 |
return true; |
424 |
} |
425 |
|
426 |
return false; |
427 |
} |
428 |
|
429 |
/**
|
430 |
* Carga los valores de configuracion iniciales
|
431 |
*/
|
432 |
private void loadConfigurationValues() { |
433 |
autoRefreshView = Configuration.getValue("general_auto_preview", Boolean.TRUE).booleanValue(); |
434 |
askCoordinates = Configuration.getValue("general_ask_coordinates", Boolean.FALSE).booleanValue(); |
435 |
RasterLibrary.defaultNumberOfClasses = Configuration.getValue("general_defaultNumberOfClasses", Integer.valueOf(RasterLibrary.defaultNumberOfClasses)).intValue(); |
436 |
RasterLibrary.cacheSize = Configuration.getValue("cache_size", Long.valueOf(RasterLibrary.cacheSize)).longValue(); |
437 |
RasterLibrary.pageSize = Configuration.getValue("cache_pagesize", Double.valueOf(RasterLibrary.pageSize)).doubleValue(); |
438 |
RasterLibrary.pagsPerGroup = Configuration.getValue("cache_pagspergroup", Integer.valueOf(RasterLibrary.pagsPerGroup)).intValue(); |
439 |
RasterLibrary.blockHeight = Configuration.getValue("cache_blockheight", Integer.valueOf(RasterLibrary.blockHeight)).intValue(); |
440 |
RasterLibrary.defaultNoDataValue = Configuration.getValue("nodata_value", Double.valueOf(RasterLibrary.defaultNoDataValue)).doubleValue(); |
441 |
} |
442 |
|
443 |
/*
|
444 |
* (non-Javadoc)
|
445 |
* @see org.gvsig.raster.util.ConfigurationListener#actionConfigurationChanged(org.gvsig.raster.util.ConfigurationEvent)
|
446 |
*/
|
447 |
public void actionConfigurationChanged(ConfigurationEvent e) { |
448 |
if (e.getKey().equals("general_auto_preview")) { |
449 |
autoRefreshView = ((Boolean) e.getValue()).booleanValue();
|
450 |
return;
|
451 |
} |
452 |
|
453 |
if (e.getKey().equals("general_ask_coordinates")) { |
454 |
askCoordinates = ((Boolean) e.getValue()).booleanValue();
|
455 |
return;
|
456 |
} |
457 |
|
458 |
if (e.getKey().equals("general_defaultNumberOfClasses")) { |
459 |
RasterLibrary.defaultNumberOfClasses = ((Integer) e.getValue()).intValue();
|
460 |
return;
|
461 |
} |
462 |
|
463 |
if (e.getKey().equals("cache_size")) { |
464 |
RasterLibrary.cacheSize = ((Long) e.getValue()).longValue();
|
465 |
return;
|
466 |
} |
467 |
|
468 |
if (e.getKey().equals("cache_pagesize")) { |
469 |
RasterLibrary.pageSize = ((Double) e.getValue()).doubleValue();
|
470 |
return;
|
471 |
} |
472 |
|
473 |
if (e.getKey().equals("cache_pagspergroup")) { |
474 |
RasterLibrary.pagsPerGroup = ((Integer) e.getValue()).intValue();
|
475 |
return;
|
476 |
} |
477 |
|
478 |
if (e.getKey().equals("cache_blockheight")) { |
479 |
RasterLibrary.blockHeight = ((Integer) e.getValue()).intValue();
|
480 |
return;
|
481 |
} |
482 |
|
483 |
if (e.getKey().equals("nodata_value")) { |
484 |
RasterLibrary.defaultNoDataValue = ((Double) e.getValue()).doubleValue();
|
485 |
return;
|
486 |
} |
487 |
} |
488 |
} |