public final class Creator extends Object implements AutoCloseable
Modifier and Type | Class and Description |
---|---|
static class |
Creator.Builder
|
Modifier and Type | Method and Description |
---|---|
void |
addObserver(ICreatorObserver observer)
Adds an observer that is called when a
Feature was created and added to the model, or when feature creation failed. |
void |
close() |
protected void |
finalize() |
FeatureLayer |
getPreviewLayer() |
static Creator.Builder |
newBuilder()
Returns a new builder for creating a
Creator . |
EventResult |
onEvent(IInputEvent inputEvent)
Handles the given event, and returns if the event was handled or not.
|
void |
removeObserver(ICreatorObserver observer)
Removes the given observer.
|
public void close()
close
in interface AutoCloseable
@NotNull public static Creator.Builder newBuilder()
Creator
.Creator
.@NotNull public EventResult onEvent(@NotNull IInputEvent inputEvent) throws NullPointerException
inputEvent
- an event, cannot be null
.NullPointerException
- when the input event is null
.@NotNull public FeatureLayer getPreviewLayer()
Feature
that is being created.public void addObserver(@NotNull ICreatorObserver observer) throws NullPointerException, IllegalArgumentException
Feature
was created and added to the model, or when feature creation failed.observer
- an observerIllegalArgumentException
- when the observer was already added.NullPointerException
- when the observer is null
.public void removeObserver(@NotNull ICreatorObserver observer) throws NullPointerException, IllegalArgumentException
If the given callback was never added, an exception is thrown.
observer
- an observer.IllegalArgumentException
- when the observer is not known.NullPointerException
- when the observer is null
.