Package org.gvsig.vectorediting.lib.api
Interface EditingService
- All Superinterfaces:
org.gvsig.tools.observer.Observable,org.gvsig.tools.service.Service
public interface EditingService
extends org.gvsig.tools.service.Service, org.gvsig.tools.observer.Observable
This service is used to interact with Editing providers. Each instance of
this has linked an Editing provider. At this moment services delegate all
functionality to providers. To get an instance of this use
invalid reference
EditingManager#getEditingService(String, org.gvsig.fmap.dal.feature.FeatureStore)
- Author:
- gvSIG team.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Activate serviceorg.gvsig.fmap.geom.Geometryfinish()Finalizes service.voidFinalizes service and stores the result toFeatureStoreof this service.org.gvsig.fmap.dal.feature.EditableFeaturegetDrawingStatus(org.gvsig.fmap.geom.primitive.Point mousePosition) Gets state of drawing.org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegendgetName()Gets service name.Gets aListwith all parameters of service.org.gvsig.fmap.dal.feature.FeatureStoregetStore()getValue(EditingServiceParameter parameter) Return the parameter's valuegetValue(EditingServiceParameter parameter, EditingServiceParameter.TYPE type) booleanisEnabled(EditingServiceParameter parameter) Return true if the parameter is enabledbooleannext()Gets next parameter needed by service.voidrestart()voidsetDefaultFeatureValues(org.gvsig.fmap.dal.feature.EditableFeature feature) voidsetShowPreviewSymbol(boolean showPreviewSymbol) voidSets value to service.voidsetValue(EditingServiceParameter parameter, Object value) Sets value into a paremeter of the service.The value will be put in the parameter of this service.voidstart()Starts service.voidstop()Stops service.Methods inherited from interface org.gvsig.tools.observer.Observable
addObserver, deleteObserver, deleteObserversMethods inherited from interface org.gvsig.tools.service.Service
getManager
-
Field Details
-
PARAMETER_CHANGED2_NOTIFICATION
- See Also:
-
ACTIVATE_NOTIFICATION
- See Also:
-
NEXT_NOTIFICATION
- See Also:
-
PARAMETER_CHANGED1_NOTIFICATION
- See Also:
-
STOP_NOTIFICATION
- See Also:
-
FINISH_AND_STORE_NOTIFICATION
- See Also:
-
FINISH_NOTIFICATION
- See Also:
-
START_NOTIFICATION
- See Also:
-
RESTART_NOTIFICATION
- See Also:
-
-
Method Details
-
getDrawingStatus
DrawingStatus getDrawingStatus(org.gvsig.fmap.geom.primitive.Point mousePosition) throws DrawServiceException Gets state of drawing. If this service has sufficient values with mouse position to create geometries returns aDrawingStatus. 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.- Parameters:
mousePosition- Mouse position to draw geometries.- Returns:
- A
DrawingStatusobject with a list of geometries and information. - Throws:
DrawServiceException- if there are some error creating geometries.
-
getParameters
List<EditingServiceParameter> getParameters()Gets aListwith all parameters of service. Each parameter has name, description and types. SeeEditingServiceParameter.- Returns:
- A list of
EditingServiceParameterobjects.
-
next
EditingServiceParameter next()Gets next parameter needed by service. The parameter has information about its name, description and types. Returnsnullif all parameters have values.- Returns:
- An
EditingServiceParameterobject that represents the next parameter.
-
setValue
Sets value to service. The value will be put in the next parameter need by this service.- Parameters:
value- Object to be set to nextEditingServiceParameter- Throws:
InvalidEntryException- If the next parameter needed does not accept this value.
-
setValue
Sets value into a paremeter of the service.The value will be put in the parameter of this service.- Parameters:
parameter-EditingServiceParametervalue- Object to be set toEditingServiceParameter- Throws:
InvalidEntryException- If the next parameter needed does not accept this value.
-
isEnabled
Return true if the parameter is enabled- Parameters:
parameter-- Returns:
-
stop
Stops service. Use this method to stop and clean values of service.- Throws:
StopServiceException- Stops service initializing necessary parameters of service. This method is called when user cancels service.
-
finish
Finalizes service. Use this method to get the result of service without store it toFeatureStore. Make sure that service has all required values.- Returns:
- Geometry created or modified from added values.
- Throws:
FinishServiceException- if there are some error getting values, creating geometries.
-
finishAndStore
Finalizes service and stores the result toFeatureStoreof this service. Use this method to store the result of this service. Make sure that service has all required values.- Throws:
FinishServiceException- if there are some error getting values, creating geometries or inserting/updating/removing geometries from feature store.
-
start
Starts service. Use this method before add values.- Throws:
StartServiceException- if there are some error starting service.InvalidEntryException- if the entry of provider is not valid
-
getName
String getName()Gets service name. The name of service is the same name of linked provider.- Returns:
- Name of service.
-
activate
void activate()Activate service -
getValue
Return the parameter's value- Parameters:
parameter-- Returns:
-
getValue
-
setDefaultFeatureValues
void setDefaultFeatureValues(org.gvsig.fmap.dal.feature.EditableFeature feature) -
getDefaultFeatureValues
org.gvsig.fmap.dal.feature.EditableFeature getDefaultFeatureValues() -
getStore
org.gvsig.fmap.dal.feature.FeatureStore getStore() -
getLegend
org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend getLegend() -
getDescription
String getDescription() -
setShowPreviewSymbol
void setShowPreviewSymbol(boolean showPreviewSymbol) -
restart
-
mustRestartAtFinish
boolean mustRestartAtFinish()
-