Statistics
| Revision:

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

History | View | Annotate | Download (3.91 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.properties.dialog.RasterPropertiesTocMenuEntry;
23
import org.gvsig.rastertools.properties.panels.BandSetupPanel;
24
import org.gvsig.rastertools.properties.panels.EnhancedPanel;
25
import org.gvsig.rastertools.properties.panels.InfoPanel;
26
import org.gvsig.rastertools.properties.panels.TransparencyPanel;
27
import org.gvsig.rastertools.wizards.FileOpenRasterDialog;
28

    
29
import com.iver.andami.PluginServices;
30
import com.iver.andami.plugins.Extension;
31
import com.iver.cit.gvsig.AddLayer;
32
import com.iver.cit.gvsig.project.documents.view.gui.View;
33
import com.iver.utiles.extensionPoints.ExtensionPoint;
34
import com.iver.utiles.extensionPoints.ExtensionPoints;
35
import com.iver.utiles.extensionPoints.ExtensionPointsSingleton;
36

    
37
/**
38
 * Extensi?n que adapta a FMap y gvSIG la nueva implementaci?n de raster. Para el cuadro de 
39
 * Propiedades de visualizaci?n de raster contiene el contenedor base se registran la entrada 
40
 * del men? del TOC y los paneles en el cuadro. Para la parte de FMap contiene una nueva
41
 * capa raster y los drivers necesarios.
42
 * 
43
 * @author Nacho Brodin (nachobrodin@gmail.com)
44
 *
45
 */
46
public class RasterSEAdapterModule extends Extension{
47

    
48
        public void execute(String actionCommand) {
49
                
50
        }        
51
        
52
        /*
53
         * (non-Javadoc)
54
         * @see com.iver.andami.plugins.IExtension#initialize()
55
         */
56
        public void initialize() {
57
                InfoPanel info = new InfoPanel();
58
                BandSetupPanel bandSetup = new BandSetupPanel();
59
                TransparencyPanel transpPanel = new TransparencyPanel();
60
                EnhancedPanel enhancedPanel = new EnhancedPanel();
61
                
62
                ExtensionPoints extensionPoints = ExtensionPointsSingleton.getInstance();
63
                
64
                //Creaci?n del punto de extensi?n para registrar paneles en el cuadro de propiedades.
65
                if (!extensionPoints.containsKey("RasterSEProperties")) {
66
                        extensionPoints.put(
67
                                new ExtensionPoint(
68
                                        "RasterSEPropertiesDialog",
69
                                        "Raster Properties registrable panels (register instances of javax.swing.JPanel)")
70
                        );
71
                }
72
                //A?adimos paneles al cuadro de propiedades.
73
            extensionPoints.add("RasterSEPropertiesDialog", info.getID(), info);
74
            extensionPoints.add("RasterSEPropertiesDialog", bandSetup.getID(), bandSetup);
75
            extensionPoints.add("RasterSEPropertiesDialog", transpPanel.getID(), transpPanel);
76
            extensionPoints.add("RasterSEPropertiesDialog", enhancedPanel.getID(), enhancedPanel);
77
            
78
            //A?adimos la entrada del toc del cuadro de propiedades. Como se llama igual sustituye a la vieja.
79
            extensionPoints.add("View_TocActions","RasterSEProperties",new RasterPropertiesTocMenuEntry());
80
            
81
            //A?adimos el panel al winzard de cargar capa. (Esto es temporal hasta que el actual sea totalmente extensible)
82
            AddLayer.addWizard(FileOpenRasterDialog.class);
83
        }
84
        
85
        /*
86
         * (non-Javadoc)
87
         * @see com.iver.andami.plugins.IExtension#isEnabled()
88
         */
89
        public boolean isEnabled() {
90
                return true;
91
        }
92

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

    
101
                return (f  instanceof View);
102
        }
103

    
104
}