0N/A/*
2362N/A * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
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 *
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 *
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.
0N/A *
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
2362N/A * questions.
0N/A */
0N/A
0N/Apackage javax.accessibility;
0N/A
0N/Aimport java.awt.*;
0N/Aimport java.awt.event.*;
0N/A
0N/A/**
0N/A * The AccessibleComponent interface should be supported by any object
0N/A * that is rendered on the screen. This interface provides the standard
0N/A * mechanism for an assistive technology to determine and set the
0N/A * graphical representation of an object. Applications can determine
0N/A * if an object supports the AccessibleComponent interface by first
0N/A * obtaining its AccessibleContext
0N/A * and then calling the
0N/A * {@link AccessibleContext#getAccessibleComponent} method.
0N/A * If the return value is not null, the object supports this interface.
0N/A *
0N/A * @see Accessible
0N/A * @see Accessible#getAccessibleContext
0N/A * @see AccessibleContext
0N/A * @see AccessibleContext#getAccessibleComponent
0N/A *
0N/A * @author Peter Korn
0N/A * @author Hans Muller
0N/A * @author Willie Walker
0N/A */
0N/Apublic interface AccessibleComponent {
0N/A
0N/A /**
0N/A * Gets the background color of this object.
0N/A *
0N/A * @return the background color, if supported, of the object;
0N/A * otherwise, null
0N/A * @see #setBackground
0N/A */
0N/A public Color getBackground();
0N/A
0N/A /**
0N/A * Sets the background color of this object.
0N/A *
0N/A * @param c the new Color for the background
0N/A * @see #setBackground
0N/A */
0N/A public void setBackground(Color c);
0N/A
0N/A /**
0N/A * Gets the foreground color of this object.
0N/A *
0N/A * @return the foreground color, if supported, of the object;
0N/A * otherwise, null
0N/A * @see #setForeground
0N/A */
0N/A public Color getForeground();
0N/A
0N/A /**
0N/A * Sets the foreground color of this object.
0N/A *
0N/A * @param c the new Color for the foreground
0N/A * @see #getForeground
0N/A */
0N/A public void setForeground(Color c);
0N/A
0N/A /**
0N/A * Gets the Cursor of this object.
0N/A *
0N/A * @return the Cursor, if supported, of the object; otherwise, null
0N/A * @see #setCursor
0N/A */
0N/A public Cursor getCursor();
0N/A
0N/A /**
0N/A * Sets the Cursor of this object.
0N/A *
0N/A * @param cursor the new Cursor for the object
0N/A * @see #getCursor
0N/A */
0N/A public void setCursor(Cursor cursor);
0N/A
0N/A /**
0N/A * Gets the Font of this object.
0N/A *
0N/A * @return the Font,if supported, for the object; otherwise, null
0N/A * @see #setFont
0N/A */
0N/A public Font getFont();
0N/A
0N/A /**
0N/A * Sets the Font of this object.
0N/A *
0N/A * @param f the new Font for the object
0N/A * @see #getFont
0N/A */
0N/A public void setFont(Font f);
0N/A
0N/A /**
0N/A * Gets the FontMetrics of this object.
0N/A *
0N/A * @param f the Font
0N/A * @return the FontMetrics, if supported, the object; otherwise, null
0N/A * @see #getFont
0N/A */
0N/A public FontMetrics getFontMetrics(Font f);
0N/A
0N/A /**
0N/A * Determines if the object is enabled. Objects that are enabled
0N/A * will also have the AccessibleState.ENABLED state set in their
0N/A * AccessibleStateSets.
0N/A *
0N/A * @return true if object is enabled; otherwise, false
0N/A * @see #setEnabled
0N/A * @see AccessibleContext#getAccessibleStateSet
0N/A * @see AccessibleState#ENABLED
0N/A * @see AccessibleStateSet
0N/A */
0N/A public boolean isEnabled();
0N/A
0N/A /**
0N/A * Sets the enabled state of the object.
0N/A *
0N/A * @param b if true, enables this object; otherwise, disables it
0N/A * @see #isEnabled
0N/A */
0N/A public void setEnabled(boolean b);
0N/A
0N/A /**
0N/A * Determines 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 object is
0N/A * 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 AccessibleStateSets.
0N/A *
0N/A * @return true if object is visible; otherwise, false
0N/A * @see #setVisible
0N/A * @see AccessibleContext#getAccessibleStateSet
0N/A * @see AccessibleState#VISIBLE
0N/A * @see AccessibleStateSet
0N/A */
0N/A public boolean isVisible();
0N/A
0N/A /**
0N/A * Sets the visible state of the object.
0N/A *
0N/A * @param b if true, shows this object; otherwise, hides it
0N/A * @see #isVisible
0N/A */
0N/A public void setVisible(boolean b);
0N/A
0N/A /**
0N/A * Determines if the object is showing. This is determined by checking
0N/A * the visibility of the object and its ancestors.
0N/A * Note: this
0N/A * will return true even if the object is obscured by another (for example,
0N/A * it is underneath a menu that was pulled down).
0N/A *
0N/A * @return true if object is showing; otherwise, false
0N/A */
0N/A public boolean isShowing();
0N/A
0N/A /**
0N/A * Checks whether the specified point is within this object's bounds,
0N/A * where the point's x and y coordinates are defined to be relative to the
0N/A * coordinate system of the object.
0N/A *
0N/A * @param p the Point relative to the coordinate system of the object
0N/A * @return true if object contains Point; otherwise false
0N/A * @see #getBounds
0N/A */
0N/A public boolean contains(Point p);
0N/A
0N/A /**
0N/A * Returns the location of the object on the screen.
0N/A *
0N/A * @return the location of the object on screen; null if this object
0N/A * is not on the screen
0N/A * @see #getBounds
0N/A * @see #getLocation
0N/A */
0N/A public Point getLocationOnScreen();
0N/A
0N/A /**
0N/A * Gets the location of the object relative to the parent in the form
0N/A * of a point specifying the object's top-left corner in the screen's
0N/A * coordinate space.
0N/A *
0N/A * @return An instance of Point representing the top-left corner of the
0N/A * object's bounds in the coordinate space of the screen; null if
0N/A * this object or its parent are not on the screen
0N/A * @see #getBounds
0N/A * @see #getLocationOnScreen
0N/A */
0N/A public Point getLocation();
0N/A
0N/A /**
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 * @see #getLocation
0N/A */
0N/A public void setLocation(Point p);
0N/A
0N/A /**
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 *
0N/A * @return A rectangle indicating this component's bounds; null if
0N/A * this object is not on the screen.
0N/A * @see #contains
0N/A */
0N/A public Rectangle getBounds();
0N/A
0N/A /**
0N/A * Sets 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 *
0N/A * @param r rectangle indicating this component's bounds
0N/A * @see #getBounds
0N/A */
0N/A public void setBounds(Rectangle r);
0N/A
0N/A /**
0N/A * Returns the size of this object in the form of a Dimension object.
0N/A * The height field of the Dimension object contains this object's
0N/A * height, and the width field of the Dimension object contains this
0N/A * object's width.
0N/A *
0N/A * @return A Dimension object that indicates the size of this component;
0N/A * null if this object is not on the screen
0N/A * @see #setSize
0N/A */
0N/A public Dimension getSize();
0N/A
0N/A /**
0N/A * Resizes this object so that it has width and height.
0N/A *
0N/A * @param d The dimension specifying the new size of the object.
0N/A * @see #getSize
0N/A */
0N/A public void setSize(Dimension d);
0N/A
0N/A /**
0N/A * Returns the Accessible child, if one exists, contained at the local
0N/A * coordinate Point.
0N/A *
0N/A * @param p The point relative to the coordinate system of this object.
0N/A * @return the Accessible, if it exists, at the specified location;
0N/A * otherwise null
0N/A */
0N/A public Accessible getAccessibleAt(Point p);
0N/A
0N/A /**
0N/A * Returns whether this object can accept focus or not. Objects that
0N/A * can accept focus will also have the AccessibleState.FOCUSABLE state
0N/A * set in their AccessibleStateSets.
0N/A *
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 */
0N/A public boolean isFocusTraversable();
0N/A
0N/A /**
0N/A * Requests focus for this object. If this object cannot accept focus,
0N/A * nothing will happen. Otherwise, the object will attempt to take
0N/A * focus.
0N/A * @see #isFocusTraversable
0N/A */
0N/A public void requestFocus();
0N/A
0N/A /**
0N/A * Adds the specified focus listener to receive focus events from this
0N/A * component.
0N/A *
0N/A * @param l the focus listener
0N/A * @see #removeFocusListener
0N/A */
0N/A public void addFocusListener(FocusListener l);
0N/A
0N/A /**
0N/A * Removes the specified focus listener so it no longer receives focus
0N/A * events from this component.
0N/A *
0N/A * @param l the focus listener
0N/A * @see #addFocusListener
0N/A */
0N/A public void removeFocusListener(FocusListener l);
0N/A}