Interface FeatureHandlesProvider.IHandleFactory
- Enclosing class:
FeatureHandlesProvider
It allows you to:
- replace the handle with another handle implementation
- (dynamically) disable or re-enable the translation handles
Note: Other handles are created by the delegate geometry handles provider.
Additional handles can not be added using this factory. The way to do this is to wrap the IEditHandles provided by FeatureHandlesProvider, and to insert additional handles in the IEditHandles#getList method.
-
Method Summary
Modifier and TypeMethodDescriptioncreateTranslateHandle(Observable<Feature> feature, Observable<Geometry> geometry, ITranslateEditAction editAction, FeatureEditContext context) Creates a handle that allows you to translate the entireGeometry.booleanisTranslateHandleValid(IEditHandle translateHandle, Observable<Feature> feature, Observable<Geometry> geometry, FeatureEditContext context) Returns true if the translate handle is still valid, or false if it should be removed.
-
Method Details
-
createTranslateHandle
@Nullable IEditHandle createTranslateHandle(@NotNull Observable<Feature> feature, @NotNull Observable<Geometry> geometry, @NotNull ITranslateEditAction editAction, @NotNull FeatureEditContext context) Creates a handle that allows you to translate the entireGeometry.While the handle is not already present, this method is called whenever the edited geometry changes.
- Parameters:
feature- the feature that is being editedgeometry- the feature'sGeometrythat is being editededitAction- the translate edit action, to be used by the handle. If a constraint was configured on the delegategeometry handles provider, this action applies that constraint when it is executed.context- the context- Returns:
- a new handle, or
nullif no handle should be used
-
isTranslateHandleValid
boolean isTranslateHandleValid(@NotNull IEditHandle translateHandle, @NotNull Observable<Feature> feature, @NotNull Observable<Geometry> geometry, @NotNull FeatureEditContext context) Returns true if the translate handle is still valid, or false if it should be removed.This method is called whenever the edited geometry changes and allows the factory to dynamically disable or re-create the edit handles. When this method returns false, the handle is removed and
createTranslateHandleis called, in case the handle should immediately be re-created. If the handle should remain absent, make sure to also returnnullin that method.- Parameters:
translateHandle- the handlefeature- the feature that is being editedgeometry- the feature'sGeometrythat is being editedcontext- the context- Returns:
- true if the given handle is still valid, or false if it should be removed.
-