public class RegularPolygonEditingProvider extends AbstractEditingProvider implements EditingProvider
| Modifier and Type | Field and Description |
|---|---|
protected EditingServiceParameter |
center |
protected String |
DEFAULT_VALUE_MODE |
protected Integer |
DEFAULT_VALUE_SIDES |
protected Map<String,String> |
defaultValues |
protected FeatureStore |
featureStore |
protected EditingServiceParameter |
mode |
protected String |
MODE_KEY |
protected Map<String,String> |
options |
protected EditingServiceParameter |
pointOfCircle |
protected EditingServiceParameter |
polygonSides |
protected String |
SIDES_KEY |
protected Map<EditingServiceParameter,Object> |
values |
AGGREGATE, ARC, CIRCLE, CIRCUMFERENCE, COMPLEX, CURVE, ELLIPSE, ELLIPTICARC, FILLEDSPLINE, GEOMETRY, LINE, MULTICURVE, MULTILINE, MULTIPOINT, MULTIPOLYGON, MULTISOLID, MULTISURFACE, NULL, PERIELLIPSE, POINT, POLYGON, RING, SOLID, SPLINE, SURFACE| Constructor and Description |
|---|
RegularPolygonEditingProvider(ProviderServices providerServices,
DynObject parameters) |
| Modifier and Type | Method and Description |
|---|---|
protected Curve |
calculateRegularPolygon(String modeValue,
Point centerValue,
Point pointOfCircle,
int sidesValue)
Calculates polygon as of mode (inscribed or circumscribed), center of
polygon, point of circle and number of sides.
|
protected Geometry |
closeGeometry(Geometry geometry)
Close geometry if it is necessary.
|
Geometry |
finish()
Finalizes provider.
|
void |
finishAndStore()
Finalizes provider and stores the result to
FeatureStore of this
provider. |
DrawingStatus |
getDrawingStatus(Point mousePosition)
Gets state of drawing.
|
String |
getName()
Gets provider name.
|
List<EditingServiceParameter> |
getParameters()
Gets a
List with all parameters of provider. |
EditingServiceParameter |
next()
Gets next parameter needed by provider.
|
void |
setValue(Object value)
Sets value to provider.
|
void |
start()
Starts provider.
|
void |
stop()
Stops provider.
|
getProviderServices, setProviderServicesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetProviderServicesprotected final Integer DEFAULT_VALUE_SIDES
protected final String DEFAULT_VALUE_MODE
protected final String SIDES_KEY
protected final String MODE_KEY
protected EditingServiceParameter polygonSides
protected EditingServiceParameter center
protected EditingServiceParameter mode
protected EditingServiceParameter pointOfCircle
protected Map<EditingServiceParameter,Object> values
protected FeatureStore featureStore
public RegularPolygonEditingProvider(ProviderServices providerServices, DynObject parameters)
public EditingServiceParameter next()
EditingProvidernull if all
parameters have values.next in interface EditingProviderEditingServiceParameter object that represents the
next parameter.public DrawingStatus getDrawingStatus(Point mousePosition) throws DrawServiceException
EditingProviderDrawingStatus. List of
geometries of drawing status object can be different from final
geometries. Use this method to get a draft status information while user
is drawing.getDrawingStatus in interface EditingProvidermousePosition - Mouse position to draw geometries.DrawingStatus object with a list of geometries and
information.DrawServiceException - if there are some error creating geometries.protected Curve calculateRegularPolygon(String modeValue, Point centerValue, Point pointOfCircle, int sidesValue) throws BaseException
modeValue - of polygon (inscribed or circumscribed).centerValue - of polygonpointOfCircleValue - of circle that inscribe or circumscribe polygonsidesValue - number of sides.BaseExceptionprotected Geometry closeGeometry(Geometry geometry)
geometry - to be closed.public void stop()
throws StopServiceException
EditingProviderstop in interface EditingProviderStopServiceException - Stops provider initializing necessary parameters of provider.
This method is called when user cancels provider.public List<EditingServiceParameter> getParameters()
EditingProviderList with all parameters of provider. Each parameter
has name, description and types. See EditingServiceParameter.getParameters in interface EditingProviderEditingServiceParameter objects.public void setValue(Object value) throws InvalidEntryException
EditingProvidersetValue in interface EditingProvidervalue - Object to be set to next EditingServiceParameterInvalidEntryException - If the next parameter needed does not accept this value.public Geometry finish() throws FinishServiceException
EditingProviderFeatureStore. Make sure that provider has all required
values.finish in interface EditingProviderFinishServiceException - if there are some error getting values,
creating geometries.public void finishAndStore()
throws FinishServiceException
EditingProviderFeatureStore of this
provider. Use this method to store the result of this service. Make sure
that service has all required values.finishAndStore in interface EditingProviderFinishServiceException - if there are some error getting values,
creating geometries or inserting/updating/removing geometries
from feature store.public void start()
throws StartServiceException
EditingProviderstart in interface EditingProviderStartServiceException - if there are some error starting service.public String getName()
EditingProvidergetName in interface EditingProvider