Statistics
| Revision:

gvsig-vectorediting / org.gvsig.vectorediting / trunk / org.gvsig.vectorediting / org.gvsig.vectorediting.lib / org.gvsig.vectorediting.lib.api / src / main / java / org / gvsig / vectorediting / lib / api / EditingService.java @ 87

History | View | Annotate | Download (3.43 KB)

1
/*
2
 * Copyright 2014 DiSiD Technologies S.L.L. All rights reserved.
3
 *
4
 * Project  : DiSiD org.gvsig.vectorediting.lib.api
5
 * SVN Id   : $Id$
6
 */
7
package org.gvsig.vectorediting.lib.api;
8

    
9
import java.util.List;
10

    
11
import org.gvsig.fmap.geom.Geometry;
12
import org.gvsig.fmap.geom.primitive.Point;
13
import org.gvsig.tools.service.Service;
14
import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
15
import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
16
import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
17
import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
18
import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
19

    
20
/**
21
 * @author gvSIG team.
22
 */
23
public interface EditingService extends Service {
24

    
25
  /**
26
   * If service has sufficient values to draw geometries with mouse position
27
   * returns a {@link DrawingStatus} object with a collection of geometries and
28
   * information to draw, otherwise <code>return null</code>. This method is
29
   * called every time that user moves mouse on <code> MapControl </code>.
30
   * 
31
   * @param mousePosition Mouse position to draw geometries.
32
   * @return A {@link DrawingStatus} object with a list of geometries and
33
   *         information.
34
   * @throws DrawServiceException if there are some error creating geometries.
35
   */
36
  public DrawingStatus draw(Point mousePosition) throws DrawServiceException;
37

    
38
  /**
39
   * Gets a <code>List</code> with all parameters of service. Each parameter has
40
   * name, description and types. See {@link EditingServiceParameter}.
41
   * 
42
   * @return A list of {@link EditingServiceParameter} objects.
43
   */
44
  public List<EditingServiceParameter> getParameters();
45

    
46
  /**
47
   * Get next parameter needed by service. The parameter has information about
48
   * its name, description and types. Returns <code>null</code> if all
49
   * parameters have values.
50
   * 
51
   * @return An {@link EditingServiceParameter} object that represents the next
52
   *         parameter.
53
   */
54
  public EditingServiceParameter next();
55

    
56
  /**
57
   * Calls {@link #next()} and set the value received as parameter.
58
   * 
59
   * @param value Object to be set to next {@link EditingServiceParameter}
60
   * @throws InvalidEntryException
61
   */
62
  public void setValue(Object value) throws InvalidEntryException;
63

    
64
  /**
65
   * Stops service initializing necessary parameters of service. This method is
66
   * called when user cancels service.
67
   * 
68
   * @throws StopServiceException Stops service initializing necessary
69
   *           parameters of service. This method is called when user cancels
70
   *           service.
71
   */
72
  public void stop() throws StopServiceException;
73

    
74
  /**
75
   * Finalizes service. Gets stored values, creates geometries with this values
76
   * and return geometry created.
77
   * 
78
   * @return Geometry created.
79
   * @throws FinishServiceException if there are some error getting values,
80
   *           creating geometries or inserting/updating/removing geometries
81
   *           from feature store.
82
   */
83
  public Geometry finish() throws FinishServiceException;
84
  
85
  /**
86
   * 
87
   * @throws FinishServiceException
88
   */
89
  public void finishAndStore () throws FinishServiceException;
90

    
91
  /**
92
   * Starts service initializing its parameters.
93
   * 
94
   * @throws StartServiceException if there are some error starting service.
95
   */
96
  public void start() throws StartServiceException;
97

    
98
  /**
99
   * Gets service name.
100
   * 
101
   * @return Name of service.
102
   */
103
  public String getName();
104

    
105
}