Class Editor.Builder
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
Editor
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns a new editor, based on the properties set on this builder.void
close()
defaultSettings
(EditSettings editSettings) Sets the default settings that can be used by the handles that are used to edit features and geometries.editCandidateProvider
(IFeatureEditCandidateProvider editCandidateProvider) Sets theIFeatureEditCandidateProvider
to use.protected void
finalize()
Sets the map on which features are edited.mouseCursorCallback
(IMouseCursorCallback mouseCursorCallback) Sets theIMouseCursorCallback
to use.
-
Constructor Details
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
build
Returns a new editor, based on the properties set on this builder.- Returns:
- a new editor.
- Throws:
IllegalStateException
- if not all mandatory parameters are set
-
map
Sets the map on which features are edited.This parameter is mandatory. If it is not set,
Editor.Builder#build
will throw an exception.- Parameters:
map
- theMap
on which to edit features- Returns:
- this builder
- Throws:
NullPointerException
- whennull
is passed.
-
editCandidateProvider
@NotNull public Editor.Builder editCandidateProvider(@NotNull IFeatureEditCandidateProvider editCandidateProvider) throws NullPointerException Sets theIFeatureEditCandidateProvider
to use.This parameter is optional. When it is not set, edit candidates will be based on selection through
FeatureStateEditCandidateProvider
.- Parameters:
editCandidateProvider
- the edit candidate provider to use.- Returns:
- this builder
- Throws:
NullPointerException
- whennull
is passed.
-
mouseCursorCallback
@NotNull public Editor.Builder mouseCursorCallback(@Nullable IMouseCursorCallback mouseCursorCallback) Sets theIMouseCursorCallback
to use.This callback is called when the
Editor
's cursor has changed.Typically, this method is called by an
IController
implementation that supportsFeature
editing. This implementation can callMap#setCursor
to effectively change the mouse cursor.This callback is called on the UI thread only.
This parameter is optional.
- Parameters:
mouseCursorCallback
- a callback that is called when the editor's cursor has changed.- Returns:
- this builder
-
defaultSettings
@NotNull public Editor.Builder defaultSettings(@NotNull EditSettings editSettings) throws NullPointerException Sets the default settings that can be used by the handles that are used to edit features and geometries.Feature
andGeometry
implementations are encouraged to use these default settings. The settings are available in thecontext
given as parameter to their methods.This parameter is optional. If it is not provided, a default
EditSettings
instance will be used.- Parameters:
editSettings
- the default settings to use. Should not benull
.- Returns:
- this builder
- Throws:
NullPointerException
- whennull
is passed.
-