站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JDK 5 Documentation v1.2.2, Java 2 SDK 英文文档

Java(TM) 2 Platform, Standard Edition, v1.2.2 API Specification: Class AccessibleStateSet - JDK 5 Documentation v1.2.2, Java 2 SDK 英文文档

JavaTM 2 Platform
Standard Edition

javax.accessibility
Class AccessibleStateSet

java.lang.Object
  |
  +--javax.accessibility.AccessibleStateSet

public class AccessibleStateSet
extends Object

Class AccessibleStateSet determines a components state set. The state set of a component is a set of AccessibleState objects and descriptions the current overall state of the object, such as whether it is enabled, has focus, etc.

See Also:
AccessibleState

Field Summary
protected  Vector states
          Each entry in the Vector represents an AccessibleState.
 
Constructor Summary
AccessibleStateSet()
          Create a new empty state set.
AccessibleStateSet(AccessibleState[] states)
          Create a new state with the initial set of states contained in the array of states passed in.
 
Method Summary
 boolean add(AccessibleState state)
          Add a new state to the current state set if it is not already present.
 void addAll(AccessibleState[] states)
          Add all of the states to the existing state set.
 void clear()
          Remove all the states from the current state set.
 boolean contains(AccessibleState state)
          Check if the current state is in the state set.
 boolean remove(AccessibleState state)
          Remove a state from the current state set.
 AccessibleState[] toArray()
          Returns the current state set as an array of AccessibleState
 String toString()
          Create a localized String representing all the states in the set using the default locale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

states

protected Vector states
Each entry in the Vector represents an AccessibleState.
See Also:
add(javax.accessibility.AccessibleState), addAll(javax.accessibility.AccessibleState[]), remove(javax.accessibility.AccessibleState), contains(javax.accessibility.AccessibleState), toArray(), clear()
Constructor Detail

AccessibleStateSet

public AccessibleStateSet()
Create a new empty state set.

AccessibleStateSet

public AccessibleStateSet(AccessibleState[] states)
Create a new state with the initial set of states contained in the array of states passed in. Duplicate entries are ignored.
Parameters:
state - an array of AccessibleState describing the state set.
Method Detail

add

public boolean add(AccessibleState state)
Add 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 is false. Otherwise, the state is added to the state set and the return value is true.
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

public void addAll(AccessibleState[] states)
Add all of the states to the existing state set. Duplicate entries are ignored.
Parameters:
state - AccessibleState array describing the state set.

remove

public boolean remove(AccessibleState state)
Remove 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 be false. If the state is in the state set, it will be removed from the set and the return value will be true.
Parameters:
state - the state to remove from the state set
Returns:
true is the state is in the state set; false if the state set will be unchanged

clear

public void clear()
Remove all the states from the current state set.

contains

public boolean contains(AccessibleState state)
Check if the current state is in the state set.
Parameters:
state - the state
Returns:
true if the state is in the state set; otherwise false

toArray

public AccessibleState[] toArray()
Returns the current state set as an array of AccessibleState
Returns:
AccessibleState array conatining the current state.

toString

public String toString()
Create a localized String representing all the states in the set using the default locale.
Overrides:
toString in class Object
Returns:
comma separated localized String
See Also:
AccessibleBundle.toDisplayString(java.lang.String, java.util.Locale)

JavaTM 2 Platform
Standard Edition

Submit a bug or feature
Java, Java 2D, and JDBC are a trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1999 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.