Class AccessibleStateSet
java.lang.Object
javax.accessibility.AccessibleStateSet
Class
AccessibleStateSet
determines a component's state set. The
state set of a component is a set of AccessibleState
objects and
descriptions. E.G., The current overall state of the object, such as whether
it is enabled, has focus, etc.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Vector
<AccessibleState> Each entry in theVector
represents anAccessibleState
. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty state set.AccessibleStateSet
(AccessibleState[] states) Creates a new state with the initial set of states contained in the array of states passed in. -
Method Summary
Modifier and TypeMethodDescriptionboolean
add
(AccessibleState state) Adds a new state to the current state set if it is not already present.void
addAll
(AccessibleState[] states) Adds all of the states to the existing state set.void
clear()
Removes all the states from the current state set.boolean
contains
(AccessibleState state) Checks if the current state is in the state set.boolean
remove
(AccessibleState state) Removes a state from the current state set.toArray()
Returns the current state set as an array ofAccessibleState
.toString()
Creates a localized string representing all the states in the set using the default locale.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Modifier and TypeMethodDescriptionprotected Object
clone()
Creates and returns a copy of this object.boolean
Indicates whether some other object is "equal to" this one.protected void
finalize()
Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class
<?> getClass()
Returns the runtime class of thisObject
.int
hashCode()
Returns a hash code value for this object.final void
notify()
Wakes up a single thread that is waiting on this object's monitor.final void
Wakes up all threads that are waiting on this object's monitor.final void
wait()
Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final void
wait
(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final void
wait
(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Field Details
-
states
Each entry in theVector
represents anAccessibleState
.- See Also:
-
-
Constructor Details
-
AccessibleStateSet
public AccessibleStateSet()Creates a new empty state set. -
AccessibleStateSet
Creates a new state with the initial set of states contained in the array of states passed in. Duplicate entries are ignored.- Parameters:
states
- an array ofAccessibleState
describing the state set
-
-
Method Details
-
add
Adds a new state to the current state set if it is not already present. If the state is already in the state set, the state set is unchanged and the return value isfalse
. Otherwise, the state is added to the state set and the return value istrue
.- Parameters:
state
- the state to add to the state set- Returns:
true
if state is added to the state set;false
if the state set is unchanged
-
addAll
Adds all of the states to the existing state set. Duplicate entries are ignored.- Parameters:
states
-AccessibleState
array describing the state set
-
remove
Removes a state from the current state set. If the state is not in the set, the state set will be unchanged and the return value will befalse
. If the state is in the state set, it will be removed from the set and the return value will betrue
.- Parameters:
state
- the state to remove from the state set- Returns:
true
if the state is in the state set;false
if the state set will be unchanged
-
clear
public void clear()Removes all the states from the current state set. -
contains
Checks if the current state is in the state set.- Parameters:
state
- the state- Returns:
true
if the state is in the state set; otherwisefalse
-
toArray
Returns the current state set as an array ofAccessibleState
.- Returns:
AccessibleState
array containing the current state
-
toString
-