public final class MilitarySymbolFeatureCreator extends Object implements AutoCloseable, IFeatureCreator
This feature creator will
create a geometry
on the map
fill in
the remaining Feature
values using the created geometry
// set up a Creator for the feature and its geometry.
MilitarySymbology.Standard standard = MilitarySymbology.Standard.MilStd2525b;
MilitarySymbol symbol = MilitarySymbol.create(standard, "G*G*GPAR--****X");
MilitarySymbolFeatureCreator featureCreator = new MilitarySymbolFeatureCreator(symbol);
// Wire creation to the controller (here we're using DefaultController)
defaultController.setCreator(Creator.newBuilder().layer(editableLayer).map(map).featureCreator(featureCreator).build());
Creator
Constructor and Description |
---|
MilitarySymbolFeatureCreator(Feature initialFeature)
Creates a new
MilitarySymbolFeatureCreator that uses the given initial Feature . |
MilitarySymbolFeatureCreator(MilitarySymbol initialSymbol)
Creates a new
MilitarySymbolFeatureCreator that creates a Feature for the given symbol. |
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 MilitarySymbolFeatureCreator(@NotNull Feature initialFeature)
MilitarySymbolFeatureCreator
that uses the given initial Feature
.initialFeature
- the initial Feature
. It should have a valid symbol code and symbology.public MilitarySymbolFeatureCreator(@NotNull MilitarySymbol initialSymbol)
MilitarySymbolFeatureCreator
that creates a Feature
for the given symbol.initialSymbol
- the initial symbol.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.