public final class FeatureState extends Object implements AutoCloseable
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.
Modifier and Type | Field and Description |
---|---|
static FeatureState |
Hover
A feature state representing an object that is under the cursor.
|
static FeatureState |
Selected
A feature state representing an object that is selected.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
equals(Object other) |
protected void |
finalize() |
String |
getName()
Returns the name of this
FeatureState . |
static FeatureState |
getValue(String name)
Returns the
FeatureState with the given name. |
static List<FeatureState> |
getValues()
Lists all registered feature states, including the selection states that are available by default.
|
int |
hashCode() |
static FeatureState |
registerValue(String name)
Registers a new
FeatureState with the given name. |
public static FeatureState Selected
public static FeatureState Hover
public void close()
close
in interface AutoCloseable
@NotNull public static List<FeatureState> getValues()
@NotNull public static FeatureState registerValue(@NotNull String name) throws IllegalArgumentException
FeatureState
with the given name.
It is not allows the register multiple FeatureStates with the same name. If not, an exception will be thrown.
name
- the name for the feature state. Must be unique.IllegalArgumentException
- if the value already exists.@NotNull public static FeatureState getValue(@NotNull String name) throws IllegalArgumentException
FeatureState
with the given name.
If no such FeatureState
exists, an exception will be thrown.
name
- the name of the FeatureState
.FeatureState
with the given name.IllegalArgumentException
- if there is no feature state for the given name.@NotNull public String getName()
FeatureState
.FeatureState
.