public static final class Editor.Builder extends Object implements AutoCloseable
Constructor and Description |
---|
Builder(Editor.Builder other) |
Modifier and Type | Method and Description |
---|---|
Editor |
build()
Returns a new editor, based on the properties set on this builder.
|
void |
close() |
Editor.Builder |
defaultSettings(EditSettings editSettings)
Sets the default settings that can be used by the handles that are used to edit features and geometries.
|
Editor.Builder |
editCandidateProvider(IFeatureEditCandidateProvider editCandidateProvider)
Sets the
IFeatureEditCandidateProvider to use. |
protected void |
finalize() |
Editor.Builder |
map(Map map)
Sets the map on which features are edited.
|
Editor.Builder |
mouseCursorCallback(IMouseCursorCallback mouseCursorCallback)
Sets the
IMouseCursorCallback to use. |
public Builder(@NotNull Editor.Builder other)
public void close()
close
in interface AutoCloseable
@NotNull public Editor build() throws IllegalStateException
IllegalStateException
- if not all mandatory parameters are set@NotNull public Editor.Builder map(@NotNull Map map) throws NullPointerException
This parameter is mandatory. If it is not set, Editor.Builder#build
will throw an exception.
map
- the Map
on which to edit featuresNullPointerException
- when null
is passed.@NotNull public Editor.Builder editCandidateProvider(@NotNull IFeatureEditCandidateProvider editCandidateProvider) throws NullPointerException
IFeatureEditCandidateProvider
to use.
This parameter is optional. When it is not set, edit candidates will be based on selection through FeatureStateEditCandidateProvider
.
editCandidateProvider
- the edit candidate provider to use.NullPointerException
- when null
is passed.@NotNull public Editor.Builder mouseCursorCallback(@Nullable IMouseCursorCallback mouseCursorCallback)
IMouseCursorCallback
to use.
This callback is called when the Editor
's cursor has changed.
Typically, this method is called by an IController
implementation that supports Feature
editing. This implementation can call Map#setCursor
to effectively change the mouse cursor.
This callback is called on the UI thread only.
This parameter is optional.
mouseCursorCallback
- a callback that is called when the editor's cursor has changed.@NotNull public Editor.Builder defaultSettings(@NotNull EditSettings editSettings) throws NullPointerException
Feature
and Geometry
implementations are encouraged to use these default settings. The settings are available in the context
given as parameter to their methods.
This parameter is optional. If it is not provided, a default EditSettings
instance will be used.
editSettings
- the default settings to use. Should not be null
.NullPointerException
- when null
is passed.