root / trunk / extensions / extRasterTools-SE / src / org / gvsig / rastertools / RasterSEAdapterModule.java @ 11173
History | View | Annotate | Download (4.21 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 |
|
20 |
package org.gvsig.rastertools; |
21 |
|
22 |
import org.gvsig.rastertools.histogram.ui.HistogramTocMenuEntry; |
23 |
import org.gvsig.rastertools.properties.dialog.RasterPropertiesTocMenuEntry; |
24 |
import org.gvsig.rastertools.properties.panels.BandSetupPanel; |
25 |
import org.gvsig.rastertools.properties.panels.EnhancedPanel; |
26 |
import org.gvsig.rastertools.properties.panels.InfoPanel; |
27 |
import org.gvsig.rastertools.properties.panels.TransparencyPanel; |
28 |
import org.gvsig.rastertools.wizards.FileOpenRasterDialog; |
29 |
|
30 |
import com.iver.andami.PluginServices; |
31 |
import com.iver.andami.plugins.Extension; |
32 |
import com.iver.cit.gvsig.AddLayer; |
33 |
import com.iver.cit.gvsig.project.documents.view.gui.View; |
34 |
import com.iver.utiles.extensionPoints.ExtensionPoint; |
35 |
import com.iver.utiles.extensionPoints.ExtensionPoints; |
36 |
import com.iver.utiles.extensionPoints.ExtensionPointsSingleton; |
37 |
|
38 |
/**
|
39 |
* Extensi?n que adapta a FMap y gvSIG la nueva implementaci?n de raster. Para el cuadro de
|
40 |
* Propiedades de visualizaci?n de raster contiene el contenedor base se registran la entrada
|
41 |
* del men? del TOC y los paneles en el cuadro. Para la parte de FMap contiene una nueva
|
42 |
* capa raster y los drivers necesarios.
|
43 |
*
|
44 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
45 |
*
|
46 |
*/
|
47 |
public class RasterSEAdapterModule extends Extension{ |
48 |
|
49 |
public void execute(String actionCommand) { |
50 |
|
51 |
} |
52 |
|
53 |
/*
|
54 |
* (non-Javadoc)
|
55 |
* @see com.iver.andami.plugins.IExtension#initialize()
|
56 |
*/
|
57 |
public void initialize() { |
58 |
DiagSignalHandler.install("ALRM");
|
59 |
|
60 |
InfoPanel info = new InfoPanel();
|
61 |
BandSetupPanel bandSetup = new BandSetupPanel();
|
62 |
TransparencyPanel transpPanel = new TransparencyPanel();
|
63 |
EnhancedPanel enhancedPanel = new EnhancedPanel();
|
64 |
|
65 |
ExtensionPoints extensionPoints = ExtensionPointsSingleton.getInstance(); |
66 |
|
67 |
//Creaci?n del punto de extensi?n para registrar paneles en el cuadro de propiedades.
|
68 |
if (!extensionPoints.containsKey("RasterSEProperties")) { |
69 |
extensionPoints.put( |
70 |
new ExtensionPoint(
|
71 |
"RasterSEPropertiesDialog",
|
72 |
"Raster Properties registrable panels (register instances of javax.swing.JPanel)")
|
73 |
); |
74 |
} |
75 |
//A?adimos paneles al cuadro de propiedades.
|
76 |
extensionPoints.add("RasterSEPropertiesDialog", info.getID(), info);
|
77 |
extensionPoints.add("RasterSEPropertiesDialog", bandSetup.getID(), bandSetup);
|
78 |
extensionPoints.add("RasterSEPropertiesDialog", transpPanel.getID(), transpPanel);
|
79 |
extensionPoints.add("RasterSEPropertiesDialog", enhancedPanel.getID(), enhancedPanel);
|
80 |
|
81 |
//A?adimos la entrada del toc del cuadro de propiedades. Como se llama igual sustituye a la vieja.
|
82 |
extensionPoints.add("View_TocActions","HistogramPanel",new HistogramTocMenuEntry()); |
83 |
|
84 |
//A?adimos la entrada del toc del cuadro de propiedades. Como se llama igual sustituye a la vieja.
|
85 |
extensionPoints.add("View_TocActions","RasterSEProperties",new RasterPropertiesTocMenuEntry()); |
86 |
|
87 |
//A?adimos el panel al winzard de cargar capa. (Esto es temporal hasta que el actual sea totalmente extensible)
|
88 |
AddLayer.addWizard(FileOpenRasterDialog.class); |
89 |
} |
90 |
|
91 |
/*
|
92 |
* (non-Javadoc)
|
93 |
* @see com.iver.andami.plugins.IExtension#isEnabled()
|
94 |
*/
|
95 |
public boolean isEnabled() { |
96 |
return true; |
97 |
} |
98 |
|
99 |
/**
|
100 |
* Mostramos el control si hay alguna capa cargada.
|
101 |
*/
|
102 |
public boolean isVisible() { |
103 |
com.iver.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager().getActiveWindow(); |
104 |
if (f == null) |
105 |
return false; |
106 |
|
107 |
return (f instanceof View); |
108 |
} |
109 |
|
110 |
} |