Package com.luciad.layers.features
Class FeatureState
java.lang.Object
com.luciad.layers.features.FeatureState
- All Implemented Interfaces:
AutoCloseable
Representation of the state of a feature.
By default the following states exist:
It is possible to register custom feature states using FeatureState#registerValue. You can use such custom feature states to style objects differently.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic FeatureStateA feature state representing an object that is under the cursor.static FeatureStateA feature state representing an object that is selected. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanprotected voidfinalize()getName()Returns the name of thisFeatureState.static FeatureStateReturns theFeatureStatewith the given name.static List<@NotNull FeatureState> Returns the registered feature states.inthashCode()static FeatureStateregisterValue(String name) Registers a newFeatureStatewith the given name.
-
Field Details
-
Selected
A feature state representing an object that is selected. -
Hover
A feature state representing an object that is under the cursor.
-
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
getValues
Returns the registered feature states.This includes the selection states that are available by default.
- Returns:
- the registered feature states.
-
registerValue
@NotNull public static FeatureState registerValue(@NotNull String name) throws IllegalArgumentException Registers a newFeatureStatewith the given name.It is not allows the register multiple FeatureStates with the same name. If not, an exception will be thrown.
- Parameters:
name- the name for the feature state. Must be unique.- Throws:
IllegalArgumentException- if the value already exists.
-
getValue
Returns theFeatureStatewith the given name.If no such
FeatureStateexists, an exception will be thrown.- Parameters:
name- the name of theFeatureState.- Returns:
- the
FeatureStatewith the given name. - Throws:
IllegalArgumentException- if there is no feature state for the given name.
-
getName
Returns the name of thisFeatureState.- Returns:
- the name of this
FeatureState.
-
hashCode
public int hashCode() -
equals
-