Revision 401
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/i18n/text.properties | ||
---|---|---|
120 | 120 |
no = No |
121 | 121 |
number_of_total_elements = N\u00famero de elementos totales |
122 | 122 |
rotate_elements = Rotar elementos? |
123 |
angle_between_elements = Angulo entre elementos |
|
123 |
angle_between_elements = Angulo entre elementos |
|
124 |
remove = Eliminar |
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties | ||
---|---|---|
120 | 120 |
no = No |
121 | 121 |
number_of_total_elements = Number of total elements |
122 | 122 |
rotate_elements = Rotate elements? |
123 |
angle_between_elements = Angle between elements |
|
123 |
angle_between_elements = Angle between elements |
|
124 |
remove = Remove |
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/config.xml | ||
---|---|---|
39 | 39 |
<extension class-name="org.gvsig.vectorediting.app.mainplugin.ServiceExtension" |
40 | 40 |
description="" active="true" priority="1"> |
41 | 41 |
|
42 |
<action name="remove" label="remove" tooltip="remove" |
|
43 |
action-command="remove" icon="remove" position="601002000" |
|
44 |
accelerator="delete" /> |
|
45 |
|
|
42 | 46 |
<action name="insert-point" label="insert_point" tooltip="insert_point" |
43 |
action-command="insert-point" icon="insert-point" position="601002000"
|
|
47 |
action-command="insert-point" icon="insert-point" position="601002010"
|
|
44 | 48 |
accelerator="" /> |
45 | 49 |
|
46 | 50 |
<action name="insert-multipoint" label="insert_multipoint" tooltip="insert_multipoint" |
... | ... | |
185 | 189 |
icon="insert-polar-matrix" accelerator="" /> |
186 | 190 |
|
187 | 191 |
|
192 |
<menu text="Layer/Remove/remove" name="remove" /> |
|
188 | 193 |
<menu text="Layer/Insert/insert_point" name="insert-point" /> |
189 | 194 |
<menu text="Layer/Insert/insert_multipoint" name="insert-multipoint" /> |
190 | 195 |
<menu text="Layer/Insert/insert_line" name="insert-line" /> |
... | ... | |
223 | 228 |
<menu text="modify_edit_vertex" name="modify-edit-vertex" /> |
224 | 229 |
|
225 | 230 |
<tool-bar name="vector_editing" position="600800000"> |
231 |
<selectable-tool name="remove" /> |
|
226 | 232 |
<selectable-tool name="insert-point" /> |
227 | 233 |
<selectable-tool name="insert-multipoint" /> |
228 | 234 |
<selectable-tool name="insert-line" /> |
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml | ||
---|---|---|
74 | 74 |
<include>org.gvsig:org.gvsig.vectorediting.lib.prov.rectangularmatrix</include> |
75 | 75 |
<include>org.gvsig:org.gvsig.vectorediting.lib.prov.polarmatrix</include> |
76 | 76 |
<include>org.gvsig:org.gvsig.vectorediting.lib.prov.editvertex</include> |
77 |
<include>org.gvsig:org.gvsig.vectorediting.lib.prov.remove</include> |
|
77 | 78 |
</includes> |
78 | 79 |
</dependencySet> |
79 | 80 |
</dependencySets> |
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/pom.xml | ||
---|---|---|
233 | 233 |
org.gvsig.vectorediting.lib.prov.editvertex |
234 | 234 |
</artifactId> |
235 | 235 |
</dependency> |
236 |
<dependency> |
|
237 |
<groupId>org.gvsig</groupId> |
|
238 |
<artifactId> |
|
239 |
org.gvsig.vectorediting.lib.prov.remove |
|
240 |
</artifactId> |
|
241 |
</dependency> |
|
236 | 242 |
</dependencies> |
237 | 243 |
</project> |
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/pom.xml | ||
---|---|---|
313 | 313 |
</artifactId> |
314 | 314 |
<version>1.0.3-SNAPSHOT</version> |
315 | 315 |
</dependency> |
316 |
<dependency> |
|
317 |
<groupId>org.gvsig</groupId> |
|
318 |
<artifactId> |
|
319 |
org.gvsig.vectorediting.lib.prov.remove |
|
320 |
</artifactId> |
|
321 |
<version>1.0.3-SNAPSHOT</version> |
|
322 |
</dependency> |
|
316 | 323 |
</dependencies> |
317 | 324 |
</dependencyManagement> |
318 | 325 |
</project> |
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/pom.xml | ||
---|---|---|
39 | 39 |
</module> |
40 | 40 |
<module>org.gvsig.vectorediting.lib.prov.polarmatrix</module> |
41 | 41 |
<module>org.gvsig.vectorediting.lib.prov.editvertex</module> |
42 |
<module>org.gvsig.vectorediting.lib.prov.remove</module> |
|
42 | 43 |
</modules> |
43 | 44 |
<dependencies> |
44 | 45 |
<dependency> |
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.vectorediting.lib.prov.remove.RemoveEditingLibrary |
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/src/main/java/org/gvsig/vectorediting/lib/prov/remove/RemoveEditingProvider.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright ? 2007-2014 gvSIG Association |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
|
|
25 |
package org.gvsig.vectorediting.lib.prov.remove; |
|
26 |
|
|
27 |
import java.awt.geom.AffineTransform; |
|
28 |
import java.util.ArrayList; |
|
29 |
import java.util.HashMap; |
|
30 |
import java.util.List; |
|
31 |
import java.util.Map; |
|
32 |
|
|
33 |
import org.gvsig.fmap.dal.exception.DataException; |
|
34 |
import org.gvsig.fmap.dal.feature.EditableFeature; |
|
35 |
import org.gvsig.fmap.dal.feature.Feature; |
|
36 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
|
37 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
38 |
import org.gvsig.fmap.geom.Geometry; |
|
39 |
import org.gvsig.fmap.geom.GeometryLocator; |
|
40 |
import org.gvsig.fmap.geom.GeometryManager; |
|
41 |
import org.gvsig.fmap.geom.aggregate.Aggregate; |
|
42 |
import org.gvsig.fmap.geom.aggregate.MultiCurve; |
|
43 |
import org.gvsig.fmap.geom.aggregate.MultiPoint; |
|
44 |
import org.gvsig.fmap.geom.aggregate.MultiSurface; |
|
45 |
import org.gvsig.fmap.geom.exception.CreateGeometryException; |
|
46 |
import org.gvsig.fmap.geom.operation.GeometryOperationException; |
|
47 |
import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException; |
|
48 |
import org.gvsig.fmap.geom.primitive.Curve; |
|
49 |
import org.gvsig.fmap.geom.primitive.Line; |
|
50 |
import org.gvsig.fmap.geom.primitive.Point; |
|
51 |
import org.gvsig.fmap.geom.primitive.Surface; |
|
52 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
|
53 |
import org.gvsig.tools.dispose.DisposableIterator; |
|
54 |
import org.gvsig.tools.dynobject.DynObject; |
|
55 |
import org.gvsig.tools.exception.BaseException; |
|
56 |
import org.gvsig.tools.service.spi.ProviderServices; |
|
57 |
import org.gvsig.tools.visitor.VisitCanceledException; |
|
58 |
import org.gvsig.tools.visitor.Visitor; |
|
59 |
import org.gvsig.vectorediting.lib.api.DrawingStatus; |
|
60 |
import org.gvsig.vectorediting.lib.api.EditingServiceParameter; |
|
61 |
import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE; |
|
62 |
import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException; |
|
63 |
import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException; |
|
64 |
import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException; |
|
65 |
import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException; |
|
66 |
import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException; |
|
67 |
import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider; |
|
68 |
import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus; |
|
69 |
import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter; |
|
70 |
import org.gvsig.vectorediting.lib.spi.EditingProvider; |
|
71 |
import org.gvsig.vectorediting.lib.spi.EditingProviderFactory; |
|
72 |
import org.gvsig.vectorediting.lib.spi.EditingProviderLocator; |
|
73 |
import org.gvsig.vectorediting.lib.spi.EditingProviderManager; |
|
74 |
import org.gvsig.vectorediting.lib.spi.EditingProviderServices; |
|
75 |
|
|
76 |
/** |
|
77 |
* @author fdiaz |
|
78 |
* |
|
79 |
*/ |
|
80 |
public class RemoveEditingProvider extends AbstractEditingProvider implements |
|
81 |
EditingProvider { |
|
82 |
|
|
83 |
private EditingServiceParameter selection; |
|
84 |
|
|
85 |
private FeatureStore featureStore; |
|
86 |
|
|
87 |
private Map<EditingServiceParameter, Object> values; |
|
88 |
|
|
89 |
/** |
|
90 |
* Default constructor. |
|
91 |
* |
|
92 |
* @param providerServices |
|
93 |
* available services for this provider |
|
94 |
* @param parameters |
|
95 |
* of this provider |
|
96 |
*/ |
|
97 |
public RemoveEditingProvider(ProviderServices providerServices, |
|
98 |
DynObject parameters) { |
|
99 |
super(providerServices); |
|
100 |
|
|
101 |
this.featureStore = |
|
102 |
(FeatureStore) parameters |
|
103 |
.getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD); |
|
104 |
|
|
105 |
this.selection = |
|
106 |
new DefaultEditingServiceParameter("selection", "selection", |
|
107 |
TYPE.SELECTION); |
|
108 |
|
|
109 |
} |
|
110 |
|
|
111 |
public EditingServiceParameter next() { |
|
112 |
if (values.get(selection) == null) { |
|
113 |
return selection; |
|
114 |
} |
|
115 |
return null; |
|
116 |
} |
|
117 |
|
|
118 |
public DrawingStatus getDrawingStatus(Point mousePosition) |
|
119 |
throws DrawServiceException { |
|
120 |
// GeometryManager geometryManager = |
|
121 |
// GeometryLocator.getGeometryManager(); |
|
122 |
// EditingProviderManager editingProviderManager = |
|
123 |
// EditingProviderLocator.getProviderManager(); |
|
124 |
// EditingProviderServices editingProviderServices = |
|
125 |
// (EditingProviderServices) getProviderServices(); |
|
126 |
// int subtype; |
|
127 |
// try { |
|
128 |
// subtype = editingProviderServices.getSubType(featureStore); |
|
129 |
// } catch (DataException e2) { |
|
130 |
// throw new DrawServiceException(e2); |
|
131 |
// } |
|
132 |
// ISymbol lineSymbolEditing = |
|
133 |
// editingProviderManager.getSymbol("line-symbol-editing"); |
|
134 |
// ISymbol auxiliarylineSymbolEditing = |
|
135 |
// editingProviderManager.getSymbol("auxiliary-line-symbol-editing"); |
|
136 |
// ISymbol polygonSymbolEditing = |
|
137 |
// editingProviderManager.getSymbol("polygon-symbol-editing"); |
|
138 |
// ISymbol auxiliaryPointSymbolEditing = |
|
139 |
// editingProviderManager.getSymbol("auxiliary-point-symbol-editing"); |
|
140 |
// |
|
141 |
// DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus(); |
|
142 |
// |
|
143 |
// if (values != null) { |
|
144 |
// |
|
145 |
// FeatureSelection featureSelection = |
|
146 |
// (FeatureSelection) values.get(selection); |
|
147 |
// Point firstPointValue = (Point) values.get(firstPoint); |
|
148 |
// |
|
149 |
// if (featureSelection != null && firstPointValue != null) { |
|
150 |
// drawingStatus.addStatus(firstPointValue, auxiliaryPointSymbolEditing, |
|
151 |
// ""); |
|
152 |
// Line auxLine; |
|
153 |
// try { |
|
154 |
// auxLine = geometryManager.createLine(subtype); |
|
155 |
// } catch (CreateGeometryException e1) { |
|
156 |
// throw new DrawServiceException(e1); |
|
157 |
// } |
|
158 |
// auxLine.setPoints(firstPointValue, mousePosition); |
|
159 |
// drawingStatus.addStatus(auxLine, auxiliarylineSymbolEditing, ""); |
|
160 |
// |
|
161 |
// DisposableIterator it = null; |
|
162 |
// try { |
|
163 |
// it = featureSelection.fastIterator(); |
|
164 |
// while (it.hasNext()) { |
|
165 |
// Feature feature = (Feature) it.next(); |
|
166 |
// |
|
167 |
// Geometry geometry = |
|
168 |
// feature.getDefaultGeometry().cloneGeometry(); |
|
169 |
// |
|
170 |
// AffineTransform at = |
|
171 |
// getMoveAffineTransform(firstPointValue, |
|
172 |
// mousePosition); |
|
173 |
// geometry.transform(at); |
|
174 |
// ISymbol symbol=null; |
|
175 |
// if(geometry instanceof Curve || geometry instanceof MultiCurve){ |
|
176 |
// symbol = lineSymbolEditing; |
|
177 |
// } else if(geometry instanceof Surface || geometry instanceof |
|
178 |
// MultiSurface){ |
|
179 |
// symbol = polygonSymbolEditing; |
|
180 |
// } else if(geometry instanceof Point || geometry instanceof |
|
181 |
// MultiPoint){ |
|
182 |
// symbol = auxiliaryPointSymbolEditing; |
|
183 |
// } |
|
184 |
// if(geometry instanceof Aggregate){ |
|
185 |
// int primitivesNumber = ((Aggregate)geometry).getPrimitivesNumber(); |
|
186 |
// for (int i = 0; i < primitivesNumber; i++) { |
|
187 |
// drawingStatus.addStatus(((Aggregate)geometry).getPrimitiveAt(i), |
|
188 |
// symbol, ""); |
|
189 |
// } |
|
190 |
// } else { |
|
191 |
// drawingStatus.addStatus(geometry, symbol, ""); |
|
192 |
// } |
|
193 |
// |
|
194 |
// } |
|
195 |
// } catch (BaseException e) { |
|
196 |
// throw new DrawServiceException(e); |
|
197 |
// } finally { |
|
198 |
// it.dispose(); |
|
199 |
// } |
|
200 |
// } |
|
201 |
// } |
|
202 |
// return drawingStatus; |
|
203 |
return null; |
|
204 |
} |
|
205 |
|
|
206 |
public void stop() throws StopServiceException { |
|
207 |
if (values != null) { |
|
208 |
values.clear(); |
|
209 |
} |
|
210 |
} |
|
211 |
|
|
212 |
public List<EditingServiceParameter> getParameters() { |
|
213 |
List<EditingServiceParameter> parameters = |
|
214 |
new ArrayList<EditingServiceParameter>(); |
|
215 |
parameters.add(selection); |
|
216 |
return parameters; |
|
217 |
} |
|
218 |
|
|
219 |
public void setValue(Object value) throws InvalidEntryException { |
|
220 |
EditingServiceParameter parameter = next(); |
|
221 |
validateAndInsertValue(parameter, value); |
|
222 |
} |
|
223 |
|
|
224 |
private void validateAndInsertValue(EditingServiceParameter parameter, |
|
225 |
Object value) { |
|
226 |
|
|
227 |
if (parameter == selection) { |
|
228 |
if (value instanceof FeatureSelection) { |
|
229 |
if (((FeatureSelection) value).getSelectedCount() > 0) { |
|
230 |
values.put(selection, value); |
|
231 |
} |
|
232 |
} |
|
233 |
} |
|
234 |
} |
|
235 |
|
|
236 |
public Geometry finish() throws FinishServiceException { |
|
237 |
return null; |
|
238 |
} |
|
239 |
|
|
240 |
public void finishAndStore() throws FinishServiceException { |
|
241 |
|
|
242 |
if (values != null) { |
|
243 |
|
|
244 |
FeatureSelection featureSelection = |
|
245 |
(FeatureSelection) values.get(selection); |
|
246 |
|
|
247 |
try { |
|
248 |
featureSelection.accept(new Visitor() { |
|
249 |
|
|
250 |
public void visit(Object obj) |
|
251 |
throws VisitCanceledException, BaseException { |
|
252 |
Feature feature = (Feature) obj; |
|
253 |
|
|
254 |
((EditingProviderServices) getProviderServices()) |
|
255 |
.deleteFeatureFromFeatureStore(feature, |
|
256 |
featureStore); |
|
257 |
} |
|
258 |
}); |
|
259 |
|
|
260 |
featureStore.getFeatureSelection().deselectAll(); |
|
261 |
featureSelection.dispose(); |
|
262 |
} catch (BaseException e) { |
|
263 |
throw new FinishServiceException(e); |
|
264 |
} |
|
265 |
} |
|
266 |
} |
|
267 |
|
|
268 |
public void start() throws StartServiceException, InvalidEntryException { |
|
269 |
values = new HashMap<EditingServiceParameter, Object>(); |
|
270 |
FeatureSelection selected = null; |
|
271 |
if (featureStore != null) { |
|
272 |
try { |
|
273 |
selected = featureStore.getFeatureSelection(); |
|
274 |
} catch (DataException e) { |
|
275 |
throw new StartServiceException(e); |
|
276 |
} |
|
277 |
try { |
|
278 |
setValue(selected); |
|
279 |
} catch (InvalidEntryException e) { |
|
280 |
throw new InvalidEntryException(e); |
|
281 |
} |
|
282 |
} |
|
283 |
} |
|
284 |
|
|
285 |
public String getName() { |
|
286 |
return RemoveEditingProviderFactory.PROVIDER_NAME; |
|
287 |
} |
|
288 |
|
|
289 |
} |
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/src/main/java/org/gvsig/vectorediting/lib/prov/remove/RemoveEditingProviderFactory.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright ? 2007-2014 gvSIG Association |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
|
|
25 |
package org.gvsig.vectorediting.lib.prov.remove; |
|
26 |
|
|
27 |
import org.gvsig.fmap.geom.Geometry; |
|
28 |
import org.gvsig.tools.ToolsLocator; |
|
29 |
import org.gvsig.tools.dynobject.DynClass; |
|
30 |
import org.gvsig.tools.dynobject.DynObject; |
|
31 |
import org.gvsig.tools.service.spi.AbstractProviderFactory; |
|
32 |
import org.gvsig.tools.service.spi.Provider; |
|
33 |
import org.gvsig.tools.service.spi.ProviderServices; |
|
34 |
import org.gvsig.vectorediting.lib.api.EditingServiceInfo; |
|
35 |
import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo; |
|
36 |
import org.gvsig.vectorediting.lib.spi.EditingProviderFactory; |
|
37 |
|
|
38 |
/** |
|
39 |
* @author fdiaz |
|
40 |
* |
|
41 |
*/ |
|
42 |
public class RemoveEditingProviderFactory extends AbstractProviderFactory |
|
43 |
implements EditingProviderFactory { |
|
44 |
|
|
45 |
public final static String PROVIDER_NAME = "remove"; |
|
46 |
|
|
47 |
public final static String PROVIDER_DESCRIPTION = |
|
48 |
"Remove selected geometries"; |
|
49 |
|
|
50 |
public void initialize() { |
|
51 |
} |
|
52 |
|
|
53 |
@Override |
|
54 |
public DynObject createParameters() { |
|
55 |
DynObject parameters = super.createParameters(); |
|
56 |
parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME); |
|
57 |
return parameters; |
|
58 |
} |
|
59 |
|
|
60 |
public EditingServiceInfo getServiceInfo() { |
|
61 |
EditingServiceInfo serviceInfo = |
|
62 |
new DefaultEditingServiceinfo(PROVIDER_NAME, "", false, null, |
|
63 |
new int[] { Geometry.TYPES.POINT, Geometry.TYPES.MULTIPOINT, |
|
64 |
Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE, |
|
65 |
Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE }); |
|
66 |
|
|
67 |
return serviceInfo; |
|
68 |
} |
|
69 |
|
|
70 |
@Override |
|
71 |
protected Provider doCreate(DynObject parameters, ProviderServices services) { |
|
72 |
return new RemoveEditingProvider(services, parameters); |
|
73 |
} |
|
74 |
|
|
75 |
@Override |
|
76 |
protected DynClass createParametersDynClass() { |
|
77 |
DynClass dynclass = |
|
78 |
ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME, |
|
79 |
PROVIDER_DESCRIPTION); |
|
80 |
|
|
81 |
dynclass.addDynFieldString(PROVIDER_NAME_FIELD); |
|
82 |
dynclass.addDynFieldObject(FEATURE_STORE_FIELD); |
|
83 |
dynclass.addDynFieldObject(MAPCONTEXT_FIELD); |
|
84 |
return dynclass; |
|
85 |
} |
|
86 |
|
|
87 |
} |
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/src/main/java/org/gvsig/vectorediting/lib/prov/remove/RemoveEditingLibrary.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright ? 2007-2014 gvSIG Association |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
|
|
25 |
package org.gvsig.vectorediting.lib.prov.remove; |
|
26 |
|
|
27 |
import org.gvsig.tools.ToolsLocator; |
|
28 |
import org.gvsig.tools.i18n.I18nManager; |
|
29 |
import org.gvsig.tools.library.AbstractLibrary; |
|
30 |
import org.gvsig.tools.library.LibraryException; |
|
31 |
import org.gvsig.vectorediting.lib.api.EditingLibrary; |
|
32 |
import org.gvsig.vectorediting.lib.spi.EditingProviderLocator; |
|
33 |
import org.gvsig.vectorediting.lib.spi.EditingProviderManager; |
|
34 |
|
|
35 |
|
|
36 |
/** |
|
37 |
* @author fdiaz |
|
38 |
* |
|
39 |
*/ |
|
40 |
public class RemoveEditingLibrary extends AbstractLibrary { |
|
41 |
|
|
42 |
@Override |
|
43 |
public void doRegistration() { |
|
44 |
registerAsServiceOf(EditingLibrary.class); |
|
45 |
} |
|
46 |
|
|
47 |
@Override |
|
48 |
protected void doInitialize() throws LibraryException { |
|
49 |
} |
|
50 |
|
|
51 |
@Override |
|
52 |
protected void doPostInitialize() throws LibraryException { |
|
53 |
EditingProviderManager manager = |
|
54 |
EditingProviderLocator.getProviderManager(); |
|
55 |
|
|
56 |
manager.addProviderFactory(new RemoveEditingProviderFactory()); |
|
57 |
|
|
58 |
manager.registerIcon("vectorediting-tools", "remove", this |
|
59 |
.getClass().getClassLoader(), this.getClass().getName()); |
|
60 |
|
|
61 |
registerTranslations(); |
|
62 |
} |
|
63 |
|
|
64 |
private void registerTranslations() { |
|
65 |
I18nManager manager = ToolsLocator.getI18nManager(); |
|
66 |
manager.addResourceFamily("i18n/text", |
|
67 |
this.getClass().getClassLoader(), "remove"); |
|
68 |
} |
|
69 |
|
|
70 |
} |
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.vectorediting.lib.prov</artifactId> |
|
6 |
<version>1.0.3-SNAPSHOT</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.vectorediting.lib.prov.remove</artifactId> |
|
9 |
<name>org.gvsig.vectorediting.lib.prov.remove</name> |
|
10 |
</project> |
Also available in: Unified diff