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 / EditingProviderServices.java @ 68

History | View | Annotate | Download (5.54 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.awt.geom.Point2D;
10

    
11
import org.gvsig.fmap.dal.exception.DataException;
12
import org.gvsig.fmap.dal.feature.EditableFeature;
13
import org.gvsig.fmap.dal.feature.Feature;
14
import org.gvsig.fmap.dal.feature.FeatureStore;
15
import org.gvsig.fmap.geom.Geometry;
16
import org.gvsig.fmap.geom.exception.CreateGeometryException;
17
import org.gvsig.fmap.geom.operation.GeometryOperationException;
18
import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
19
import org.gvsig.fmap.geom.primitive.Arc;
20
import org.gvsig.fmap.geom.primitive.Circle;
21
import org.gvsig.fmap.geom.primitive.Curve;
22
import org.gvsig.fmap.geom.primitive.Point;
23
import org.gvsig.fmap.geom.type.GeometryType;
24
import org.gvsig.tools.service.spi.ProviderServices;
25

    
26
public interface EditingProviderServices extends ProviderServices {
27

    
28
  /**
29
   * @param feature
30
   * @param featureStore
31
   */
32
  public void insertFeatureIntoFeatureStore(Feature feature,
33
                                            FeatureStore featureStore);
34

    
35
  /**
36
   * @param geometry
37
   * @param featureStore
38
   */
39
  public void insertGeometryIntoFeatureStore(Geometry geometry,
40
                                             FeatureStore featureStore);
41

    
42
  /**
43
   * @param feature
44
   * @param featureStore
45
   */
46
  public void deleteFeatureFromFeatureStore(Feature feature,
47
                                            FeatureStore featureStore);
48

    
49
  /**
50
   * @param geometry
51
   * @param featureStore
52
   */
53
  public void deleteGeometryFromFeatureStore(Geometry geometry,
54
                                             FeatureStore featureStore);
55

    
56
  /**
57
   * @param feature
58
   * @param featureStore
59
   */
60
  public void updateFeatureInFeatureStore(Feature feature,
61
                                          FeatureStore featureStore);
62

    
63
  /**
64
   * @param geometry
65
   * @param featureStore
66
   */
67
  public void updateGeometryInFeatureStore(Geometry geometry,
68
                                           FeatureStore featureStore);
69

    
70

    
71
        /**
72
         * Create a circle from a GeneralPath. If there is an error return
73
         * <code>null</code> and add the error to the log
74
         *
75
         * @param p1
76
         * @param p2
77
         * @return The circle
78
         * @throws CreateGeometryException
79
         * @throws DataException
80
         */
81
  public Circle createCircle(Point2D p1, Point2D p2, FeatureStore featureStore)
82
      throws CreateGeometryException, DataException;
83

    
84
        /**
85
   * Create a circle. If there is an error return <code>null</code> and add the
86
   * error to the log
87
         *
88
         * @param p1
89
         * @param p2
90
         * @return The circle
91
         * @throws CreateGeometryException
92
         * @throws DataException
93
         */
94
  public Circle createCircle(Point p1, Point p2, FeatureStore featureStore)
95
      throws CreateGeometryException, DataException;
96

    
97
        /**
98
   * Create a circle. If there is an error return <code>null</code> and add the
99
   * error to the log
100
         *
101
         * @param center
102
         * @param radius
103
         * @return The circle
104
         * @throws CreateGeometryException
105
         * @throws DataException
106
         */
107
        public Circle createCircle(Point center, double radius,
108
                             FeatureStore featureStore)
109
      throws CreateGeometryException, DataException;
110

    
111
        /**
112
   * Create a circle. If there is an error return <code>null</code> and add the
113
   * error to the log
114
         *
115
         * @param center
116
         * @param radius
117
   * @param startAngle in radians
118
         * @param angleExt
119
         * @return The circle
120
         * @throws org.gvsig.fmap.geom.exception.CreateGeometryException
121
         * @throws DataException
122
         */
123
        public Arc createArc(Point center, double radius, double startAngle,
124
                        double angleExt, FeatureStore featureStore)
125
                        throws CreateGeometryException, DataException;
126

    
127
        /**
128
   * @param antPoint
129
   * @param p1
130
   * @param p2
131
   * @param featureStore
132
   * @return
133
   * @throws CreateGeometryException
134
   * @throws DataException
135
   */
136
  public Arc createArc(Point antPoint, Point p1, Point p2,
137
                       FeatureStore featureStore)
138
      throws CreateGeometryException, DataException,
139
      GeometryOperationNotSupportedException, GeometryOperationException;
140

    
141
  /**
142
         * Create point. If there is an error return <code>null</code> and add the
143
         * error to the log
144
         *
145
   * @param x The X coordinate
146
   * @param y The y coordinate
147
         * @return The Point
148
         * @throws CreateGeometryException
149
         * @throws DataException
150
         */
151
        public Point createPoint(double x, double y, FeatureStore featureStore)
152
                        throws CreateGeometryException, DataException;
153

    
154
        /**
155
         * Create line. If there is an error return <code>null</code> and add the
156
         * error to the log
157
         *
158
   * @param x1 The X1 coordinate
159
   * @param y1 The y1 coordinate
160
   * @param x2 The X2 coordinate
161
   * @param y2 The y2 coordinate
162
         * @return The Point
163
         * @throws CreateGeometryException
164
         * @throws DataException
165
         */
166
        public Curve createLine(double x1, double y1, double x2, double y2,
167
                          FeatureStore featureStore)
168
      throws CreateGeometryException, DataException;
169

    
170
        /**
171
         * @return the subtype of the default geometry.
172
         * @throws DataException
173
         */
174
        public int getSubType(FeatureStore featureStore) throws DataException;
175

    
176
        /**
177
         * @return the subtype of the default geometry.
178
         * @throws DataException
179
         */
180
        public GeometryType getGeomType(FeatureStore featureStore)
181
                        throws DataException;
182

    
183
        /**
184
         * Return a copy of a feature without primary keys data
185
         *
186
         * @return the copy of a feature without primary keys data
187
         * @throws DataException
188
         */
189
        public EditableFeature getFeatureCopyWithoutPK(FeatureStore featureStore, Feature feature) throws DataException;
190

    
191
}