Statistics
| Revision:

svn-gvsig-desktop / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / gui / toc / actions / SaveRasterTocMenuEntry.java @ 7223

History | View | Annotate | Download (2.72 KB)

1
package com.iver.cit.gvsig.gui.toc.actions;
2

    
3
import java.awt.event.ActionEvent;
4

    
5
import javax.swing.JMenuItem;
6

    
7
import com.iver.andami.PluginServices;
8
import com.iver.cit.gvsig.fmap.MapControl;
9
import com.iver.cit.gvsig.fmap.layers.FLayer;
10
import com.iver.cit.gvsig.fmap.layers.FLyrRaster;
11
import com.iver.cit.gvsig.gui.View;
12
import com.iver.cit.gvsig.gui.toc.FPopupMenu;
13
import com.iver.cit.gvsig.gui.toc.TocMenuEntry;
14

    
15
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
16
 *
17
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
18
 *
19
 * This program is free software; you can redistribute it and/or
20
 * modify it under the terms of the GNU General Public License
21
 * as published by the Free Software Foundation; either version 2
22
 * of the License, or (at your option) any later version.
23
 *
24
 * This program is distributed in the hope that it will be useful,
25
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27
 * GNU General Public License for more details.
28
 *
29
 * You should have received a copy of the GNU General Public License
30
 * along with this program; if not, write to the Free Software
31
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
32
 *
33
 * For more information, contact:
34
 *
35
 *  Generalitat Valenciana
36
 *   Conselleria d'Infraestructures i Transport
37
 *   Av. Blasco Ib??ez, 50
38
 *   46010 VALENCIA
39
 *   SPAIN
40
 *
41
 *      +34 963862235
42
 *   gvsig@gva.es
43
 *      www.gvsig.gva.es
44
 *
45
 *    or
46
 *
47
 *   IVER T.I. S.A
48
 *   Salamanca 50
49
 *   46005 Valencia
50
 *   Spain
51
 *
52
 *   +34 963163400
53
 *   dac@iver.es
54
 */
55
/* CVS MESSAGES:
56
 *
57
 * $Id: SaveRasterTocMenuEntry.java 7223 2006-09-12 15:58:14Z jorpiell $
58
 * $Log$
59
 * Revision 1.1  2006-09-12 15:58:14  jorpiell
60
 * "Sacadas" las opcines del men? de FPopupMenu
61
 *
62
 *
63
 */
64
/**
65
*
66
* @author Nacho Brodin <brodin_ign@gva.es>
67
*
68
* Entrada de men? para la activaci?n de la funcionalidad de salvar
69
* a raster una parte de la vista.
70
*/
71
public class SaveRasterTocMenuEntry extends TocMenuEntry{
72
        private JMenuItem properties;
73
        FLayer lyr = null;
74

    
75
        public void initialize(FPopupMenu m) {
76
                super.initialize(m);
77

    
78
                if (isTocItemBranch()) {
79
                        lyr = getNodeLayer();
80
                   // Opcciones para capas raster
81
                   if ((lyr instanceof FLyrRaster)) {
82
                           properties = new JMenuItem(PluginServices.getText(this, "salvar_raster"));
83
                           getMenu().add( properties );
84
                           properties.setFont(FPopupMenu.theFont);
85
                           getMenu().setEnabled(true);
86
                           //getMenu().addSeparator();
87
                   //Cambio color
88
                           properties.addActionListener(this);
89
                    }
90
                }
91
        }
92

    
93
        public void actionPerformed(ActionEvent e) {
94
                lyr = getNodeLayer();
95
                View vista = (View) PluginServices.getMDIManager().getActiveWindow();
96
                MapControl mapCtrl = vista.getMapControl();
97
                mapCtrl.setTool("saveRaster");
98
        }
99
}
100