public final class FeatureCreator extends Object implements AutoCloseable, IFeatureCreator
This creator will
create a geometry
on the map
fill in
the remaining Feature
values using the created geometry
This initial Feature
must contain the following:
assign the id
to newly added
features. In this case, the Feature
must not contain an id. Other models however, allow newly added features to already have an id. In that case, this Feature
must have an id.
apply a geometry
on a Feature
This creator doesn't consume any events itself, but it delegates the events to the wrapped geometry creator instance.
Creator
Constructor and Description |
---|
FeatureCreator(Feature initialFeature,
IGeometryCreator geometryCreator)
Creates a new
FeatureCreator . |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
finalize() |
EventResult |
onEvent(IInputEvent inputEvent,
FeatureCreateContext context)
Handles the given event, and returns if the event was handled or not.
|
void |
start(IFeatureCreateCallback callback,
FeatureCreateContext context)
This method is called to start creation.
|
public FeatureCreator(@NotNull Feature initialFeature, @NotNull IGeometryCreator geometryCreator) throws NullPointerException
FeatureCreator
.initialFeature
- the initial featuregeometryCreator
- the delegate geometry creator to use, cannot be null
.NullPointerException
- when the geometry creator is null
.public void close()
close
in interface AutoCloseable
public void start(@NotNull IFeatureCreateCallback callback, @NotNull FeatureCreateContext context) throws NullPointerException
After this call, IFeatureCreator#onEvent
can be called.
When a IFeatureCreator
was started, it can not be started again until it has stopped
. Implementations of this method are encouraged to throw an exception in that case to signal a programming error by the caller of this method.
start
in interface IFeatureCreator
callback
- the callback to signal feature changes, and whether creation for the feature has finished, cannot be null
.context
- the creation context, cannot be null
NullPointerException
- when null
is passed.@NotNull public EventResult onEvent(@NotNull IInputEvent inputEvent, @NotNull FeatureCreateContext context) throws NullPointerException
onEvent
in interface IFeatureCreator
inputEvent
- an event, cannot be null
context
- the creation context, cannot be null
NullPointerException
- when null
is passed.