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