public final class FeatureStateEditCandidateProvider extends Object implements AutoCloseable, IFeatureEditCandidateProvider
IFeatureEditCandidateProvider
uses enabled FeatureStates to determine editing candidates.
It can for example provide:
FeatureState#selected()
)
FeatureState#hover()
)
Constructor and Description |
---|
FeatureStateEditCandidateProvider(Map map,
FeatureState featureState)
Creates a new
FeatureStateEditCandidateProvider for the given map, using the given FeatureState . |
Modifier and Type | Method and Description |
---|---|
void |
addObserver(IFeatureEditCandidateObserver observer)
Adds an observer that allows you to receive change events from this edit candidate provider.
|
void |
close() |
protected void |
finalize() |
List<LayerFeatureId> |
getEditCandidates() |
void |
removeObserver(IFeatureEditCandidateObserver observer)
Removes the given observer.
|
public FeatureStateEditCandidateProvider(@NotNull Map map, @NotNull FeatureState featureState)
FeatureStateEditCandidateProvider
for the given map, using the given FeatureState
.map
- the mapfeatureState
- a FeatureState
public void close()
close
in interface AutoCloseable
@NotNull public List<LayerFeatureId> getEditCandidates()
getEditCandidates
in interface IFeatureEditCandidateProvider
public void addObserver(@NotNull IFeatureEditCandidateObserver observer) throws NullPointerException, IllegalArgumentException
Adding the same observer twice is forbidden, and will cause an exception.
addObserver
in interface IFeatureEditCandidateProvider
observer
- an observerIllegalArgumentException
- when the observer was already added.NullPointerException
- when the observer is null
.public void removeObserver(@NotNull IFeatureEditCandidateObserver observer) throws NullPointerException, IllegalArgumentException
If the given observer was never added, an exception is thrown.
removeObserver
in interface IFeatureEditCandidateProvider
observer
- an observerIllegalArgumentException
- when the observer is not known.NullPointerException
- when the observer is null
.