public class DefaultEditingService extends AbstractService implements EditingService
ACTIVATE_NOTIFICATION, FINISH_AND_STORE_NOTIFICATION, FINISH_NOTIFICATION, NEXT_NOTIFICATION, PARAMETER_CHANGED1_NOTIFICATION, PARAMETER_CHANGED2_NOTIFICATION, RESTART_NOTIFICATION, START_NOTIFICATION, STOP_NOTIFICATION
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activate service
|
void |
addObserver(Observer o) |
void |
deleteObserver(Observer o) |
void |
deleteObservers() |
Geometry |
finish()
Finalizes service.
|
void |
finishAndStore()
Finalizes service and stores the result to
FeatureStore of this
service. |
EditableFeature |
getDefaultFeatureValues() |
java.lang.String |
getDescription() |
DrawingStatus |
getDrawingStatus(Point mousePosition)
Gets state of drawing.
|
IVectorLegend |
getLegend() |
Manager |
getManager()
Returns a reference to the
Manager which manages this server. |
java.lang.String |
getName()
Gets service name.
|
java.util.List<EditingServiceParameter> |
getParameters()
Gets a
List with all parameters of service. |
protected EditingProvider |
getProvider()
Returns the provider related to this service.
|
protected EditingProviderManager |
getProviderManager()
Returns the reference to the
ProviderManager . |
FeatureStore |
getStore() |
java.lang.Object |
getValue(EditingServiceParameter parameter)
Return the parameter's value
|
java.lang.Object |
getValue(EditingServiceParameter parameter,
EditingServiceParameter.TYPE type) |
boolean |
isEnabled(EditingServiceParameter parameter)
Return true if the parameter is enabled
|
boolean |
mustRestartAtFinish() |
EditingServiceParameter |
next()
Gets next parameter needed by service.
|
void |
restart() |
void |
setDefaultFeatureValues(EditableFeature feature) |
void |
setShowPreviewSymbol(boolean showPreviewSymbol) |
void |
setValue(EditingServiceParameter parameter,
java.lang.Object value)
Sets value into a paremeter of the service.The value will be put in the parameter of this service.
|
void |
setValue(java.lang.Object value)
Sets value to service.
|
void |
start()
Starts service.
|
void |
stop()
Stops service.
|
getProviderServices, getServiceParameters, init
protected EditingProvider getProvider()
AbstractService
getProvider
in class AbstractService
public Manager getManager()
Service
Manager
which manages this server.getManager
in interface Service
Manager
public DrawingStatus getDrawingStatus(Point mousePosition) throws DrawServiceException
EditingService
DrawingStatus
. 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 EditingService
mousePosition
- Mouse position to draw geometries.DrawingStatus
object with a list of geometries and
information.DrawServiceException
- if there are some error creating geometries.public java.util.List<EditingServiceParameter> getParameters()
EditingService
List
with all parameters of service. Each parameter
has name, description and types. See EditingServiceParameter
.getParameters
in interface EditingService
EditingServiceParameter
objects.public EditingServiceParameter next()
EditingService
null
if all
parameters have values.next
in interface EditingService
EditingServiceParameter
object that represents the
next parameter.public void setValue(java.lang.Object value) throws InvalidEntryException
EditingService
setValue
in interface EditingService
value
- Object to be set to next EditingServiceParameter
InvalidEntryException
- If the next parameter needed does not accept this value.public void stop() throws StopServiceException
EditingService
stop
in interface EditingService
StopServiceException
- Stops service initializing necessary parameters of service.
This method is called when user cancels service.public void finishAndStore() throws FinishServiceException
EditingService
FeatureStore
of this
service. Use this method to store the result of this service. Make sure
that service has all required values.finishAndStore
in interface EditingService
FinishServiceException
- if there are some error getting values,
creating geometries or inserting/updating/removing geometries
from feature store.public Geometry finish() throws FinishServiceException
EditingService
FeatureStore
. Make sure that service has all required
values.finish
in interface EditingService
FinishServiceException
- if there are some error getting values,
creating geometries.public void start() throws StartServiceException, InvalidEntryException
EditingService
start
in interface EditingService
StartServiceException
- if there are some error starting service.InvalidEntryException
- if the entry of provider is not validpublic java.lang.String getName()
EditingService
getName
in interface EditingService
public void setValue(EditingServiceParameter parameter, java.lang.Object value) throws InvalidEntryException
EditingService
setValue
in interface EditingService
parameter
- EditingServiceParameter
value
- Object to be set to EditingServiceParameter
InvalidEntryException
- If the next parameter needed does not accept this value.public boolean isEnabled(EditingServiceParameter parameter)
EditingService
isEnabled
in interface EditingService
public void activate()
EditingService
activate
in interface EditingService
public java.lang.Object getValue(EditingServiceParameter parameter)
EditingService
getValue
in interface EditingService
public java.lang.Object getValue(EditingServiceParameter parameter, EditingServiceParameter.TYPE type)
getValue
in interface EditingService
public void addObserver(Observer o)
addObserver
in interface Observable
public void deleteObserver(Observer o)
deleteObserver
in interface Observable
public void deleteObservers()
deleteObservers
in interface Observable
public void setDefaultFeatureValues(EditableFeature feature)
setDefaultFeatureValues
in interface EditingService
public EditableFeature getDefaultFeatureValues()
getDefaultFeatureValues
in interface EditingService
public FeatureStore getStore()
getStore
in interface EditingService
public IVectorLegend getLegend()
getLegend
in interface EditingService
public java.lang.String getDescription()
getDescription
in interface EditingService
protected EditingProviderManager getProviderManager()
AbstractService
ProviderManager
.getProviderManager
in class AbstractService
public void setShowPreviewSymbol(boolean showPreviewSymbol)
setShowPreviewSymbol
in interface EditingService
public void restart() throws StartServiceException, InvalidEntryException, StopServiceException
restart
in interface EditingService
StartServiceException
InvalidEntryException
StopServiceException
public boolean mustRestartAtFinish()
mustRestartAtFinish
in interface EditingService