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