svn-gvsig-desktop / trunk / extensions / extGeoreferencing / src / org / gvsig / georeferencing / GeoreferencingModule.java @ 22444
History | View | Annotate | Download (6.67 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.georeferencing; |
20 |
|
21 |
import javax.swing.Icon; |
22 |
|
23 |
import org.gvsig.georeferencing.main.Georeferencing; |
24 |
import org.gvsig.raster.RasterLibrary; |
25 |
import org.gvsig.raster.gui.IGenericToolBarMenuItem; |
26 |
import org.gvsig.raster.util.RasterToolsUtil; |
27 |
import org.gvsig.raster.util.extensionPoints.ExtensionPoint; |
28 |
|
29 |
import com.iver.andami.PluginServices; |
30 |
import com.iver.andami.plugins.Extension; |
31 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
32 |
import com.iver.cit.gvsig.project.documents.view.toc.ITocItem; |
33 |
|
34 |
/**
|
35 |
* Extensi?n para georreferenciaci?n
|
36 |
*
|
37 |
* 05/02/2008
|
38 |
* @author Nacho Brodin nachobrodin@gmail.com
|
39 |
*/
|
40 |
public class GeoreferencingModule extends Extension implements IGenericToolBarMenuItem { |
41 |
|
42 |
/*
|
43 |
* (non-Javadoc)
|
44 |
* @see com.iver.andami.plugins.IExtension#execute(java.lang.String)
|
45 |
*/
|
46 |
public void execute(String actionCommand) { |
47 |
if (actionCommand.equals("GEOREFERENCING")) { |
48 |
Georeferencing georef = new Georeferencing();
|
49 |
georef.initialize(); |
50 |
} |
51 |
} |
52 |
|
53 |
/*
|
54 |
* (non-Javadoc)
|
55 |
* @see com.iver.andami.plugins.IExtension#initialize()
|
56 |
*/
|
57 |
public void initialize() { |
58 |
RasterLibrary.wakeUp(); |
59 |
|
60 |
ExtensionPoint extensionPoints = ExtensionPoint.getExtensionPoint("GenericToolBarMenu");
|
61 |
extensionPoints.register("Georreferencing", this); |
62 |
|
63 |
PluginServices.getIconTheme().registerDefault( |
64 |
"save-icon",
|
65 |
this.getClass().getClassLoader().getResource("images/save.png") |
66 |
); |
67 |
PluginServices.getIconTheme().registerDefault( |
68 |
"reset-icon",
|
69 |
this.getClass().getClassLoader().getResource("images/reset.png") |
70 |
); |
71 |
PluginServices.getIconTheme().registerDefault( |
72 |
"tfwload-icon",
|
73 |
this.getClass().getClassLoader().getResource("images/load.png") |
74 |
); |
75 |
PluginServices.getIconTheme().registerDefault( |
76 |
"selectzoomarea-icon",
|
77 |
this.getClass().getClassLoader().getResource("images/view-zoom-to-seleccion.png") |
78 |
); |
79 |
PluginServices.getIconTheme().registerDefault( |
80 |
"prevzoom-icon",
|
81 |
this.getClass().getClassLoader().getResource("images/view-zoom-back.png") |
82 |
); |
83 |
PluginServices.getIconTheme().registerDefault( |
84 |
"fullview-icon",
|
85 |
this.getClass().getClassLoader().getResource("images/view-zoom-map-contents.png") |
86 |
); |
87 |
PluginServices.getIconTheme().registerDefault( |
88 |
"increase-icon",
|
89 |
this.getClass().getClassLoader().getResource("images/aumentar.png") |
90 |
); |
91 |
PluginServices.getIconTheme().registerDefault( |
92 |
"decrease-icon",
|
93 |
this.getClass().getClassLoader().getResource("images/disminuir.png") |
94 |
); |
95 |
PluginServices.getIconTheme().register( |
96 |
"georeferencing-icon",
|
97 |
this.getClass().getClassLoader().getResource("images/georef.gif") |
98 |
); |
99 |
PluginServices.getIconTheme().register( |
100 |
"exporttoascii-icon",
|
101 |
this.getClass().getClassLoader().getResource("images/exportToAscii.png") |
102 |
); |
103 |
PluginServices.getIconTheme().register( |
104 |
"exporttocsv-icon",
|
105 |
this.getClass().getClassLoader().getResource("images/exportToCSV.png") |
106 |
); |
107 |
PluginServices.getIconTheme().register( |
108 |
"importfromcsv-icon",
|
109 |
this.getClass().getClassLoader().getResource("images/importFromCSV.png") |
110 |
); |
111 |
PluginServices.getIconTheme().register( |
112 |
"exit-icon",
|
113 |
this.getClass().getClassLoader().getResource("images/ico_exit.gif") |
114 |
); |
115 |
PluginServices.getIconTheme().register( |
116 |
"process-icon",
|
117 |
this.getClass().getClassLoader().getResource("images/icon_process.gif") |
118 |
); |
119 |
PluginServices.getIconTheme().register( |
120 |
"endprocess-icon",
|
121 |
this.getClass().getClassLoader().getResource("images/icon_endprocess.gif") |
122 |
); |
123 |
PluginServices.getIconTheme().register( |
124 |
"options-icon",
|
125 |
this.getClass().getClassLoader().getResource("images/ico_options.gif") |
126 |
); |
127 |
PluginServices.getIconTheme().register( |
128 |
"add-icon",
|
129 |
this.getClass().getClassLoader().getResource("images/add-ico.gif") |
130 |
); |
131 |
PluginServices.getIconTheme().register( |
132 |
"centerpoint-icon",
|
133 |
this.getClass().getClassLoader().getResource("images/icon_centerpoint.gif") |
134 |
); |
135 |
PluginServices.getIconTheme().register( |
136 |
"hand-icon",
|
137 |
this.getClass().getClassLoader().getResource("images/Hand.gif") |
138 |
); |
139 |
} |
140 |
|
141 |
/*
|
142 |
* (non-Javadoc)
|
143 |
* @see com.iver.andami.plugins.IExtension#isEnabled()
|
144 |
*/
|
145 |
public boolean isEnabled() { |
146 |
return true; |
147 |
} |
148 |
|
149 |
/*
|
150 |
* (non-Javadoc)
|
151 |
* @see com.iver.andami.plugins.IExtension#isVisible()
|
152 |
*/
|
153 |
public boolean isVisible() { |
154 |
return true; |
155 |
} |
156 |
|
157 |
/*
|
158 |
* (non-Javadoc)
|
159 |
* @see org.gvsig.raster.gui.IGenericToolBarMenuItem#execute(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
|
160 |
*/
|
161 |
public void execute(ITocItem item, FLayer[] selectedItems) { |
162 |
this.execute("GEOREFERENCING"); |
163 |
} |
164 |
|
165 |
/*
|
166 |
* (non-Javadoc)
|
167 |
* @see org.gvsig.raster.gui.IGenericToolBarMenuItem#getGroup()
|
168 |
*/
|
169 |
public String getGroup() { |
170 |
return "GeoRaster"; |
171 |
} |
172 |
|
173 |
/*
|
174 |
* (non-Javadoc)
|
175 |
* @see org.gvsig.raster.gui.IGenericToolBarMenuItem#getIcon()
|
176 |
*/
|
177 |
public Icon getIcon() { |
178 |
return PluginServices.getIconTheme().get("georeferencing-icon"); |
179 |
} |
180 |
|
181 |
/*
|
182 |
* (non-Javadoc)
|
183 |
* @see org.gvsig.raster.gui.IGenericToolBarMenuItem#getOrder()
|
184 |
*/
|
185 |
public int getOrder() { |
186 |
return 0; |
187 |
} |
188 |
|
189 |
/*
|
190 |
* (non-Javadoc)
|
191 |
* @see org.gvsig.raster.gui.IGenericToolBarMenuItem#getText()
|
192 |
*/
|
193 |
public String getText() { |
194 |
return RasterToolsUtil.getText(this, "georreferenciacion"); |
195 |
} |
196 |
|
197 |
/*
|
198 |
* (non-Javadoc)
|
199 |
* @see org.gvsig.raster.gui.IGenericToolBarMenuItem#isEnabled(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
|
200 |
*/
|
201 |
public boolean isEnabled(ITocItem item, FLayer[] selectedItems) { |
202 |
return this.isEnabled(); |
203 |
} |
204 |
|
205 |
/*
|
206 |
* (non-Javadoc)
|
207 |
* @see org.gvsig.raster.gui.IGenericToolBarMenuItem#isVisible(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
|
208 |
*/
|
209 |
public boolean isVisible(ITocItem item, FLayer[] selectedItems) { |
210 |
return this.isVisible(); |
211 |
} |
212 |
|
213 |
/*
|
214 |
* (non-Javadoc)
|
215 |
* @see org.gvsig.raster.gui.IGenericToolBarMenuItem#getGroupOrder()
|
216 |
*/
|
217 |
public int getGroupOrder() { |
218 |
return 0; |
219 |
} |
220 |
} |