Statistics
| Revision:

gvsig-vectorediting / 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 @ 80

History | View | Annotate | Download (3.55 KB)

1
/*
2
 * Copyright 2014 DiSiD Technologies S.L.L. All rights reserved.
3
 *
4
 * Project  : DiSiD org.gvsig.vectorediting.lib.spi
5
 * SVN Id   : $Id$
6
 */
7
package org.gvsig.vectorediting.lib.spi;
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.spi.Provider;
14
import org.gvsig.vectorediting.lib.api.DrawingStatus;
15
import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
16
import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
17
import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
18
import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
19
import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
20
import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
21

    
22
/**
23
 * @author gvSIG team.
24
 */
25
public interface EditingProvider extends Provider {
26

    
27
  /**
28
   * Get next parameter needed by service. The parameter has information about
29
   * its name, description and types. Returns <code>null</code> if all
30
   * parameters have values.
31
   * 
32
   * @return An {@link EditingServiceParameter} object that represents the next
33
   *         parameter.
34
   */
35
  public EditingServiceParameter next();
36

    
37
  /**
38
   * If provider has sufficient values to draw geometries with mouse position
39
   * returns a {@link DrawingStatus} object with a collection of geometries and
40
   * information to draw, otherwise <code>return null</code>. This method is
41
   * called every time that user moves mouse on <code> MapControl </code>.
42
   * 
43
   * @param mousePosition Mouse position to draw geometries.
44
   * @return A {@link DrawingStatus} object with a list of geometries and
45
   *         information.
46
   * @throws DrawServiceException if there are some error creating geometries.
47
   */
48
  public DrawingStatus draw(Point mousePosition) throws DrawServiceException;
49

    
50
  /**
51
   * Stops service initializing necessary parameters of service. This method is
52
   * called when user cancels service.
53
   * 
54
   * @throws StopServiceException Stops service initializing necessary
55
   *           parameters of service. This method is called when user cancels
56
   *           service.
57
   */
58
  public void stop() throws StopServiceException;
59

    
60
  /**
61
   * Gets a <code>List</code> with all parameters of service. Each parameter has
62
   * name, description and types. See {@link EditingServiceParameter}.
63
   * 
64
   * @return A list of {@link EditingServiceParameter} objects.
65
   */
66
  public List<EditingServiceParameter> getParameters();
67

    
68
  /**
69
   * Gets the next parameter and set the value received as parameter.
70
   * 
71
   * @param value Object to be set to next {@link EditingServiceParameter}
72
   * @throws InvalidEntryException
73
   */
74
  public void value(Object value) throws InvalidEntryException;
75

    
76
  /**
77
   * Finalizes service. Gets stored values, creates geometries with this values
78
   * and return geometry created.
79
   * 
80
   * @return Geometry created.
81
   * @throws FinishServiceException if there are some error getting values,
82
   *           creating geometries or inserting/updating/removing geometries
83
   *           from feature store.
84
   */
85
  public Geometry finish() throws FinishServiceException;
86
  
87
  /**
88
   * 
89
   * @throws FinishServiceException
90
   */
91
  public void finishAndStore () throws FinishServiceException;
92
  
93
  /**
94
   * Starts service initializing its parameters.
95
   * 
96
   * @throws StartServiceException if there are some error starting service.
97
   */
98
  public void start() throws StartServiceException;
99

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