public class DefaultEditingProviderServices extends AbstractProviderServices implements EditingProviderServices
Modifier and Type | Field and Description |
---|---|
protected GeometryManager |
geomManager |
Constructor and Description |
---|
DefaultEditingProviderServices() |
Modifier and Type | Method and Description |
---|---|
double |
angleDistance(double angle1,
double angle2)
Gets distance between two angles.
|
Arc |
createArc(Point center,
double radius,
double startAngle,
double angleExt,
int subtype)
Creates an arc as of center, radius, start angle and extension angle.
|
Arc |
createArc(Point start,
Point middle,
Point end,
int subtype)
Creates an arc as of three points.
|
Circle |
createCircle(Point center,
double radius,
int subtype)
Creates a circle as of center and radius.
|
Circle |
createCircle(Point firstPoint,
Point secondPoint,
Point thridPoint,
int subtype)
Creates a circle from three points.
|
Arc |
createEllipse(Point firstPointAxisA,
Point secondPointAxisA,
double halfLengthAxisB,
int subtype)
Creates an ellipse from start and end point of A axis and half length
of B axis.
|
Ellipse |
createFilledEllipse(Point firstPointAxisA,
Point secondPointAxisA,
double halfLengthAxisB,
int subtype)
Creates a filled ellipse from start and end point of A axis and half length
of B axis.
|
Line |
createLine(double x1,
double y1,
double x2,
double y2,
int subtype)
Creates line as of two point coordinates.
|
Line |
createLine(Point p1,
Point p2,
int subtype)
Creates line as of two point objects.
|
Point |
createPoint(double x,
double y,
int subtype)
Creates point with x and y values.
|
Spline |
createSpline(List<Point> points,
int subtype) |
void |
deleteFeatureFromFeatureSet(Feature feature,
FeatureStore featureStore,
FeatureSet set)
Deletes the feature from feature set.
|
void |
deleteFeatureFromFeatureStore(Feature feature,
FeatureStore featureStore)
Deletes the feature from feature store.
|
double |
getAngle(Point start,
Point end)
Gets angle between two points.
|
Point |
getCenter(Point a,
Point b,
Point c,
int subtype)
Gets center point of three points.
|
EditableFeature |
getFeatureCopyWithoutPK(FeatureStore featureStore,
Feature feature)
Returns a copy of a feature without primary keys data
|
GeometryType |
getGeomType(FeatureStore featureStore)
Gets
GeometryType of the feature store received as parameter. |
Point |
getIntersection(Point[] lineA,
Point[] lineB,
int subtype)
Gets intersection point of two lines.
|
Double[] |
getLineParams(Point point,
Point nextPoint)
Gets the slope of the line created by points received.
|
Point |
getMidPoint(Point a,
Point b,
int subtype)
Gets midpoint of two points
|
Point[] |
getPerpendicular(Double m,
Double b,
Point perp,
int subtype)
Gets perpendicular of line formed by slope and y-intercept received as
parameters.
|
int |
getSubType(FeatureStore featureStore)
Gets
Geometry.SUBTYPES of the feature store received as parameter. |
void |
insertFeatureIntoFeatureStore(Feature feature,
FeatureStore featureStore)
Inserts the feature into feature store.
|
void |
insertGeometryIntoFeatureStore(Geometry geometry,
FeatureStore featureStore)
Inserts the geometry into feature store.
|
String |
makeConsoleMessage(String preText,
Map<String,String> options)
Makes a console message.
|
void |
updateFeatureInFeatureStore(Feature feature,
FeatureStore featureStore)
Updates the feature received as parameter in feature store.
|
getParameters, getService, setService
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParameters, getService
protected GeometryManager geomManager
public void insertFeatureIntoFeatureStore(Feature feature, FeatureStore featureStore)
EditingProviderServices
insertFeatureIntoFeatureStore
in interface EditingProviderServices
feature
- to be insertfeatureStore
- where feature will be insertpublic void insertGeometryIntoFeatureStore(Geometry geometry, FeatureStore featureStore)
EditingProviderServices
insertGeometryIntoFeatureStore
in interface EditingProviderServices
geometry
- to be insertfeatureStore
- where geometry will be insertpublic void deleteFeatureFromFeatureSet(Feature feature, FeatureStore featureStore, FeatureSet set)
EditingProviderServices
deleteFeatureFromFeatureSet
in interface EditingProviderServices
public void deleteFeatureFromFeatureStore(Feature feature, FeatureStore featureStore)
EditingProviderServices
deleteFeatureFromFeatureStore
in interface EditingProviderServices
public void updateFeatureInFeatureStore(Feature feature, FeatureStore featureStore)
EditingProviderServices
updateFeatureInFeatureStore
in interface EditingProviderServices
feature
- to be updatedfeatureStore
- where feature will be updatedpublic Circle createCircle(Point center, double radius, int subtype) throws CreateGeometryException
EditingProviderServices
createCircle
in interface EditingProviderServices
center
- of new circleradius
- of new circlesubtype
- subtype of circle. See Geometry.SUBTYPES
CreateGeometryException
public Circle createCircle(Point firstPoint, Point secondPoint, Point thridPoint, int subtype) throws CreateGeometryException
EditingProviderServices
createCircle
in interface EditingProviderServices
firstPoint
- of circlesecondPoint
- of circlethridPoint
- of circlesubtype
- subtype of circle. See Geometry.SUBTYPES
CreateGeometryException
public Arc createArc(Point center, double radius, double startAngle, double angleExt, int subtype) throws CreateGeometryException
EditingProviderServices
createArc
in interface EditingProviderServices
center
- center of arc.radius
- of arc.startAngle
- of arc in radiansangleExt
- of arc in radianssubtype
- subtype of arc. See Geometry.SUBTYPES
CreateGeometryException
public Ellipse createFilledEllipse(Point firstPointAxisA, Point secondPointAxisA, double halfLengthAxisB, int subtype) throws CreateGeometryException
EditingProviderServices
createFilledEllipse
in interface EditingProviderServices
firstPointAxisA
- first point of A axissecondPointAxisA
- second point of B axishalfLengthAxisB
- half length of B axissubtype
- of ellipse See Geometry.SUBTYPES
CreateGeometryException
public Arc createArc(Point start, Point middle, Point end, int subtype) throws BaseException
EditingProviderServices
createArc
in interface EditingProviderServices
start
- point of arcmiddle
- point of arc. It can be any point of arc.end
- point of arcsubtype
- of arc. See Geometry.SUBTYPES
BaseException
public Point createPoint(double x, double y, int subtype) throws CreateGeometryException
EditingProviderServices
createPoint
in interface EditingProviderServices
x
- The X coordinatey
- The y coordinatesubtype
- of point. See Geometry.SUBTYPES
CreateGeometryException
public Line createLine(double x1, double y1, double x2, double y2, int subtype) throws CreateGeometryException
EditingProviderServices
createLine
in interface EditingProviderServices
x1
- The X1 coordinatey1
- The y1 coordinatex2
- The X2 coordinatey2
- The y2 coordinatesubtype
- of line. See Geometry.SUBTYPES
CreateGeometryException
public int getSubType(FeatureStore featureStore) throws DataException
EditingProviderServices
Geometry.SUBTYPES
of the feature store received as parameter.getSubType
in interface EditingProviderServices
DataException
- if there some problem getting subtype.public GeometryType getGeomType(FeatureStore featureStore) throws DataException
EditingProviderServices
GeometryType
of the feature store received as parameter.getGeomType
in interface EditingProviderServices
DataException
- if there some problem getting subtype.public EditableFeature getFeatureCopyWithoutPK(FeatureStore featureStore, Feature feature) throws DataException
EditingProviderServices
getFeatureCopyWithoutPK
in interface EditingProviderServices
DataException
- if there some problem getting subtype.public Point getCenter(Point a, Point b, Point c, int subtype) throws CreateGeometryException
EditingProviderServices
getCenter
in interface EditingProviderServices
a
- Point oneb
- Point twoc
- Point threesubtype
- of point created. See Geometry.SUBTYPES
CreateGeometryException
public Point getMidPoint(Point a, Point b, int subtype) throws CreateGeometryException
EditingProviderServices
getMidPoint
in interface EditingProviderServices
a
- Point oneb
- Point twosubtype
- of point created. See Geometry.SUBTYPES
CreateGeometryException
public Double[] getLineParams(Point point, Point nextPoint)
EditingProviderServices
getLineParams
in interface EditingProviderServices
point
- of linenextPoint
- of linepublic Point[] getPerpendicular(Double m, Double b, Point perp, int subtype) throws CreateGeometryException
EditingProviderServices
getPerpendicular
in interface EditingProviderServices
m
- slope of lineb
- y-intercep of lineperp
- Point crossed by perpendicularsubtype
- of perpendicular points. See Geometry.SUBTYPES
CreateGeometryException
public Point getIntersection(Point[] lineA, Point[] lineB, int subtype) throws CreateGeometryException
EditingProviderServices
getIntersection
in interface EditingProviderServices
subtype
- of intersection point. See Geometry.SUBTYPES
CreateGeometryException
public double getAngle(Point start, Point end) throws GeometryOperationNotSupportedException, GeometryOperationException
EditingProviderServices
getAngle
in interface EditingProviderServices
GeometryOperationNotSupportedException
GeometryOperationException
public double angleDistance(double angle1, double angle2)
EditingProviderServices
angleDistance
in interface EditingProviderServices
public Line createLine(Point p1, Point p2, int subtype) throws CreateGeometryException
EditingProviderServices
createLine
in interface EditingProviderServices
p1
- First pointp2
- Second pointsubtype
- of line. See Geometry.SUBTYPES
CreateGeometryException
public Spline createSpline(List<Point> points, int subtype) throws CreateGeometryException
createSpline
in interface EditingProviderServices
CreateGeometryException
public String makeConsoleMessage(String preText, Map<String,String> options)
EditingProviderServices
makeConsoleMessage
in interface EditingProviderServices
preText
- i18n key of first part of message.options
- Map with accepted options. Keys of map should be first letter
of option and value of map should be an i18n key. For example,
a valid map could be <"A","arc_mode">, <"C","close_polyline">public Arc createEllipse(Point firstPointAxisA, Point secondPointAxisA, double halfLengthAxisB, int subtype) throws CreateGeometryException
EditingProviderServices
createEllipse
in interface EditingProviderServices
firstPointAxisA
- first point of A axissecondPointAxisA
- second point of B axishalfLengthAxisB
- half length of B axissubtype
- of ellipse See Geometry.SUBTYPES
CreateGeometryException