GNU Classpath (0.20) | |
Frames | No Frames |
1: /* AccessibleState.java -- a state of an accessible object 2: Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA 19: 02110-1301 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: import java.awt.Dimension; 41: import java.util.Locale; 42: 43: /** 44: * A state portion of an accessible object. A combination of states represent 45: * the entire object state, in an AccessibleStateSet. For example, this could 46: * be "active" or "selected". This strongly typed "enumeration" supports 47: * localized strings. If the constants of this class are not adequate, new 48: * ones may be added in a similar matter, while avoiding a public constructor. 49: * 50: * @author Eric Blake (ebb9@email.byu.edu) 51: * @since 1.2 52: * @status updated to 1.4 53: */ 54: public class AccessibleState extends AccessibleBundle 55: { 56: /** 57: * Indicates an active window, as well as an active child in a list or other 58: * collection. 59: * 60: * @see AccessibleRole#WINDOW 61: * @see AccessibleRole#FRAME 62: * @see AccessibleRole#DIALOG 63: */ 64: public static final AccessibleState ACTIVE 65: = new AccessibleState("active"); 66: 67: /** 68: * Indicates a pushed button, usually when the mouse has been pressed but 69: * not released. 70: * 71: * @see AccessibleRole#PUSH_BUTTON 72: */ 73: public static final AccessibleState PRESSED 74: = new AccessibleState("pressed"); 75: 76: /** 77: * Indicates an armed object, usually a button which has been pushed and 78: * the mouse has not left the button area. 79: * 80: * @see AccessibleRole#PUSH_BUTTON 81: */ 82: public static final AccessibleState ARMED 83: = new AccessibleState("armed"); 84: 85: /** 86: * Indicates an object is busy, such as a slider, scroll bar, or progress 87: * bar in transition. 88: * 89: * @see AccessibleRole#PROGRESS_BAR 90: * @see AccessibleRole#SCROLL_BAR 91: * @see AccessibleRole#SLIDER 92: */ 93: public static final AccessibleState BUSY 94: = new AccessibleState("busy"); 95: 96: /** 97: * Indicates an object is checked. 98: * 99: * @see AccessibleRole#TOGGLE_BUTTON 100: * @see AccessibleRole#RADIO_BUTTON 101: * @see AccessibleRole#CHECK_BOX 102: */ 103: public static final AccessibleState CHECKED 104: = new AccessibleState("checked"); 105: 106: /** 107: * Indicates the user can edit the component contents. This is usually for 108: * text, as other objects like scroll bars are automatically editable. 109: * 110: * @see #ENABLED 111: */ 112: public static final AccessibleState EDITABLE 113: = new AccessibleState("editable"); 114: 115: /** 116: * Indicates the object allows progressive disclosure of its children, 117: * usually in a collapsible tree or other hierachical object. 118: * 119: * @see #EXPANDED 120: * @see #COLLAPSED 121: * @see AccessibleRole#TREE 122: */ 123: public static final AccessibleState EXPANDABLE 124: = new AccessibleState("expandable"); 125: 126: /** 127: * Indicates that the object is collapsed, usually in a tree. 128: * 129: * @see #EXPANDABLE 130: * @see #EXPANDED 131: * @see AccessibleRole#TREE 132: */ 133: public static final AccessibleState COLLAPSED 134: = new AccessibleState("collapsed"); 135: 136: /** 137: * Indicates that the object is expanded, usually in a tree. 138: * 139: * @see #EXPANDABLE 140: * @see #COLLAPSED 141: * @see AccessibleRole#TREE 142: */ 143: public static final AccessibleState EXPANDED 144: = new AccessibleState("expanded"); 145: 146: /** 147: * Indicates that an object is enabled. In the absence of this state, 148: * graphics are often grayed out, and cannot be manipulated. 149: */ 150: public static final AccessibleState ENABLED 151: = new AccessibleState("enabled"); 152: 153: /** 154: * Indicates that an object can accept focus, which means it will process 155: * keyboard events when focused. 156: * 157: * @see #FOCUSED 158: */ 159: public static final AccessibleState FOCUSABLE 160: = new AccessibleState("focusable"); 161: 162: /** 163: * Indicates that an object has keyboard focus. 164: * 165: * @see #FOCUSABLE 166: */ 167: public static final AccessibleState FOCUSED 168: = new AccessibleState("focused"); 169: 170: /** 171: * Indicates that an object is minimized to an icon. 172: * 173: * @see AccessibleRole#FRAME 174: * @see AccessibleRole#INTERNAL_FRAME 175: */ 176: public static final AccessibleState ICONIFIED 177: = new AccessibleState("iconified"); 178: 179: /** 180: * Indicates that something must be done in the current object before 181: * interaction is allowed on other windows, usually for dialogs. 182: * 183: * @see AccessibleRole#DIALOG 184: */ 185: public static final AccessibleState MODAL 186: = new AccessibleState("modal"); 187: 188: /** 189: * Indicates that all pixels in the object are painted. If this state is not 190: * present, then the object has some degree of transparency, letting lower 191: * panes show through. 192: * 193: * @see Accessible#getAccessibleContext() 194: * @see AccessibleContext#getAccessibleComponent() 195: * @see AccessibleComponent#getBounds() 196: */ 197: public static final AccessibleState OPAQUE 198: = new AccessibleState("opaque"); 199: 200: /** 201: * Indicates the size of this object is not fixed. 202: * 203: * @see Accessible#getAccessibleContext() 204: * @see AccessibleContext#getAccessibleComponent() 205: * @see AccessibleComponent#getSize() 206: * @see AccessibleComponent#setSize(Dimension) 207: */ 208: public static final AccessibleState RESIZABLE 209: = new AccessibleState("resizable"); 210: 211: /** 212: * Indicates that multiple children can be selected at once. 213: * 214: * @see Accessible#getAccessibleContext() 215: * @see AccessibleContext#getAccessibleSelection() 216: * @see AccessibleSelection 217: */ 218: public static final AccessibleState MULTISELECTABLE 219: = new AccessibleState("multiselectable"); 220: 221: /** 222: * Indicates that this child is one which can be selected from its parent. 223: * 224: * @see #SELECTED 225: * @see Accessible#getAccessibleContext() 226: * @see AccessibleContext#getAccessibleSelection() 227: * @see AccessibleSelection 228: */ 229: public static final AccessibleState SELECTABLE 230: = new AccessibleState("selectable"); 231: 232: /** 233: * Indicates that this child has been selected from its parent. 234: * 235: * @see #SELECTABLE 236: * @see Accessible#getAccessibleContext() 237: * @see AccessibleContext#getAccessibleSelection() 238: * @see AccessibleSelection 239: */ 240: public static final AccessibleState SELECTED 241: = new AccessibleState("selected"); 242: 243: /** 244: * Indicates that this object and all its parents are visible, so that it 245: * is on the screen. However, something opaque may be on top of it. 246: * 247: * @see #VISIBLE 248: */ 249: public static final AccessibleState SHOWING 250: = new AccessibleState("showing"); 251: 252: /** 253: * Indicates that this object intends to be visible. However, if its 254: * parent is invisible, this object is as well. 255: * 256: * @see #SHOWING 257: */ 258: public static final AccessibleState VISIBLE 259: = new AccessibleState("visible"); 260: 261: /** 262: * Indicates that an object has vertical orientation. 263: * 264: * @see #HORIZONTAL 265: * @see AccessibleRole#SCROLL_BAR 266: * @see AccessibleRole#SLIDER 267: * @see AccessibleRole#PROGRESS_BAR 268: */ 269: public static final AccessibleState VERTICAL 270: = new AccessibleState("vertical"); 271: 272: /** 273: * Indicates that an object has horizontal orientation. 274: * 275: * @see #VERTICAL 276: * @see AccessibleRole#SCROLL_BAR 277: * @see AccessibleRole#SLIDER 278: * @see AccessibleRole#PROGRESS_BAR 279: */ 280: public static final AccessibleState HORIZONTAL 281: = new AccessibleState("horizontal"); 282: 283: /** 284: * Indicates that this text object can only hold a single line. 285: * 286: * @see #MULTI_LINE 287: */ 288: public static final AccessibleState SINGLE_LINE 289: = new AccessibleState("single line"); 290: 291: /** 292: * Indicates that this text object can hold multiple lines. 293: * 294: * @see #SINGLE_LINE 295: */ 296: public static final AccessibleState MULTI_LINE 297: = new AccessibleState("multiple line"); 298: 299: /** 300: * Indicates that this object is transient. This means the object is 301: * generated for method queries, but will never generate events, because 302: * its container (such as a tree, list, or table) does all the work. 303: */ 304: public static final AccessibleState TRANSIENT 305: = new AccessibleState("transient"); 306: 307: /** 308: * Create a new constant with a locale independent key. Follow the example, 309: * keep the constructor private and make public constants instead. 310: * 311: * @param key the name of the state 312: * @see #toDisplayString(String, Locale) 313: */ 314: protected AccessibleState(String key) 315: { 316: this.key = key; 317: } 318: } // class AccessibleState
GNU Classpath (0.20) |