1 | /* AccessibleState.java -- a state of an accessible object
|
---|
2 | Copyright (C) 2002 Free Software Foundation
|
---|
3 |
|
---|
4 | This file is part of GNU Classpath.
|
---|
5 |
|
---|
6 | GNU Classpath is free software; you can redistribute it and/or modify
|
---|
7 | it under the terms of the GNU General Public License as published by
|
---|
8 | the Free Software Foundation; either version 2, or (at your option)
|
---|
9 | any later version.
|
---|
10 |
|
---|
11 | GNU Classpath is distributed in the hope that it will be useful, but
|
---|
12 | WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
14 | General Public License for more details.
|
---|
15 |
|
---|
16 | You should have received a copy of the GNU General Public License
|
---|
17 | along with GNU Classpath; see the file COPYING. If not, write to the
|
---|
18 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
---|
19 | 02111-1307 USA.
|
---|
20 |
|
---|
21 | Linking this library statically or dynamically with other modules is
|
---|
22 | making a combined work based on this library. Thus, the terms and
|
---|
23 | conditions of the GNU General Public License cover the whole
|
---|
24 | combination.
|
---|
25 |
|
---|
26 | As a special exception, the copyright holders of this library give you
|
---|
27 | permission to link this library with independent modules to produce an
|
---|
28 | executable, regardless of the license terms of these independent
|
---|
29 | modules, and to copy and distribute the resulting executable under
|
---|
30 | terms of your choice, provided that you also meet, for each linked
|
---|
31 | independent module, the terms and conditions of the license of that
|
---|
32 | module. An independent module is a module which is not derived from
|
---|
33 | or based on this library. If you modify this library, you may extend
|
---|
34 | this exception to your version of the library, but you are not
|
---|
35 | obligated to do so. If you do not wish to do so, delete this
|
---|
36 | exception statement from your version. */
|
---|
37 |
|
---|
38 | package javax.accessibility;
|
---|
39 |
|
---|
40 | /**
|
---|
41 | * A state portion of an accessible object. A combination of states represent
|
---|
42 | * the entire object state, in an AccessibleStateSet. For example, this could
|
---|
43 | * be "active" or "selected". This strongly typed "enumeration" supports
|
---|
44 | * localized strings. If the constants of this class are not adequate, new
|
---|
45 | * ones may be added in a similar matter, while avoiding a public constructor.
|
---|
46 | *
|
---|
47 | * @author Eric Blake <ebb9@email.byu.edu>
|
---|
48 | * @since 1.2
|
---|
49 | * @status updated to 1.4
|
---|
50 | */
|
---|
51 | public class AccessibleState extends AccessibleBundle
|
---|
52 | {
|
---|
53 | /**
|
---|
54 | * Indicates an active window, as well as an active child in a list or other
|
---|
55 | * collection.
|
---|
56 | *
|
---|
57 | * @see AccessibleRole#WINDOW
|
---|
58 | * @see AccessibleRole#FRAME
|
---|
59 | * @see AccessibleRole#DIALOG
|
---|
60 | */
|
---|
61 | public static final AccessibleState ACTIVE
|
---|
62 | = new AccessibleState("active");
|
---|
63 |
|
---|
64 | /**
|
---|
65 | * Indicates a pushed button, usually when the mouse has been pressed but
|
---|
66 | * not released.
|
---|
67 | *
|
---|
68 | * @see AccessibleRole#PUSH_BUTTON
|
---|
69 | */
|
---|
70 | public static final AccessibleState PRESSED
|
---|
71 | = new AccessibleState("pressed");
|
---|
72 |
|
---|
73 | /**
|
---|
74 | * Indicates an armed object, usually a button which has been pushed and
|
---|
75 | * the mouse has not left the button area.
|
---|
76 | *
|
---|
77 | * @see AccessibleRole#PUSH_BUTTON
|
---|
78 | */
|
---|
79 | public static final AccessibleState ARMED
|
---|
80 | = new AccessibleState("armed");
|
---|
81 |
|
---|
82 | /**
|
---|
83 | * Indicates an object is busy, such as a slider, scroll bar, or progress
|
---|
84 | * bar in transition.
|
---|
85 | *
|
---|
86 | * @see AccessibleRole#PROGRESS_BAR
|
---|
87 | * @see AccessibleRole#SCROLL_BAR
|
---|
88 | * @see AccessibleRole#SLIDER
|
---|
89 | */
|
---|
90 | public static final AccessibleState BUSY
|
---|
91 | = new AccessibleState("busy");
|
---|
92 |
|
---|
93 | /**
|
---|
94 | * Indicates an object is checked.
|
---|
95 | *
|
---|
96 | * @see AccessibleRole#TOGGLE_BUTTON
|
---|
97 | * @see AccessibleRole#RADIO_BUTTON
|
---|
98 | * @see AccessibleRole#CHECK_BOX
|
---|
99 | */
|
---|
100 | public static final AccessibleState CHECKED
|
---|
101 | = new AccessibleState("checked");
|
---|
102 |
|
---|
103 | /**
|
---|
104 | * Indicates the user can edit the component contents. This is usually for
|
---|
105 | * text, as other objects like scroll bars are automatically editable.
|
---|
106 | *
|
---|
107 | * @see #ENABLED
|
---|
108 | */
|
---|
109 | public static final AccessibleState EDITABLE
|
---|
110 | = new AccessibleState("editable");
|
---|
111 |
|
---|
112 | /**
|
---|
113 | * Indicates the object allows progressive disclosure of its children,
|
---|
114 | * usually in a collapsible tree or other hierachical object.
|
---|
115 | *
|
---|
116 | * @see #EXPANDED
|
---|
117 | * @see #COLLAPSED
|
---|
118 | * @see AccessibleRole#TREE
|
---|
119 | */
|
---|
120 | public static final AccessibleState EXPANDABLE
|
---|
121 | = new AccessibleState("expandable");
|
---|
122 |
|
---|
123 | /**
|
---|
124 | * Indicates that the object is collapsed, usually in a tree.
|
---|
125 | *
|
---|
126 | * @see #EXPANDABLE
|
---|
127 | * @see #EXPANDED
|
---|
128 | * @see AccessibleRole#TREE
|
---|
129 | */
|
---|
130 | public static final AccessibleState COLLAPSED
|
---|
131 | = new AccessibleState("collapsed");
|
---|
132 |
|
---|
133 | /**
|
---|
134 | * Indicates that the object is expanded, usually in a tree.
|
---|
135 | *
|
---|
136 | * @see #EXPANDABLE
|
---|
137 | * @see #COLLAPSED
|
---|
138 | * @see AccessibleRole#TREE
|
---|
139 | */
|
---|
140 | public static final AccessibleState EXPANDED
|
---|
141 | = new AccessibleState("expanded");
|
---|
142 |
|
---|
143 | /**
|
---|
144 | * Indicates that an object is enabled. In the absence of this state,
|
---|
145 | * graphics are often grayed out, and cannot be manipulated.
|
---|
146 | */
|
---|
147 | public static final AccessibleState ENABLED
|
---|
148 | = new AccessibleState("enabled");
|
---|
149 |
|
---|
150 | /**
|
---|
151 | * Indicates that an object can accept focus, which means it will process
|
---|
152 | * keyboard events when focused.
|
---|
153 | *
|
---|
154 | * @see #FOCUSED
|
---|
155 | */
|
---|
156 | public static final AccessibleState FOCUSABLE
|
---|
157 | = new AccessibleState("focusable");
|
---|
158 |
|
---|
159 | /**
|
---|
160 | * Indicates that an object has keyboard focus.
|
---|
161 | *
|
---|
162 | * @see #FOCUSABLE
|
---|
163 | */
|
---|
164 | public static final AccessibleState FOCUSED
|
---|
165 | = new AccessibleState("focused");
|
---|
166 |
|
---|
167 | /**
|
---|
168 | * Indicates that an object is minimized to an icon.
|
---|
169 | *
|
---|
170 | * @see AccessibleRole#FRAME
|
---|
171 | * @see AccessibleRole#INTERNAL_FRAME
|
---|
172 | */
|
---|
173 | public static final AccessibleState ICONIFIED
|
---|
174 | = new AccessibleState("iconified");
|
---|
175 |
|
---|
176 | /**
|
---|
177 | * Indicates that something must be done in the current object before
|
---|
178 | * interaction is allowed on other windows, usually for dialogs.
|
---|
179 | *
|
---|
180 | * @see AccessibleRole#DIALOG
|
---|
181 | */
|
---|
182 | public static final AccessibleState MODAL
|
---|
183 | = new AccessibleState("modal");
|
---|
184 |
|
---|
185 | /**
|
---|
186 | * Indicates that all pixels in the object are painted. If this state is not
|
---|
187 | * present, then the object has some degree of transparency, letting lower
|
---|
188 | * panes show through.
|
---|
189 | *
|
---|
190 | * @see Accessible#getAccessibleContext()
|
---|
191 | * @see AccessibleContext#getAccessibleComponent()
|
---|
192 | * @see AccessibleComponent#getBounds()
|
---|
193 | */
|
---|
194 | public static final AccessibleState OPAQUE
|
---|
195 | = new AccessibleState("opaque");
|
---|
196 |
|
---|
197 | /**
|
---|
198 | * Indicates the size of this object is not fixed.
|
---|
199 | *
|
---|
200 | * @see Accessible#getAccessibleContext()
|
---|
201 | * @see AccessibleContext#getAccessibleComponent()
|
---|
202 | * @see AccessibleComponent#getSize()
|
---|
203 | * @see AccessibleComponent#setSize(Dimension)
|
---|
204 | */
|
---|
205 | public static final AccessibleState RESIZABLE
|
---|
206 | = new AccessibleState("resizable");
|
---|
207 |
|
---|
208 | /**
|
---|
209 | * Indicates that multiple children can be selected at once.
|
---|
210 | *
|
---|
211 | * @see Accessible#getAccessibleContext()
|
---|
212 | * @see AccessibleContext#getAccessibleSelection()
|
---|
213 | * @see AccessibleSelection
|
---|
214 | */
|
---|
215 | public static final AccessibleState MULTISELECTABLE
|
---|
216 | = new AccessibleState("multiselectable");
|
---|
217 |
|
---|
218 | /**
|
---|
219 | * Indicates that this child is one which can be selected from its parent.
|
---|
220 | *
|
---|
221 | * @see #SELECTED
|
---|
222 | * @see Accessible#getAccessibleContext()
|
---|
223 | * @see AccessibleContext#getAccessibleSelection()
|
---|
224 | * @see AccessibleSelection
|
---|
225 | */
|
---|
226 | public static final AccessibleState SELECTABLE
|
---|
227 | = new AccessibleState("selectable");
|
---|
228 |
|
---|
229 | /**
|
---|
230 | * Indicates that this child has been selected from its parent.
|
---|
231 | *
|
---|
232 | * @see #SELECTABLE
|
---|
233 | * @see Accessible#getAccessibleContext()
|
---|
234 | * @see AccessibleContext#getAccessibleSelection()
|
---|
235 | * @see AccessibleSelection
|
---|
236 | */
|
---|
237 | public static final AccessibleState SELECTED
|
---|
238 | = new AccessibleState("selected");
|
---|
239 |
|
---|
240 | /**
|
---|
241 | * Indicates that this object and all its parents are visible, so that it
|
---|
242 | * is on the screen. However, something opaque may be on top of it.
|
---|
243 | *
|
---|
244 | * @see #VISIBLE
|
---|
245 | */
|
---|
246 | public static final AccessibleState SHOWING
|
---|
247 | = new AccessibleState("showing");
|
---|
248 |
|
---|
249 | /**
|
---|
250 | * Indicates that this object intends to be visible. However, if its
|
---|
251 | * parent is invisible, this object is as well.
|
---|
252 | *
|
---|
253 | * @see #SHOWING
|
---|
254 | */
|
---|
255 | public static final AccessibleState VISIBLE
|
---|
256 | = new AccessibleState("visible");
|
---|
257 |
|
---|
258 | /**
|
---|
259 | * Indicates that an object has vertical orientation.
|
---|
260 | *
|
---|
261 | * @see #HORIZONTAL
|
---|
262 | * @see AccessibleRole#SCROLL_BAR
|
---|
263 | * @see AccessibleRole#SLIDER
|
---|
264 | * @see AccessibleRole#PROGRESS_BAR
|
---|
265 | */
|
---|
266 | public static final AccessibleState VERTICAL
|
---|
267 | = new AccessibleState("vertical");
|
---|
268 |
|
---|
269 | /**
|
---|
270 | * Indicates that an object has horizontal orientation.
|
---|
271 | *
|
---|
272 | * @see #VERTICAL
|
---|
273 | * @see AccessibleRole#SCROLL_BAR
|
---|
274 | * @see AccessibleRole#SLIDER
|
---|
275 | * @see AccessibleRole#PROGRESS_BAR
|
---|
276 | */
|
---|
277 | public static final AccessibleState HORIZONTAL
|
---|
278 | = new AccessibleState("horizontal");
|
---|
279 |
|
---|
280 | /**
|
---|
281 | * Indicates that this text object can only hold a single line.
|
---|
282 | *
|
---|
283 | * @see #MULTI_LINE
|
---|
284 | */
|
---|
285 | public static final AccessibleState SINGLE_LINE
|
---|
286 | = new AccessibleState("single line");
|
---|
287 |
|
---|
288 | /**
|
---|
289 | * Indicates that this text object can hold multiple lines.
|
---|
290 | *
|
---|
291 | * @see #SINGLE_LINE
|
---|
292 | */
|
---|
293 | public static final AccessibleState MULTI_LINE
|
---|
294 | = new AccessibleState("multiple line");
|
---|
295 |
|
---|
296 | /**
|
---|
297 | * Indicates that this object is transient. This means the object is
|
---|
298 | * generated for method queries, but will never generate events, because
|
---|
299 | * its container (such as a tree, list, or table) does all the work.
|
---|
300 | */
|
---|
301 | public static final AccessibleState TRANSIENT
|
---|
302 | = new AccessibleState("transient");
|
---|
303 |
|
---|
304 | /**
|
---|
305 | * Create a new constant with a locale independent key. Follow the example,
|
---|
306 | * keep the constructor private and make public constants instead.
|
---|
307 | *
|
---|
308 | * @param key the name of the state
|
---|
309 | * @see #toDisplayString(String, Locale)
|
---|
310 | */
|
---|
311 | protected AccessibleState(String key)
|
---|
312 | {
|
---|
313 | this.key = key;
|
---|
314 | }
|
---|
315 | } // class AccessibleState
|
---|