Revision 20
org.gvsig.vectorediting/trunk/docs/dt-gvsig-edicion.rst | ||
---|---|---|
129 | 129 |
|
130 | 130 |
The API will provide the following services: |
131 | 131 |
|
132 |
* Provide an EditingService for an editing tool. |
|
132 |
* getEditingService( Strin serviceName, FeatureStore featureStore) :: EditingService |
|
133 |
Creates a DynObject with the necessary service parameters, set featureStore value to dynobject and creates an EditingService. |
|
133 | 134 |
|
134 |
* Provide information of an editing tool:: EditingServiceInfo |
|
135 |
* getServiceInfo(String serviceName) :: EditingServiceInfo |
|
136 |
Provides information of an editing tool |
|
135 | 137 |
|
138 |
* activateTool(String name, MapControl mapControl) :: void |
|
139 |
If mapControl has EditingBehavior added as tool, this method calls activateTool of EditingBehavior. |
|
140 |
|
|
141 |
|
|
136 | 142 |
EditingService (extends Service) |
137 | 143 |
***************************************************** |
138 | 144 |
|
139 |
* Start the edition.
|
|
145 |
At this moment delagates all functionality to providers.
|
|
140 | 146 |
|
141 |
* Provide the following parameter required by the tool |
|
147 |
* start() :: void |
|
148 |
* getNextParameter() :: EditingServiceParameter |
|
149 |
* setValueParameter(EditingServiceParameter param, Object value) :: void |
|
150 |
* drawOperation(Point mousePosition) :: Geometry |
|
151 |
* stop() :: void |
|
152 |
* Set<EditingServiceParameter> getParameters() :: Set<EditingServiceParameter |
|
153 |
* void finishOperation(MapControl mapcontrol); |
|
154 |
* isValidvalue(EditingServiceParameter param, Object value); |
|
142 | 155 |
|
143 |
* Set the current parameter value. |
|
144 | 156 |
|
145 |
* Provide a Geometry to draw the current editing context, taking into account the values previously provided by the user and a Point with the current mouse cursor location. |
|
146 |
|
|
147 |
* Cancel the execution of the tool. |
|
148 |
|
|
149 |
* ?Ask for the Geometries or Features created, updated or removed by the tool? |
|
150 |
|
|
151 | 157 |
EditingServiceInfo |
152 | 158 |
***************************************************** |
153 | 159 |
|
154 | 160 |
* Provide read only information about a tool: |
155 |
* Tool name. |
|
156 |
* Tool description (?use as contextual help?) |
|
157 |
* Mouse icon. |
|
158 |
* The geometry type being managed. |
|
159 |
* If the tool creates new geometries. |
|
160 |
* The list of the parameters. |
|
161 |
* Provide read only information about a tool parameter :: EditingServiceParameter |
|
162 | 161 |
|
162 |
* Tool name getName :: String |
|
163 |
* Tool description (?use as contextual help?) getDescription :: String |
|
164 |
* Mouse icon. getMouseIcon() :: Image |
|
165 |
* The geometry type being managed. getSupportedPrimitiveGeometryType() :: int |
|
166 |
* If the tool creates new geometries. createsNewGeometries() :: boolean |
|
167 |
* The list of the parameters. getParameters() :: List<EditingServiceParameter> |
|
168 |
|
|
169 |
* getParameterInfo(String name) :: EditingServiceParameter |
|
170 |
Provide read only information about a tool parameter :: EditingServiceParameter |
|
171 |
|
|
163 | 172 |
EditingServiceParameter |
164 | 173 |
***************************************************** |
165 | 174 |
|
166 | 175 |
* Provide read only information about a parameter: |
167 | 176 |
|
168 |
* Parameter name. |
|
177 |
* Parameter name. getName() :: String
|
|
169 | 178 |
|
170 |
* Parameter description (?use as contextual help?) |
|
179 |
* Parameter description (?use as contextual help?) getDescription :: String
|
|
171 | 180 |
|
172 |
* Parameter type: |
|
181 |
* Parameter type: There are 6 types of parameters: point, list of points, option, value, selection and geometry. None typed, EditingService |
|
182 |
checks if the parameter value is correct before put it at colection values. |
|
173 | 183 |
|
174 |
* Location Point |
|
175 |
* List of Location Points |
|
176 |
* Option |
|
177 |
* Value (*?typed value: string, integer, ...?*) |
|
178 |
* New Geometry of a given type. |
|
179 |
* Selection of one or many geometries/features. |
|
184 |
* equals(EditingServiceParameter param) :: boolean |
|
185 |
Compares two parameters. |
|
180 | 186 |
|
187 |
EditingBehavior |
|
188 |
***************************************************** |
|
189 |
|
|
190 |
* activateTool(String name); |
|
191 |
Activates tool creating an EditingService and ask for the next parameter. |
|
192 |
|
|
181 | 193 |
SPI |
182 | 194 |
----- |
183 | 195 |
|
184 | 196 |
* Project: org.gvsig.vectorediting/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi |
185 | 197 |
* Package: or.gvsig.vectorediting.lib.spi |
186 | 198 |
|
187 |
EditingServiceManager (extends ProviderManager)
|
|
199 |
EditingpProviderManager (extends ProviderManager)
|
|
188 | 200 |
***************************************************** |
189 | 201 |
|
190 |
* Registration of editing tools :: EditingProviderFactory.
|
|
202 |
* No methods.
|
|
191 | 203 |
|
192 | 204 |
EditingProviderServices (extends ProviderServices) |
193 | 205 |
***************************************************** |
194 | 206 |
|
195 |
* Store a new or updated Feature.
|
|
207 |
* Methods to create features / geometries.
|
|
196 | 208 |
|
197 |
* Delete a Feature. |
|
209 |
* createFeature (Feature feature, FeatureStore featureStore) |
|
210 |
* createGeometry(Geometry geometry, FeatureStore featureStore) |
|
211 |
* createGeometryAndSelect(Geometry geometry, FeatureStore featureStore) |
|
198 | 212 |
|
213 |
* Methods to delete features / geometries. |
|
214 |
|
|
215 |
* deleteFeature(Feature feature, FeatureStore featureStore) |
|
216 |
* deleteGeometry(Geometry geometry, FeatureStore featureStore) |
|
217 |
|
|
218 |
* Methods to update features / geometries |
|
219 |
|
|
220 |
* updateFeature(Feature feature, FeatureStore featureStore) |
|
221 |
* updateGeometry(Geometry geometry, FeatureStore featureStore) |
|
222 |
* updateGeometryAndSelect(Geometry geometry, FeatureStore featureStore) |
|
223 |
|
|
199 | 224 |
* ?Get the Symbol to draw a Geometry?. |
200 | 225 |
|
201 | 226 |
* Create new Features based on another ones, following the common criteria about the alphanumeric information: |
202 | 227 |
* New Features created from an old one (ex: Split): clone all data, but the primary keys. |
203 | 228 |
* New Feature created from a set of Features (ex: Union): for every attribute, if the values are the same for all the source Features, ignoring null values, clone it. Otherwise leave as null. |
229 |
|
|
230 |
.. admonition:: Note |
|
204 | 231 |
|
232 |
There is no methods to this. |
|
233 |
|
|
205 | 234 |
|
206 | 235 |
DefaultEditingServiceInfo and DefaultEditingServiceParameter |
207 | 236 |
************************************************************** |
... | ... | |
211 | 240 |
EditingProviderFactory (ProviderFactory) |
212 | 241 |
***************************************************** |
213 | 242 |
|
214 |
* Provide information of the tool (see EditingManager's API). |
|
243 |
* getServiceInfo() :: EditingServiceInfo |
|
244 |
Provide information of the tool (see EditingManager's API). |
|
215 | 245 |
|
216 |
* Provide information of a tool parameter (see EditingManager's API). |
|
246 |
* getServiceParameterInfo() :: EditingServiceParameter |
|
247 |
Provide information of a tool parameter (see EditingManager's API). |
|
217 | 248 |
|
218 | 249 |
EditingProvider (Provider) |
219 | 250 |
***************************************************** |
220 | 251 |
|
221 |
* Provide the following parameter. |
|
222 |
* Provide a Geometry to draw the current editing context (see EditingService's API). |
|
223 |
* End the editing process and store changes. |
|
224 |
* Cancel the editing process and discard changes. |
|
252 |
* start() :: void |
|
253 |
Starts service, initializing attibrutes. |
|
225 | 254 |
|
255 |
* getNextParameter() :: EditingServiceParameter |
|
256 |
Returns the next parameter required by the tool. If all parameters have values return null. |
|
257 |
|
|
258 |
* setValueParameter(EditingServiceParameter param, Object value) :: void |
|
259 |
Sets parameter value whit it param. |
|
260 |
|
|
261 |
* drawOperation(Point mousePosition) :: Geometry |
|
262 |
Provides a Geometry to draw the current editing context, taking into account the values previously provided by the user and a Point with the |
|
263 |
current mouse cursor location. |
|
264 |
|
|
265 |
* stop() :: void |
|
266 |
Cancels the execution of the tool. |
|
267 |
|
|
268 |
* Set<EditingServiceParameter> getParameters() :: Set<EditingServiceParameter |
|
269 |
Returns a set with all parameters required by the tool |
|
270 |
|
|
271 |
* finishOperation(MapControl mapcontrol) :: void |
|
272 |
Indicates that the tool doesn't need more values. |
|
273 |
|
|
274 |
* isValidValue(EditingServiceParameter param, Object value) :: boolean |
|
275 |
Check if the value is valid for the param received. |
|
276 |
|
|
277 |
.. admonition:: Doubt |
|
278 |
|
|
279 |
Not sure if return a Set or a List. |
|
280 |
|
|
281 |
* ?Ask for the Geometries or Features created, updated or removed by the tool? |
|
282 |
|
|
283 |
.. admonition:: Doubt |
|
284 |
|
|
285 |
Not sure if this is neccessary. At this moment there is no methods to this. |
|
286 |
|
|
287 |
AbstractEditingProvider extends AbstractProvider implements EditingProvider |
|
288 |
**************************************************************************** |
|
289 |
|
|
290 |
Implements all creation common operations of providers such as createPoint, createCurve, createMultiCurve, createArc, createCircle... |
|
291 |
|
|
226 | 292 |
Implementation |
227 | 293 |
---------------- |
228 | 294 |
|
... | ... | |
242 | 308 |
EditingExtension |
243 | 309 |
***************************************************** |
244 | 310 |
|
311 |
|
|
245 | 312 |
Registers the EditingBehavior in MapContext, as well as the actions to activate/deactivate editing. |
246 | 313 |
|
247 | 314 |
Also activates the console when editing is started, puts the selected layer store in editing mode, and notifies about the begin and end of editing mode. |
248 | 315 |
|
249 |
EditingBehavior |
|
250 |
***************************************************** |
|
251 | 316 |
|
252 |
Implementation of Behavior which interacts with the editing tools. |
|
253 | 317 |
|
254 |
.. admonition:: Doubt |
|
255 |
|
|
256 |
?Create instead as an interface in the API, and create a default implementation in the library implementation? |
|
257 |
|
|
258 | 318 |
BaseEditingServiceExtension |
259 | 319 |
***************************************************** |
260 | 320 |
|
261 |
Default implementation to be used by editing tool plugins. |
|
321 |
Default implementation to be used by editing tool plugins. Maybe BaseEditingServiceExtension implements execute action (activateTool) and each tool implements if it is enable or not.
|
|
262 | 322 |
|
263 | 323 |
.. admonition:: Doubt |
264 | 324 |
|
Also available in: Unified diff