List.java revision 2362
2362N/A * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * The <code>List</code> component presents the user with a 0N/A * scrolling list of text items. The list can be set up so that 0N/A * the user can choose either one item or multiple items. 0N/A * For example, the code . . . 0N/A * <hr><blockquote><pre> 0N/A * List lst = new List(4, false); 0N/A * lst.add("Mercury"); 0N/A * lst.add("JavaSoft"); 0N/A * lst.add("Jupiter"); 0N/A * lst.add("Saturn"); 0N/A * lst.add("Uranus"); 0N/A * lst.add("Neptune"); 0N/A * </pre></blockquote><hr> 0N/A * where <code>cnt</code> is a container, produces the following 0N/A * alt="Shows a list containing: Venus, Earth, JavaSoft, and Mars. Javasoft is selected." ALIGN=center HSPACE=10 VSPACE=7> 0N/A * If the List allows multiple selections, then clicking on 0N/A * an item that is already selected deselects it. In the preceding 0N/A * example, only one item from the scrolling list can be selected 0N/A * at a time, since the second argument when creating the new scrolling 0N/A * list is <code>false</code>. If the List does not allow multiple 0N/A * selections, selecting an item causes any other selected item 0N/A * Note that the list in the example shown was created with four visible 0N/A * rows. Once the list has been created, the number of visible rows 0N/A * cannot be changed. A default <code>List</code> is created with 0N/A * four rows, so that <code>lst = new List()</code> is equivalent to 0N/A * <code>list = new List(4, false)</code>. 0N/A * Beginning with Java 1.1, the Abstract Window Toolkit 0N/A * sends the <code>List</code> object all mouse, keyboard, and focus events 0N/A * that occur over it. (The old AWT event model is being maintained 0N/A * only for backwards compatibility, and its use is discouraged.) 0N/A * When an item is selected or deselected by the user, AWT sends an instance 0N/A * of <code>ItemEvent</code> to the list. 0N/A * When the user double-clicks on an item in a scrolling list, 0N/A * AWT sends an instance of <code>ActionEvent</code> to the 0N/A * list following the item event. AWT also generates an action event 0N/A * when the user presses the return key while an item in the 0N/A * If an application wants to perform some action based on an item 0N/A * in this list being selected or activated by the user, it should implement 0N/A * <code>ItemListener</code> or <code>ActionListener</code> 0N/A * as appropriate and register the new listener to receive 0N/A * events from this list. 0N/A * For multiple-selection scrolling lists, it is considered a better 0N/A * user interface to use an external gesture (such as clicking on a 0N/A * button) to trigger the action. 0N/A * @author Sami Shaio 0N/A * @see java.awt.event.ItemEvent 0N/A * @see java.awt.event.ItemListener 0N/A * @see java.awt.event.ActionEvent 0N/A * @see java.awt.event.ActionListener 0N/A * A vector created to contain items which will become 0N/A * part of the List Component. 0N/A * @see #addItem(String) 0N/A * @see #getItem(int) 0N/A * This field will represent the number of visible rows in the 0N/A * <code>List</code> Component. It is specified only once, and 0N/A * that is when the list component is actually 0N/A * created. It will never change. 0N/A * <code>multipleMode</code> is a variable that will 0N/A * be set to <code>true</code> if a list component is to be set to 0N/A * multiple selection mode, that is where the user can 0N/A * select more than one item in a list at one time. 0N/A * <code>multipleMode</code> will be set to false if the 0N/A * list component is set to single selection, that is where 0N/A * the user can only select one item on the list at any 0N/A * @see #isMultipleMode() 0N/A * @see #setMultipleMode(boolean) 0N/A * <code>selected</code> is an array that will contain 0N/A * the indices of items that have been selected. 0N/A * @see #getSelectedIndexes() 0N/A * @see #getSelectedIndex() 0N/A * This variable contains the value that will be used 0N/A * when trying to make a particular list item visible. 0N/A * @see #makeVisible(int) 0N/A * JDK 1.1 serialVersionUID 0N/A * Creates a new scrolling list. 0N/A * By default, there are four visible lines and multiple selections are 0N/A * not allowed. Note that this is a convenience method for 0N/A * <code>List(0, false)</code>. Also note that the number of visible 0N/A * lines in the list cannot be changed after it has been created. 0N/A * @exception HeadlessException if GraphicsEnvironment.isHeadless() 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Creates a new scrolling list initialized with the specified 0N/A * number of visible lines. By default, multiple selections are 0N/A * not allowed. Note that this is a convenience method for 0N/A * <code>List(rows, false)</code>. Also note that the number 0N/A * of visible rows in the list cannot be changed after it has 0N/A * @param rows the number of items to show. 0N/A * @exception HeadlessException if GraphicsEnvironment.isHeadless() 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * The default number of visible rows is 4. A list with 0N/A * zero rows is unusable and unsightly. 0N/A * Creates a new scrolling list initialized to display the specified 0N/A * number of rows. Note that if zero rows are specified, then 0N/A * the list will be created with a default of four rows. 0N/A * Also note that the number of visible rows in the list cannot 0N/A * be changed after it has been created. 0N/A * If the value of <code>multipleMode</code> is 0N/A * <code>true</code>, then the user can select multiple items from 0N/A * the list. If it is <code>false</code>, only one item at a time 0N/A * @param rows the number of items to show. 0N/A * @param multipleMode if <code>true</code>, 0N/A * then multiple selections are allowed; 0N/A * otherwise, only one item can be selected at a time. 0N/A * @exception HeadlessException if GraphicsEnvironment.isHeadless() 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Construct a name for this component. Called by 0N/A * <code>getName</code> when the name is <code>null</code>. 0N/A * Creates the peer for the list. The peer allows us to modify the 0N/A * list's appearance without changing its functionality. 0N/A * Removes the peer for this list. The peer allows us to modify the 0N/A * list's appearance without changing its functionality. 0N/A * Gets the number of items in the list. 0N/A * @return the number of items in the list 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>getItemCount()</code>. 0N/A * Gets the item associated with the specified index. 0N/A * @return an item that is associated with 0N/A * the specified index 0N/A * @param index the position of the item 0N/A * @see #getItemCount 0N/A // NOTE: This method may be called by privileged threads. 0N/A // We implement this functionality in a package-private method 0N/A // to insure that it cannot be overridden by client subclasses. 0N/A // DO NOT INVOKE CLIENT CODE ON THIS THREAD! 0N/A * Gets the items in the list. 0N/A * @return a string array containing items of the list 0N/A * @see #isIndexSelected 0N/A * Adds the specified item to the end of scrolling list. 0N/A * @param item the item to be added 0N/A * @deprecated replaced by <code>add(String)</code>. 0N/A * Adds the specified item to the the scrolling list 0N/A * at the position indicated by the index. The index is 0N/A * zero-based. If the value of the index is less than zero, 0N/A * or if the value of the index is greater than or equal to 0N/A * the number of items in the list, then the item is added 0N/A * to the end of the list. 0N/A * @param item the item to be added; 0N/A * if this parameter is <code>null</code> then the item is 0N/A * treated as an empty string, <code>""</code> 0N/A * @param index the position at which to add the item 0N/A * @deprecated replaced by <code>add(String, int)</code>. 0N/A * Replaces the item at the specified index in the scrolling list 0N/A * with the new string. 0N/A * @param newValue a new string to replace an existing item 0N/A * @param index the position of the item to replace 0N/A * @exception ArrayIndexOutOfBoundsException if <code>index</code> 0N/A * Removes all items from this list. 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>removeAll()</code>. 0N/A * Removes the first occurrence of an item from the list. 0N/A * If the specified item is selected, and is the only selected 0N/A * item in the list, the list is set to have no selection. 0N/A * @param item the item to remove from the list 0N/A * @exception IllegalArgumentException 0N/A * if the item doesn't exist in the list 0N/A " not found in list");
0N/A * Removes the item at the specified position 0N/A * from this scrolling list. 0N/A * If the item with the specified position is selected, and is the 0N/A * only selected item in the list, the list is set to have no selection. 0N/A * @param position the index of the item to delete 0N/A * @see #add(String, int) 0N/A * @exception ArrayIndexOutOfBoundsException 0N/A * if the <code>position</code> is less than 0 or 0N/A * greater than <code>getItemCount()-1</code> 0N/A * @deprecated replaced by <code>remove(String)</code> 0N/A * and <code>remove(int)</code>. 0N/A * Gets the index of the selected item on the list, 0N/A * @return the index of the selected item; 0N/A * if no item is selected, or if multiple items are 0N/A * selected, <code>-1</code> is returned. 0N/A * @see #isIndexSelected 0N/A * Gets the selected indexes on the list. 0N/A * @return an array of the selected indexes on this scrolling list; 0N/A * if no item is selected, a zero-length array is returned. 0N/A * @see #isIndexSelected 0N/A * Gets the selected item on this scrolling list. 0N/A * @return the selected item on the list; 0N/A * if no item is selected, or if multiple items are 0N/A * selected, <code>null</code> is returned. 0N/A * @see #isIndexSelected 0N/A * Gets the selected items on this scrolling list. 0N/A * @return an array of the selected items on this scrolling list; 0N/A * if no item is selected, a zero-length array is returned. 0N/A * @see #isIndexSelected 0N/A * Gets the selected items on this scrolling list in an array of Objects. 0N/A * @return an array of <code>Object</code>s representing the 0N/A * selected items on this scrolling list; 0N/A * if no item is selected, a zero-length array is returned. 0N/A * @see #getSelectedItems 0N/A * @see ItemSelectable 0N/A * Selects the item at the specified index in the scrolling list. 0N/A * Note that passing out of range parameters is invalid, 0N/A * and will result in unspecified behavior. 0N/A * <p>Note that this method should be primarily used to 0N/A * initially select an item in this component. 0N/A * Programmatically calling this method will <i>not</i> trigger 0N/A * an <code>ItemEvent</code>. The only way to trigger an 0N/A * <code>ItemEvent</code> is by user interaction. 0N/A * @param index the position of the item to select 0N/A * @see #getSelectedItem 0N/A * @see #isIndexSelected 0N/A // Bug #4059614: select can't be synchronized while calling the peer, 0N/A // because it is called from the Window Thread. It is sufficient to 0N/A // synchronize the code that manipulates 'selected' except for the 0N/A // case where the peer changes. To handle this case, we simply 0N/A // repeat the selection process. 0N/A * Deselects the item at the specified index. 0N/A * Note that passing out of range parameters is invalid, 0N/A * and will result in unspecified behavior. 0N/A * If the item at the specified index is not selected, 0N/A * then the operation is ignored. 0N/A * @param index the position of the item to deselect 0N/A * @see #getSelectedItem 0N/A * @see #isIndexSelected 0N/A * Determines if the specified item in this scrolling list is 0N/A * @param index the item to be checked 0N/A * @return <code>true</code> if the specified item has been 0N/A * selected; <code>false</code> otherwise 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>isIndexSelected(int)</code>. 0N/A * Gets the number of visible lines in this list. Note that 0N/A * once the <code>List</code> has been created, this number 0N/A * will never change. 0N/A * @return the number of visible lines in this scrolling list 0N/A * Determines whether this list allows multiple selections. 0N/A * @return <code>true</code> if this list allows multiple 0N/A * selections; otherwise, <code>false</code> 0N/A * @see #setMultipleMode 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>isMultipleMode()</code>. 0N/A * Sets the flag that determines whether this list 0N/A * allows multiple selections. 0N/A * When the selection mode is changed from multiple-selection to 0N/A * single-selection, the selected items change as follows: 0N/A * If a selected item has the location cursor, only that 0N/A * item will remain selected. If no selected item has the 0N/A * location cursor, all items will be deselected. 0N/A * @param b if <code>true</code> then multiple selections 0N/A * are allowed; otherwise, only one item from 0N/A * the list can be selected at once 0N/A * @see #isMultipleMode 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>setMultipleMode(boolean)</code>. 0N/A * Gets the index of the item that was last made visible by 0N/A * the method <code>makeVisible</code>. 0N/A * @return the index of the item that was last made visible 0N/A * Makes the item at the specified index visible. 0N/A * @param index the position of the item 0N/A * @see #getVisibleIndex 0N/A * Gets the preferred dimensions for a list with the specified 0N/A * @param rows number of rows in the list 0N/A * @return the preferred dimensions for displaying this scrolling list 0N/A * given that the specified number of rows must be visible 0N/A * @see java.awt.Component#getPreferredSize 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>getPreferredSize(int)</code>. 0N/A * Gets the preferred size of this scrolling list. 0N/A * @return the preferred dimensions for displaying this scrolling list 0N/A * @see java.awt.Component#getPreferredSize 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>getPreferredSize()</code>. 0N/A * Gets the minumum dimensions for a list with the specified 0N/A * @param rows number of rows in the list 0N/A * @return the minimum dimensions for displaying this scrolling list 0N/A * given that the specified number of rows must be visible 0N/A * @see java.awt.Component#getMinimumSize 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>getMinimumSize(int)</code>. 0N/A * Determines the minimum size of this scrolling list. 0N/A * @return the minimum dimensions needed 0N/A * to display this scrolling list 0N/A * @see java.awt.Component#getMinimumSize() 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>getMinimumSize()</code>. 0N/A * Adds the specified item listener to receive item events from 0N/A * this list. Item events are sent in response to user input, but not 0N/A * in response to calls to <code>select</code> or <code>deselect</code>. 0N/A * If listener <code>l</code> is <code>null</code>, 0N/A * no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the item listener 0N/A * @see #removeItemListener 0N/A * @see #getItemListeners 0N/A * @see java.awt.event.ItemEvent 0N/A * @see java.awt.event.ItemListener 0N/A * Removes the specified item listener so that it no longer 0N/A * receives item events from this list. 0N/A * If listener <code>l</code> is <code>null</code>, 0N/A * no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the item listener 0N/A * @see #addItemListener 0N/A * @see #getItemListeners 0N/A * @see java.awt.event.ItemEvent 0N/A * @see java.awt.event.ItemListener 0N/A * Returns an array of all the item listeners 0N/A * registered on this list. 0N/A * @return all of this list's <code>ItemListener</code>s 0N/A * or an empty array if no item 0N/A * listeners are currently registered 0N/A * @see #addItemListener 0N/A * @see #removeItemListener 0N/A * @see java.awt.event.ItemEvent 0N/A * @see java.awt.event.ItemListener 0N/A * Adds the specified action listener to receive action events from 0N/A * this list. Action events occur when a user double-clicks 0N/A * on a list item or types Enter when the list has the keyboard 0N/A * If listener <code>l</code> is <code>null</code>, 0N/A * no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the action listener 0N/A * @see #removeActionListener 0N/A * @see #getActionListeners 0N/A * @see java.awt.event.ActionEvent 0N/A * @see java.awt.event.ActionListener 0N/A * Removes the specified action listener so that it no longer 0N/A * receives action events from this list. Action events 0N/A * occur when a user double-clicks on a list item. 0N/A * If listener <code>l</code> is <code>null</code>, 0N/A * no exception is thrown and no action is performed. 0N/A * >AWT Threading Issues</a> for details on AWT's threading model. 0N/A * @param l the action listener 0N/A * @see #addActionListener 0N/A * @see #getActionListeners 0N/A * @see java.awt.event.ActionEvent 0N/A * @see java.awt.event.ActionListener 0N/A * Returns an array of all the action listeners 0N/A * registered on this list. 0N/A * @return all of this list's <code>ActionListener</code>s 0N/A * or an empty array if no action 0N/A * listeners are currently registered 0N/A * @see #addActionListener 0N/A * @see #removeActionListener 0N/A * @see java.awt.event.ActionEvent 0N/A * @see java.awt.event.ActionListener 0N/A * Returns an array of all the objects currently registered 0N/A * as <code><em>Foo</em>Listener</code>s 0N/A * upon this <code>List</code>. 0N/A * <code><em>Foo</em>Listener</code>s are registered using the 0N/A * <code>add<em>Foo</em>Listener</code> method. 0N/A * You can specify the <code>listenerType</code> argument 0N/A * with a class literal, such as 0N/A * <code><em>Foo</em>Listener.class</code>. 0N/A * For example, you can query a 0N/A * <code>List</code> <code>l</code> 0N/A * for its item listeners with the following code: 0N/A * <pre>ItemListener[] ils = (ItemListener[])(l.getListeners(ItemListener.class));</pre> 0N/A * If no such listeners exist, this method returns an empty array. 0N/A * @param listenerType the type of listeners requested; this parameter 0N/A * should specify an interface that descends from 0N/A * <code>java.util.EventListener</code> 0N/A * @return an array of all objects registered as 0N/A * <code><em>Foo</em>Listener</code>s on this list, 0N/A * or an empty array if no such 0N/A * listeners have been added 0N/A * @exception ClassCastException if <code>listenerType</code> 0N/A * doesn't specify a class or interface that implements 0N/A * <code>java.util.EventListener</code> 0N/A * @see #getItemListeners 0N/A // REMIND: remove when filtering is done at lower level 0N/A * Processes events on this scrolling list. If an event is 0N/A * an instance of <code>ItemEvent</code>, it invokes the 0N/A * <code>processItemEvent</code> method. Else, if the 0N/A * event is an instance of <code>ActionEvent</code>, 0N/A * it invokes <code>processActionEvent</code>. 0N/A * If the event is not an item event or an action event, 0N/A * it invokes <code>processEvent</code> on the superclass. 0N/A * <p>Note that if the event parameter is <code>null</code> 0N/A * the behavior is unspecified and may result in an 0N/A * @param e the event 0N/A * @see java.awt.event.ActionEvent 0N/A * @see java.awt.event.ItemEvent 0N/A * @see #processActionEvent 0N/A * @see #processItemEvent 0N/A * Processes item events occurring on this list by 0N/A * dispatching them to any registered 0N/A * <code>ItemListener</code> objects. 0N/A * This method is not called unless item events are 0N/A * enabled for this component. Item events are enabled 0N/A * when one of the following occurs: 0N/A * <li>An <code>ItemListener</code> object is registered 0N/A * via <code>addItemListener</code>. 0N/A * <li>Item events are enabled via <code>enableEvents</code>. 0N/A * <p>Note that if the event parameter is <code>null</code> 0N/A * the behavior is unspecified and may result in an 0N/A * @param e the item event 0N/A * @see java.awt.event.ItemEvent 0N/A * @see java.awt.event.ItemListener 0N/A * @see #addItemListener 0N/A * @see java.awt.Component#enableEvents 0N/A * Processes action events occurring on this component 0N/A * by dispatching them to any registered 0N/A * <code>ActionListener</code> objects. 0N/A * This method is not called unless action events are 0N/A * enabled for this component. Action events are enabled 0N/A * when one of the following occurs: 0N/A * <li>An <code>ActionListener</code> object is registered 0N/A * via <code>addActionListener</code>. 0N/A * <li>Action events are enabled via <code>enableEvents</code>. 0N/A * <p>Note that if the event parameter is <code>null</code> 0N/A * the behavior is unspecified and may result in an 0N/A * @param e the action event 0N/A * @see java.awt.event.ActionEvent 0N/A * @see java.awt.event.ActionListener 0N/A * @see #addActionListener 0N/A * @see java.awt.Component#enableEvents 0N/A * Returns the parameter string representing the state of this 0N/A * scrolling list. This string is useful for debugging. 0N/A * @return the parameter string of this scrolling list 0N/A * @deprecated As of JDK version 1.1, 0N/A * Not for public use in the future. 0N/A * This method is expected to be retained only as a package 0N/A * Serialization support. Since the value of the selected 0N/A * field isn't neccessarily up to date we sync it up with the 0N/A * peer before serializing. 0N/A * The <code>List</code> component's 0N/A * Serialized Data Version. 0N/A * Writes default serializable fields to stream. Writes 0N/A * a list of serializable <code>ItemListeners</code> 0N/A * and <code>ActionListeners</code> as optional data. 0N/A * The non-serializable listeners are detected and 0N/A * no attempt is made to serialize them. 0N/A * @serialData <code>null</code> terminated sequence of 0 0N/A * or more pairs; the pair consists of a <code>String</code> 0N/A * and an <code>Object</code>; the <code>String</code> 0N/A * indicates the type of object and is one of the 0N/A * <code>itemListenerK</code> indicating an 0N/A * <code>ItemListener</code> object; 0N/A * <code>actionListenerK</code> indicating an 0N/A * <code>ActionListener</code> object 0N/A * @param s the <code>ObjectOutputStream</code> to write 0N/A * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) 0N/A * @see java.awt.Component#itemListenerK 0N/A * @see java.awt.Component#actionListenerK 0N/A * @see #readObject(ObjectInputStream) 0N/A synchronized (
this) {
0N/A * Reads the <code>ObjectInputStream</code> and if it 0N/A * isn't <code>null</code> adds a listener to receive 0N/A * both item events and action events (as specified 0N/A * by the key stored in the stream) fired by the 0N/A * <code>List</code>. 0N/A * Unrecognized keys or values will be ignored. 0N/A * @param s the <code>ObjectInputStream</code> to write 0N/A * @exception HeadlessException if 0N/A * <code>GraphicsEnvironment.isHeadless</code> returns 0N/A * @see #removeItemListener(ItemListener) 0N/A * @see #addItemListener(ItemListener) 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * @see #writeObject(ObjectOutputStream) 0N/A else // skip value for unrecognized key 0N/A// Accessibility support 0N/A * Gets the <code>AccessibleContext</code> associated with this 0N/A * <code>List</code>. For lists, the <code>AccessibleContext</code> 0N/A * takes the form of an <code>AccessibleAWTList</code>. 0N/A * A new <code>AccessibleAWTList</code> instance is created, if necessary. 0N/A * @return an <code>AccessibleAWTList</code> that serves as the 0N/A * <code>AccessibleContext</code> of this <code>List</code> 0N/A * This class implements accessibility support for the 0N/A * <code>List</code> class. It provides an implementation of the 0N/A * Java Accessibility API appropriate to list user-interface elements. 0N/A * JDK 1.3 serialVersionUID 0N/A * Get the state set of this object. 0N/A * @return an instance of AccessibleState containing the current state 0N/A * @see AccessibleState 0N/A * Get the role of this object. 0N/A * @return an instance of AccessibleRole describing the role of the 0N/A * @see AccessibleRole 0N/A * Returns the Accessible child contained at the local coordinate 0N/A * Point, if one exists. 0N/A * @return the Accessible at the specified location, if it exists 0N/A return null;
// fredxFIXME Not implemented yet 0N/A * Returns the number of accessible children in the object. If all 0N/A * of the children of this object implement Accessible, than this 0N/A * method should return the number of children of this object. 0N/A * @return the number of accessible children in the object. 0N/A * Return the nth Accessible child of the object. 0N/A * @param i zero-based index of child 0N/A * @return the nth Accessible child of the object 0N/A * Get the AccessibleSelection associated with this object. In the 0N/A * implementation of the Java Accessibility API for this class, 0N/A * return this object, which is responsible for implementing the 0N/A * AccessibleSelection interface on behalf of itself. 0N/A * @return this object 0N/A // AccessibleSelection methods 0N/A * Returns the number of items currently selected. 0N/A * If no items are selected, the return value will be 0. 0N/A * @return the number of items currently selected. 0N/A * Returns an Accessible representing the specified selected item 0N/A * in the object. If there isn't a selection, or there are 0N/A * fewer items selected than the integer passed in, the return 0N/A * value will be null. 0N/A * @param i the zero-based index of selected items 0N/A * @return an Accessible containing the selected item 0N/A * Returns true if the current child of this object is selected. 0N/A * @param i the zero-based index of the child in this Accessible 0N/A * @see AccessibleContext#getAccessibleChild 0N/A * Adds the specified selected item in the object to the object's 0N/A * selection. If the object supports multiple selections, 0N/A * the specified item is added to any existing selection, otherwise 0N/A * it replaces any existing selection in the object. If the 0N/A * specified item is already selected, this method has no effect. 0N/A * @param i the zero-based index of selectable items 0N/A * Removes the specified selected item in the object from the object's 0N/A * selection. If the specified item isn't currently selected, this 0N/A * method has no effect. 0N/A * @param i the zero-based index of selectable items 0N/A * Clears the selection in the object, so that nothing in the 0N/A * object is selected. 0N/A * Causes every selected item in the object to be selected 0N/A * if the object supports multiple selections. 0N/A * This class implements accessibility support for 0N/A * List children. It provides an implementation of the 0N/A * Java Accessibility API appropriate to list children 0N/A * user-interface elements. 0N/A * JDK 1.3 serialVersionUID 0N/A // [[[FIXME]]] need to finish implementing this!!! 0N/A // required Accessible methods 0N/A * Gets the AccessibleContext for this object. In the 0N/A * implementation of the Java Accessibility API for this class, 0N/A * return this object, which acts as its own AccessibleContext. 0N/A * @return this object 0N/A // required AccessibleContext methods 0N/A * Get the role of this object. 0N/A * @return an instance of AccessibleRole describing the role of 0N/A * @see AccessibleRole 0N/A * Get the state set of this object. The AccessibleStateSet of an 0N/A * object is composed of a set of unique AccessibleState's. A 0N/A * change in the AccessibleStateSet of an object will cause a 0N/A * PropertyChangeEvent to be fired for the 0N/A * ACCESSIBLE_STATE_PROPERTY property. 0N/A * @return an instance of AccessibleStateSet containing the 0N/A * current state set of the object 0N/A * @see AccessibleStateSet 0N/A * @see AccessibleState 0N/A * @see #addPropertyChangeListener 0N/A * Gets the locale of the component. If the component does not 0N/A * have a locale, then the locale of its parent is returned. 0N/A * @return This component's locale. If this component does not have 0N/A * a locale, the locale of its parent is returned. 0N/A * @exception IllegalComponentStateException 0N/A * If the Component does not have its own locale and has not yet 0N/A * been added to a containment hierarchy such that the locale can 0N/A * be determined from the containing parent. 0N/A * Get the 0-based index of this object in its accessible parent. 0N/A * @return the 0-based index of this object in its parent; -1 if 0N/A * this object does not have an accessible parent. 0N/A * @see #getAccessibleParent 0N/A * @see #getAccessibleChildrenCount 0N/A * @see #getAccessibleChild 0N/A * Returns the number of accessible children of the object. 0N/A * @return the number of accessible children of the object. 0N/A return 0;
// list elements can't have children 0N/A * Return the specified Accessible child of the object. The 0N/A * Accessible children of an Accessible object are zero-based, 0N/A * so the first child of an Accessible child is at index 0, the 0N/A * second child is at index 1, and so on. 0N/A * @param i zero-based index of child 0N/A * @return the Accessible child of the object 0N/A * @see #getAccessibleChildrenCount 0N/A return null;
// list elements can't have children 0N/A // AccessibleComponent delegatation to parent List 0N/A * Get the background color of this object. 0N/A * @return the background color, if supported, of the object; 0N/A * @see #setBackground 0N/A * Set the background color of this object. 0N/A * @param c the new Color for the background 0N/A * @see #setBackground 0N/A * Get the foreground color of this object. 0N/A * @return the foreground color, if supported, of the object; 0N/A * @see #setForeground 0N/A * Set the foreground color of this object. 0N/A * @param c the new Color for the foreground 0N/A * @see #getForeground 0N/A * Get the Cursor of this object. 0N/A * @return the Cursor, if supported, of the object; otherwise, null 0N/A * Set the Cursor of this object. 0N/A * The method may have no visual effect if the Java platform 0N/A * implementation and/or the native system do not support 0N/A * changing the mouse cursor shape. 0N/A * @param cursor the new Cursor for the object 0N/A * Get the Font of this object. 0N/A * @return the Font,if supported, for the object; otherwise, null 0N/A * Set the Font of this object. 0N/A * @param f the new Font for the object 0N/A * Get the FontMetrics of this object. 0N/A * @return the FontMetrics, if supported, the object; otherwise, null 0N/A * Determine if the object is enabled. Objects that are enabled 0N/A * will also have the AccessibleState.ENABLED state set in their 0N/A * AccessibleStateSet. 0N/A * @return true if object is enabled; otherwise, false 0N/A * @see AccessibleContext#getAccessibleStateSet 0N/A * @see AccessibleState#ENABLED 0N/A * @see AccessibleStateSet 0N/A * Set the enabled state of the object. 0N/A * @param b if true, enables this object; otherwise, disables it 0N/A * Determine if the object is visible. Note: this means that the 0N/A * object intends to be visible; however, it may not be 0N/A * showing on the screen because one of the objects that this object 0N/A * is contained by is currently not visible. To determine if an 0N/A * object is showing on the screen, use isShowing(). 0N/A * <p>Objects that are visible will also have the 0N/A * AccessibleState.VISIBLE state set in their AccessibleStateSet. 0N/A * @return true if object is visible; otherwise, false 0N/A * @see AccessibleContext#getAccessibleStateSet 0N/A * @see AccessibleState#VISIBLE 0N/A * @see AccessibleStateSet 0N/A // [[[FIXME]]] needs to work like isShowing() below 0N/A // return parent.isVisible(); 0N/A * Set the visible state of the object. 0N/A * @param b if true, shows this object; otherwise, hides it 0N/A // [[[FIXME]]] should scroll to item to make it show! 0N/A * Determine if the object is showing. This is determined by 0N/A * checking the visibility of the object and visibility of the 0N/A * Note: this will return true even if the object is obscured 0N/A * by another (for example, it to object is underneath a menu 0N/A * that was pulled down). 0N/A * @return true if object is showing; otherwise, false 0N/A // [[[FIXME]]] only if it's showing!!! 0N/A // return parent.isShowing(); 0N/A * Checks whether the specified point is within this object's 0N/A * bounds, where the point's x and y coordinates are defined to 0N/A * be relative to the coordinate system of the object. 0N/A * @param p the Point relative to the coordinate system of the 0N/A * @return true if object contains Point; otherwise false 0N/A // [[[FIXME]]] - only if p is within the list element!!! 0N/A // return parent.contains(p); 0N/A * Returns the location of the object on the screen. 0N/A * @return location of object on screen; null if this object 0N/A * is not on the screen 0N/A * Gets the location of the object relative to the parent in the 0N/A * form of a point specifying the object's top-left corner in the 0N/A * screen's coordinate space. 0N/A * @return An instance of Point representing the top-left corner of 0N/A * the objects's bounds in the coordinate space of the screen; null 0N/A * if this object or its parent are not on the screen 0N/A * @see #getLocationOnScreen 0N/A * Sets the location of the object relative to the parent. 0N/A * @param p the new position for the top-left corner 0N/A // [[[FIXME]]] maybe - can simply return as no-op 0N/A * Gets the bounds of this object in the form of a Rectangle object. 0N/A * The bounds specify this object's width, height, and location 0N/A * relative to its parent. 0N/A * @return A rectangle indicating this component's bounds; null if 0N/A * this object is not on the screen. 0N/A * Sets the bounds of this object in the form of a Rectangle 0N/A * object. The bounds specify this object's width, height, and 0N/A * location relative to its parent. 0N/A * @param r rectangle indicating this component's bounds 0N/A // no-op; not supported 0N/A * Returns the size of this object in the form of a Dimension 0N/A * object. The height field of the Dimension object contains this 0N/A * objects's height, and the width field of the Dimension object 0N/A * contains this object's width. 0N/A * @return A Dimension object that indicates the size of this 0N/A * component; null if this object is not on the screen 0N/A * Resizes this object so that it has width and height. 0N/A * @param d - The dimension specifying the new size of the object. 0N/A // not supported; no-op 0N/A * Returns the <code>Accessible</code> child, if one exists, 0N/A * contained at the local coordinate <code>Point</code>. 0N/A * @param p the point relative to the coordinate system of this 0N/A * @return the <code>Accessible</code>, if it exists, 0N/A * at the specified location; otherwise <code>null</code> 0N/A return null;
// object cannot have children! 0N/A * Returns whether this object can accept focus or not. Objects 0N/A * that can accept focus will also have the 0N/A * <code>AccessibleState.FOCUSABLE</code> state set in their 0N/A * <code>AccessibleStateSet</code>. 0N/A * @return true if object can accept focus; otherwise false 0N/A * @see AccessibleContext#getAccessibleStateSet 0N/A * @see AccessibleState#FOCUSABLE 0N/A * @see AccessibleState#FOCUSED 0N/A * @see AccessibleStateSet 0N/A return false;
// list element cannot receive focus! 0N/A * Requests focus for this object. If this object cannot accept 0N/A * focus, nothing will happen. Otherwise, the object will attempt 0N/A * @see #isFocusTraversable 0N/A // nothing to do; a no-op 0N/A * Adds the specified focus listener to receive focus events from 0N/A * @param l the focus listener 0N/A * @see #removeFocusListener 0N/A // nothing to do; a no-op 0N/A * Removes the specified focus listener so it no longer receives 0N/A * focus events from this component. 0N/A * @param l the focus listener 0N/A * @see #addFocusListener 0N/A // nothing to do; a no-op 0N/A }
// inner class AccessibleAWTListChild 0N/A }
// inner class AccessibleAWTList