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 theVectorrepresents 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 TypeMethodDescriptionbooleanadd(AccessibleState state) Adds a new state to the current state set if it is not already present.voidaddAll(AccessibleState[] states) Adds all of the states to the existing state set.voidclear()Removes all the states from the current state set.booleancontains(AccessibleState state) Checks if the current state is in the state set.booleanremove(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, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.inthashCode()Answers an integer hash code for the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Field Details
-
states
Each entry in theVectorrepresents 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 ofAccessibleStatedescribing 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:
trueif state is added to the state set;falseif the state set is unchanged
-
addAll
Adds all of the states to the existing state set. Duplicate entries are ignored.- Parameters:
states-AccessibleStatearray 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:
trueif the state is in the state set;falseif 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:
trueif the state is in the state set; otherwisefalse
-
toArray
Returns the current state set as an array ofAccessibleState.- Returns:
AccessibleStatearray containing the current state
-
toString
-