Statistics
| Revision:

root / trunk / extensions / extRasterTools-SE / src / org / gvsig / rastertools / RasterSEAdapterModule.java @ 10886

History | View | Annotate | Download (4.17 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
                InfoPanel info = new InfoPanel();
59
                BandSetupPanel bandSetup = new BandSetupPanel();
60
                TransparencyPanel transpPanel = new TransparencyPanel();
61
                EnhancedPanel enhancedPanel = new EnhancedPanel();
62
                
63
                ExtensionPoints extensionPoints = ExtensionPointsSingleton.getInstance();
64
                
65
                //Creaci?n del punto de extensi?n para registrar paneles en el cuadro de propiedades.
66
                if (!extensionPoints.containsKey("RasterSEProperties")) {
67
                        extensionPoints.put(
68
                                new ExtensionPoint(
69
                                        "RasterSEPropertiesDialog",
70
                                        "Raster Properties registrable panels (register instances of javax.swing.JPanel)")
71
                        );
72
                }
73
                //A?adimos paneles al cuadro de propiedades.
74
            extensionPoints.add("RasterSEPropertiesDialog", info.getID(), info);
75
            extensionPoints.add("RasterSEPropertiesDialog", bandSetup.getID(), bandSetup);
76
            extensionPoints.add("RasterSEPropertiesDialog", transpPanel.getID(), transpPanel);
77
            extensionPoints.add("RasterSEPropertiesDialog", enhancedPanel.getID(), enhancedPanel);
78
            
79
            //A?adimos la entrada del toc del cuadro de propiedades. Como se llama igual sustituye a la vieja.
80
            extensionPoints.add("View_TocActions","HistogramPanel",new HistogramTocMenuEntry());
81

    
82
            //A?adimos la entrada del toc del cuadro de propiedades. Como se llama igual sustituye a la vieja.
83
            extensionPoints.add("View_TocActions","RasterSEProperties",new RasterPropertiesTocMenuEntry());
84
            
85
            //A?adimos el panel al winzard de cargar capa. (Esto es temporal hasta que el actual sea totalmente extensible)
86
            AddLayer.addWizard(FileOpenRasterDialog.class);
87
        }
88
        
89
        /*
90
         * (non-Javadoc)
91
         * @see com.iver.andami.plugins.IExtension#isEnabled()
92
         */
93
        public boolean isEnabled() {
94
                return true;
95
        }
96

    
97
        /**
98
         * Mostramos el control si hay alguna capa cargada.
99
         */
100
        public boolean isVisible() {
101
                com.iver.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager().getActiveWindow();
102
                if (f == null) 
103
                        return false;
104

    
105
                return (f  instanceof View);
106
        }
107

    
108
}