Package com.luciad.edit.features
Class FeatureStateEditCandidateProvider
java.lang.Object
com.luciad.edit.features.FeatureStateEditCandidateProvider
- All Implemented Interfaces:
IFeatureEditCandidateProvider
,AutoCloseable
public final class FeatureStateEditCandidateProvider
extends Object
implements AutoCloseable, IFeatureEditCandidateProvider
This
IFeatureEditCandidateProvider
uses enabled FeatureStates to determine editing candidates.
It can for example provide:
- selected objects (
FeatureState#selected()
) - hovered-over objects (
FeatureState#hover()
)
-
Constructor Summary
ConstructorDescriptionFeatureStateEditCandidateProvider
(Map map, FeatureState featureState) Creates a newFeatureStateEditCandidateProvider
for the given map, using the givenFeatureState
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addObserver
(IFeatureEditCandidateObserver observer) Adds an observer that allows you to receive change events from this edit candidate provider.void
close()
protected void
finalize()
List
<@NotNull LayerFeatureId> Returns the list of edit candidates.void
removeObserver
(IFeatureEditCandidateObserver observer) Removes the given observer.
-
Constructor Details
-
FeatureStateEditCandidateProvider
Creates a newFeatureStateEditCandidateProvider
for the given map, using the givenFeatureState
.- Parameters:
map
- the mapfeatureState
- aFeatureState
-
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
getEditCandidates
Returns the list of edit candidates.- Specified by:
getEditCandidates
in interfaceIFeatureEditCandidateProvider
- Returns:
- the list of edit candidates
-
addObserver
public void addObserver(@NotNull IFeatureEditCandidateObserver observer) throws NullPointerException, IllegalArgumentException Adds an observer that allows you to receive change events from this edit candidate provider.Adding the same observer twice is forbidden, and will cause an exception.
- Specified by:
addObserver
in interfaceIFeatureEditCandidateProvider
- Parameters:
observer
- an observer- Throws:
IllegalArgumentException
- when the observer was already added.NullPointerException
- when the observer isnull
.
-
removeObserver
public void removeObserver(@NotNull IFeatureEditCandidateObserver observer) throws NullPointerException, IllegalArgumentException Removes the given observer.If the given observer was never added, an exception is thrown.
- Specified by:
removeObserver
in interfaceIFeatureEditCandidateProvider
- Parameters:
observer
- an observer- Throws:
IllegalArgumentException
- when the observer is not known.NullPointerException
- when the observer isnull
.
-