1/* 2 * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26package javax.accessibility; 27 28/** 29 * Class {@code AccessibleTable} describes a user-interface component that 30 * presents data in a two-dimensional table format. 31 * 32 * @author Lynn Monsanto 33 * @since 1.3 34 */ 35public interface AccessibleTable { 36 37 /** 38 * Returns the caption for the table. 39 * 40 * @return the caption for the table 41 */ 42 public Accessible getAccessibleCaption(); 43 44 /** 45 * Sets the caption for the table. 46 * 47 * @param a the caption for the table 48 */ 49 public void setAccessibleCaption(Accessible a); 50 51 /** 52 * Returns the summary description of the table. 53 * 54 * @return the summary description of the table 55 */ 56 public Accessible getAccessibleSummary(); 57 58 /** 59 * Sets the summary description of the table. 60 * 61 * @param a the summary description of the table 62 */ 63 public void setAccessibleSummary(Accessible a); 64 65 /** 66 * Returns the number of rows in the table. 67 * 68 * @return the number of rows in the table 69 */ 70 public int getAccessibleRowCount(); 71 72 /** 73 * Returns the number of columns in the table. 74 * 75 * @return the number of columns in the table 76 */ 77 public int getAccessibleColumnCount(); 78 79 /** 80 * Returns the {@code Accessible} at a specified row and column in the 81 * table. 82 * 83 * @param r zero-based row of the table 84 * @param c zero-based column of the table 85 * @return the {@code Accessible} at the specified row and column 86 */ 87 public Accessible getAccessibleAt(int r, int c); 88 89 /** 90 * Returns the number of rows occupied by the {@code Accessible} at a 91 * specified row and column in the table. 92 * 93 * @param r zero-based row of the table 94 * @param c zero-based column of the table 95 * @return the number of rows occupied by the {@code Accessible} at a given 96 * specified (row, column) 97 */ 98 public int getAccessibleRowExtentAt(int r, int c); 99 100 /** 101 * Returns the number of columns occupied by the {@code Accessible} at a 102 * specified row and column in the table. 103 * 104 * @param r zero-based row of the table 105 * @param c zero-based column of the table 106 * @return the number of columns occupied by the {@code Accessible} at a 107 * given specified row and column 108 */ 109 public int getAccessibleColumnExtentAt(int r, int c); 110 111 /** 112 * Returns the row headers as an {@code AccessibleTable}. 113 * 114 * @return an {@code AccessibleTable} representing the row headers 115 */ 116 public AccessibleTable getAccessibleRowHeader(); 117 118 /** 119 * Sets the row headers. 120 * 121 * @param table an {@code AccessibleTable} representing the row headers 122 */ 123 public void setAccessibleRowHeader(AccessibleTable table); 124 125 /** 126 * Returns the column headers as an {@code AccessibleTable}. 127 * 128 * @return an {@code AccessibleTable} representing the column headers 129 */ 130 public AccessibleTable getAccessibleColumnHeader(); 131 132 /** 133 * Sets the column headers. 134 * 135 * @param table an {@code AccessibleTable} representing the column headers 136 */ 137 public void setAccessibleColumnHeader(AccessibleTable table); 138 139 /** 140 * Returns the description of the specified row in the table. 141 * 142 * @param r zero-based row of the table 143 * @return the description of the row 144 */ 145 public Accessible getAccessibleRowDescription(int r); 146 147 /** 148 * Sets the description text of the specified row of the table. 149 * 150 * @param r zero-based row of the table 151 * @param a the description of the row 152 */ 153 public void setAccessibleRowDescription(int r, Accessible a); 154 155 /** 156 * Returns the description text of the specified column in the table. 157 * 158 * @param c zero-based column of the table 159 * @return the text description of the column 160 */ 161 public Accessible getAccessibleColumnDescription(int c); 162 163 /** 164 * Sets the description text of the specified column in the table. 165 * 166 * @param c zero-based column of the table 167 * @param a the text description of the column 168 */ 169 public void setAccessibleColumnDescription(int c, Accessible a); 170 171 /** 172 * Returns a boolean value indicating whether the accessible at a specified 173 * row and column is selected. 174 * 175 * @param r zero-based row of the table 176 * @param c zero-based column of the table 177 * @return the boolean value {@code true} if the accessible at the row and 178 * column is selected. Otherwise, the boolean value {@code false} 179 */ 180 public boolean isAccessibleSelected(int r, int c); 181 182 /** 183 * Returns a boolean value indicating whether the specified row is selected. 184 * 185 * @param r zero-based row of the table 186 * @return the boolean value {@code true} if the specified row is selected. 187 * Otherwise, {@code false}. 188 */ 189 public boolean isAccessibleRowSelected(int r); 190 191 /** 192 * Returns a boolean value indicating whether the specified column is 193 * selected. 194 * 195 * @param c zero-based column of the table 196 * @return the boolean value {@code true} if the specified column is 197 * selected. Otherwise, {@code false}. 198 */ 199 public boolean isAccessibleColumnSelected(int c); 200 201 /** 202 * Returns the selected rows in a table. 203 * 204 * @return an array of selected rows where each element is a zero-based row 205 * of the table 206 */ 207 public int[] getSelectedAccessibleRows(); 208 209 /** 210 * Returns the selected columns in a table. 211 * 212 * @return an array of selected columns where each element is a zero-based 213 * column of the table 214 */ 215 public int[] getSelectedAccessibleColumns(); 216} 217