Revision 73 org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/EditingProvider.java
EditingProvider.java | ||
---|---|---|
8 | 8 |
|
9 | 9 |
import java.util.List; |
10 | 10 |
|
11 |
import org.gvsig.fmap.dal.exception.DataException; |
|
12 |
import org.gvsig.fmap.geom.GeometryException; |
|
13 |
import org.gvsig.fmap.geom.exception.CreateGeometryException; |
|
14 |
import org.gvsig.fmap.geom.operation.GeometryOperationException; |
|
15 | 11 |
import org.gvsig.fmap.geom.primitive.Point; |
16 |
import org.gvsig.fmap.mapcontext.exceptions.StopEditionLayerException; |
|
17 |
import org.gvsig.tools.exception.BaseException; |
|
18 | 12 |
import org.gvsig.tools.service.spi.Provider; |
19 | 13 |
import org.gvsig.vectorediting.lib.api.DrawingStatus; |
20 | 14 |
import org.gvsig.vectorediting.lib.api.EditingServiceParameter; |
... | ... | |
24 | 18 |
import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException; |
25 | 19 |
import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException; |
26 | 20 |
|
21 |
/** |
|
22 |
* @author gvSIG team. |
|
23 |
*/ |
|
27 | 24 |
public interface EditingProvider extends Provider { |
28 | 25 |
|
29 | 26 |
/** |
30 |
* @return |
|
27 |
* Get next parameter needed by service. The parameter has information about |
|
28 |
* its name, description and types. Returns <code>null</code> if all |
|
29 |
* parameters have values. |
|
30 |
* |
|
31 |
* @return An {@link EditingServiceParameter} object that represents the next |
|
32 |
* parameter. |
|
31 | 33 |
*/ |
32 | 34 |
public EditingServiceParameter next(); |
33 | 35 |
|
34 | 36 |
/** |
35 |
* @param mousePosition |
|
36 |
* @return |
|
37 |
* @throws CreateGeometryException |
|
38 |
* @throws BaseException |
|
37 |
* If provider has sufficient values to draw geometries with mouse position |
|
38 |
* returns a {@link DrawingStatus} object with a collection of geometries and |
|
39 |
* information to draw, otherwise <code>return null</code>. This method is |
|
40 |
* called every time that user moves mouse on <code> MapControl </code>. |
|
41 |
* |
|
42 |
* @param mousePosition Mouse position to draw geometries. |
|
43 |
* @return A {@link DrawingStatus} object with a list of geometries and |
|
44 |
* information. |
|
45 |
* @throws DrawServiceException if there are some error creating geometries. |
|
39 | 46 |
*/ |
40 | 47 |
public DrawingStatus draw(Point mousePosition) throws DrawServiceException; |
41 | 48 |
|
42 | 49 |
/** |
43 |
* @throws StopEditionLayerException |
|
44 |
* @throws StopServiceException |
|
45 |
* |
|
50 |
* Stops service initializing necessary parameters of service. This method is |
|
51 |
* called when user cancels service. |
|
52 |
* |
|
53 |
* @throws StopServiceException Stops service initializing necessary |
|
54 |
* parameters of service. This method is called when user cancels |
|
55 |
* service. |
|
46 | 56 |
*/ |
47 | 57 |
public void stop() throws StopServiceException; |
48 | 58 |
|
49 | 59 |
/** |
50 |
* @return |
|
60 |
* Gets a <code>List</code> with all parameters of service. Each parameter has |
|
61 |
* name, description and types. See {@link EditingServiceParameter}. |
|
62 |
* |
|
63 |
* @return A list of {@link EditingServiceParameter} objects. |
|
51 | 64 |
*/ |
52 | 65 |
public List<EditingServiceParameter> getParameters(); |
53 | 66 |
|
54 | 67 |
/** |
55 |
* @param param |
|
56 |
* @param value |
|
68 |
* Gets the next parameter and set the value received as parameter. |
|
69 |
* |
|
70 |
* @param value Object to be set to next {@link EditingServiceParameter} |
|
71 |
* @throws InvalidEntryException |
|
57 | 72 |
*/ |
58 | 73 |
public void value(Object value) throws InvalidEntryException; |
59 | 74 |
|
60 | 75 |
/** |
61 |
* @throws CreateGeometryException |
|
62 |
* @throws DataException |
|
63 |
* @throws GeometryException |
|
64 |
* @throws GeometryOperationException |
|
76 |
* Finalizes service. Gets stored values, creates geometries with this values |
|
77 |
* and inserts/updates/removes into associated featured. |
|
78 |
* |
|
79 |
* @throws FinishServiceException if there are some error getting values, |
|
80 |
* creating geometries or inserting/updating/removing geometries |
|
81 |
* from feature store. |
|
65 | 82 |
*/ |
66 | 83 |
public void finish() throws FinishServiceException; |
67 | 84 |
|
68 | 85 |
/** |
69 |
* @throws StartServiceException |
|
70 |
* |
|
86 |
* Starts service initializing its parameters. |
|
87 |
* |
|
88 |
* @throws StartServiceException if there are some error starting service. |
|
71 | 89 |
*/ |
72 | 90 |
public void start() throws StartServiceException; |
73 | 91 |
|
74 | 92 |
/** |
75 |
* @return |
|
93 |
* Gets service name. |
|
94 |
* |
|
95 |
* @return Name of service. |
|
76 | 96 |
*/ |
77 | 97 |
public String getName(); |
78 | 98 |
} |
Also available in: Unified diff