svn-gvsig-desktop / trunk / extensions / extRasterTools-SE / src / org / gvsig / rastertools / saveas / SaveAsTocMenuEntry.java @ 11893
History | View | Annotate | Download (3.32 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.saveas; |
20 |
|
21 |
import javax.swing.JFileChooser; |
22 |
|
23 |
import org.gvsig.fmap.layers.FLyrRasterSE; |
24 |
import org.gvsig.rastertools.RasterModule; |
25 |
|
26 |
import com.iver.andami.PluginServices; |
27 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
28 |
import com.iver.cit.gvsig.project.documents.view.toc.AbstractTocContextMenuAction; |
29 |
import com.iver.cit.gvsig.project.documents.view.toc.ITocItem; |
30 |
|
31 |
/**
|
32 |
* Entrada del TOC que corresponde con la opci?n "Salvar Como" de raster.
|
33 |
*
|
34 |
* @version 30/05/2007
|
35 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
36 |
*
|
37 |
*/
|
38 |
public class SaveAsTocMenuEntry extends AbstractTocContextMenuAction { |
39 |
|
40 |
/*
|
41 |
* (non-Javadoc)
|
42 |
* @see com.iver.cit.gvsig.project.documents.contextMenu.AbstractContextMenuAction#getGroup()
|
43 |
*/
|
44 |
public String getGroup() { |
45 |
return "RasterTools"; |
46 |
} |
47 |
|
48 |
/*
|
49 |
* (non-Javadoc)
|
50 |
* @see com.iver.cit.gvsig.project.documents.contextMenu.AbstractContextMenuAction#getGroupOrder()
|
51 |
*/
|
52 |
public int getGroupOrder() { |
53 |
return 50; |
54 |
} |
55 |
|
56 |
/*
|
57 |
* (non-Javadoc)
|
58 |
* @see com.iver.cit.gvsig.project.documents.contextMenu.AbstractContextMenuAction#getOrder()
|
59 |
*/
|
60 |
public int getOrder() { |
61 |
return 1; |
62 |
} |
63 |
|
64 |
/*
|
65 |
* (non-Javadoc)
|
66 |
* @see com.iver.cit.gvsig.project.documents.IContextMenuAction#getText()
|
67 |
*/
|
68 |
public String getText() { |
69 |
return PluginServices.getText(this, "saveas"); |
70 |
} |
71 |
|
72 |
/*
|
73 |
* (non-Javadoc)
|
74 |
* @see com.iver.cit.gvsig.project.documents.view.toc.AbstractTocContextMenuAction#isEnabled(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
|
75 |
*/
|
76 |
public boolean isEnabled(ITocItem item, FLayer[] selectedItems) { |
77 |
return selectedItems.length == 1; |
78 |
} |
79 |
|
80 |
/*
|
81 |
* (non-Javadoc)
|
82 |
* @see com.iver.cit.gvsig.project.documents.view.toc.AbstractTocContextMenuAction#isVisible(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
|
83 |
*/
|
84 |
public boolean isVisible(ITocItem item, FLayer[] selectedItems) { |
85 |
if (isTocItemBranch(item))
|
86 |
return (getNodeLayer(item) instanceof FLyrRasterSE); |
87 |
return false; |
88 |
} |
89 |
|
90 |
/*
|
91 |
* (non-Javadoc)
|
92 |
* @see com.iver.cit.gvsig.project.documents.view.toc.AbstractTocContextMenuAction#execute(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
|
93 |
*/
|
94 |
public void execute(ITocItem item, FLayer[] selectedItems) { |
95 |
FLayer fLayer = null;
|
96 |
|
97 |
if (selectedItems.length != 1) |
98 |
return;
|
99 |
|
100 |
fLayer = selectedItems[0];
|
101 |
|
102 |
if (!(fLayer instanceof FLyrRasterSE)) |
103 |
return;
|
104 |
|
105 |
JFileChooser chooser = new JFileChooser(RasterModule.getPath()); |
106 |
} |
107 |
} |