# HG changeset patch # User serb # Date 1497310021 -10800 # Node ID 415b0831244fd571eebff4a621b81124c280d8f9 # Parent 6e591955c8a85c8c985c17fb65e2f757867b74ae 8181877: Cleanup of javadoc in javax.accessibility package Reviewed-by: prr diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibilityProvider.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibilityProvider.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibilityProvider.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,25 +22,26 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.accessibility; /** * Service Provider Interface (SPI) for Assistive Technology. *

- * This service provider class provides mappings from the platform - * specific accessibility APIs to the Java Accessibility API. + * This service provider class provides mappings from the platform specific + * accessibility APIs to the Java Accessibility API. *

* Each service provider implementation is named and can be activated via the * {@link #activate} method. Service providers can be loaded when the default * {@link java.awt.Toolkit toolkit} is initialized. * * @apiNote There will typically be one provider per platform, such as Windows - * or Linux, to support accessibility for screen readers and magnifiers. However, - * more than one service provider can be activated. For example, a test tool - * which provides visual results obtained by interrogating the Java Accessibility - * API can be activated along with the activation of the support for screen readers - * and screen magnifiers. - * + * or Linux, to support accessibility for screen readers and + * magnifiers. However, more than one service provider can be + * activated. For example, a test tool which provides visual results + * obtained by interrogating the Java Accessibility API can be + * activated along with the activation of the support for screen + * readers and screen magnifiers. * @see java.awt.Toolkit#getDefaultToolkit * @see java.util.ServiceLoader * @since 9 @@ -50,25 +51,34 @@ /** * Initializes a new accessibility provider. * - * @throws SecurityException - * If a security manager has been installed and it denies - * {@link RuntimePermission} {@code "accessibilityProvider"} + * @throws SecurityException If a security manager has been installed and it + * denies {@link RuntimePermission} {@code "accessibilityProvider"} */ protected AccessibilityProvider() { - // Use a permission check when calling a private constructor to check that - // the proper security permission has been granted before the Object superclass - // is called. If an exception is thrown before the Object superclass is - // constructed a finalizer in a subclass of this class will not be run. - // This protects against a finalizer vulnerability. + // Use a permission check when calling a private constructor to check + // that the proper security permission has been granted before the + // {@code Object} superclass is called. If an exception is thrown before + // the {@code Object} superclass is constructed a finalizer in a + // subclass of this class will not be run. This protects against a + // finalizer vulnerability. this(checkPermission()); } + /** + * Allows to check a permission before the {@code Object} is called. + * + * @param ignore unused stub to call a {@link #checkPermission()}} + */ private AccessibilityProvider(Void ignore) { } /** * If this code is running with a security manager and if the permission - * "accessibilityProvider" has not been granted SecurityException will be thrown. + * {@code "accessibilityProvider"} has not been granted + * {@code SecurityException} will be thrown. * + * @return {@code null} if {@code SecurityException} was not thrown + * @throws SecurityException If a security manager has been installed and it + * denies {@link RuntimePermission} {@code "accessibilityProvider"} */ private static Void checkPermission() { SecurityManager sm = System.getSecurityManager(); @@ -78,7 +88,7 @@ } /** - * Returns the name of this service provider. This name is used to locate a + * Returns the name of this service provider. This name is used to locate a * requested service provider. * * @return the name of this service provider @@ -89,5 +99,4 @@ * Activates the support provided by this service provider. */ public abstract void activate(); - } diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/Accessible.java --- a/src/java.desktop/share/classes/javax/accessibility/Accessible.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/Accessible.java Tue Jun 13 02:27:01 2017 +0300 @@ -26,26 +26,26 @@ package javax.accessibility; /** - * Interface Accessible is the main interface for the accessibility package. - * All components that support - * the accessibility package must implement this interface. - * It contains a single method, {@link #getAccessibleContext}, which - * returns an instance of the class {@link AccessibleContext}. + * Interface {@code Accessible} is the main interface for the accessibility + * package. All components that support the accessibility package must implement + * this interface. It contains a single method, {@link #getAccessibleContext}, + * which returns an instance of the class {@link AccessibleContext}. * - * @author Peter Korn - * @author Hans Muller - * @author Willie Walker + * @author Peter Korn + * @author Hans Muller + * @author Willie Walker */ public interface Accessible { /** - * Returns the AccessibleContext associated with this object. In most - * cases, the return value should not be null if the object implements - * interface Accessible. If a component developer creates a subclass - * of an object that implements Accessible, and that subclass - * is not Accessible, the developer should override the - * getAccessibleContext method to return null. - * @return the AccessibleContext associated with this object + * Returns the {@code AccessibleContext} associated with this object. In + * most cases, the return value should not be {@code null} if the object + * implements interface {@code Accessible}. If a component developer creates + * a subclass of an object that implements {@code Accessible}, and that + * subclass is not {@code Accessible}, the developer should override the + * {@code getAccessibleContext} method to return {@code null}. + * + * @return the {@code AccessibleContext} associated with this object */ public AccessibleContext getAccessibleContext(); } diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleAction.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleAction.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleAction.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,31 +26,31 @@ package javax.accessibility; /** - * The AccessibleAction interface should be supported by any object - * that can perform one or more actions. This interface - * provides the standard mechanism for an assistive technology to determine - * what those actions are as well as tell the object to perform them. - * Any object that can be manipulated should support this - * interface. Applications can determine if an object supports the - * AccessibleAction interface by first obtaining its AccessibleContext (see - * {@link Accessible}) and then calling the {@link AccessibleContext#getAccessibleAction} - * method. If the return value is not null, the object supports this interface. + * The {@code AccessibleAction} interface should be supported by any object that + * can perform one or more actions. This interface provides the standard + * mechanism for an assistive technology to determine what those actions are as + * well as tell the object to perform them. Any object that can be manipulated + * should support this interface. Applications can determine if an object + * supports the {@code AccessibleAction} interface by first obtaining its + * {@code AccessibleContext} (see {@link Accessible}) and then calling the + * {@link AccessibleContext#getAccessibleAction} method. If the return value is + * not {@code null}, the object supports this interface. * + * @author Peter Korn + * @author Hans Muller + * @author Willie Walker + * @author Lynn Monsanto * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleContext#getAccessibleAction - * - * @author Peter Korn - * @author Hans Muller - * @author Willie Walker - * @author Lynn Monsanto */ public interface AccessibleAction { /** - * An action which causes a tree node to - * collapse if expanded and expand if collapsed. + * An action which causes a tree node to collapse if expanded and expand if + * collapsed. + * * @since 1.5 */ public static final String TOGGLE_EXPAND = @@ -58,6 +58,7 @@ /** * An action which increments a value. + * * @since 1.5 */ public static final String INCREMENT = @@ -66,6 +67,7 @@ /** * An action which decrements a value. + * * @since 1.5 */ public static final String DECREMENT = @@ -73,6 +75,7 @@ /** * An action which causes a component to execute its default action. + * * @since 1.6 */ public static final String CLICK = new String("click"); @@ -80,33 +83,34 @@ /** * An action which causes a popup to become visible if it is hidden and * hidden if it is visible. + * * @since 1.6 */ public static final String TOGGLE_POPUP = new String("toggle popup"); /** - * Returns the number of accessible actions available in this object - * If there are more than one, the first one is considered the "default" - * action of the object. + * Returns the number of accessible actions available in this object If + * there are more than one, the first one is considered the "default" action + * of the object. * - * @return the zero-based number of Actions in this object + * @return the zero-based number of actions in this object */ public int getAccessibleActionCount(); /** * Returns a description of the specified action of the object. * - * @param i zero-based index of the actions - * @return a String description of the action + * @param i zero-based index of the actions + * @return a {@code String} description of the action * @see #getAccessibleActionCount */ public String getAccessibleActionDescription(int i); /** - * Performs the specified Action on the object + * Performs the specified action on the object. * - * @param i zero-based index of actions - * @return true if the action was performed; otherwise false. + * @param i zero-based index of actions + * @return {@code true} if the action was performed; otherwise {@code false} * @see #getAccessibleActionCount */ public boolean doAccessibleAction(int i); diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleAttributeSequence.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleAttributeSequence.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleAttributeSequence.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,51 +22,44 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.accessibility; import javax.swing.text.AttributeSet; - /** - *

The AccessibleAttributeSequence provides information about - * a contiguous sequence of text attributes - * - * @see Accessible - * @see Accessible#getAccessibleContext - * @see AccessibleContext - * @see AccessibleContext#getAccessibleText - * @see AccessibleTextSequence + * This class collects together the span of text that share the same contiguous + * set of attributes, along with that set of attributes. It is used by + * implementors of the class {@code AccessibleContext} in order to generate + * {@code ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED} events. * - * @author Lynn Monsanto - */ - -/** - * This class collects together the span of text that share the same - * contiguous set of attributes, along with that set of attributes. It - * is used by implementors of the class {@code AccessibleContext} in - * order to generate {@code ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED} events. - * - * @see javax.accessibility.AccessibleContext - * @see javax.accessibility.AccessibleContext#ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED + * @see AccessibleContext + * @see AccessibleContext#ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED */ public class AccessibleAttributeSequence { - /** The start index of the text sequence */ + + /** + * The start index of the text sequence. + */ public int startIndex; - /** The end index of the text sequence */ + /** + * The end index of the text sequence. + */ public int endIndex; - /** The text attributes */ + /** + * The text attributes. + */ public AttributeSet attributes; /** * Constructs an {@code AccessibleAttributeSequence} with the given * parameters. * - * @param start the beginning index of the span of text - * @param end the ending index of the span of text - * @param attr the {@code AttributeSet} shared by this text span - * + * @param start the beginning index of the span of text + * @param end the ending index of the span of text + * @param attr the {@code AttributeSet} shared by this text span * @since 1.6 */ public AccessibleAttributeSequence(int start, int end, AttributeSet attr) { @@ -74,5 +67,4 @@ endIndex = end; attributes = attr; } - }; diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleBundle.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleBundle.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleBundle.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,30 +27,31 @@ import java.util.Enumeration; import java.util.Hashtable; -import java.util.Vector; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; + import sun.awt.AWTAccessor; /** - *

Base class used to maintain a strongly typed enumeration. This is - * the superclass of {@link AccessibleState} and {@link AccessibleRole}. - *

The toDisplayString method allows you to obtain the localized string - * for a locale independent key from a predefined ResourceBundle for the - * keys defined in this class. This localized string is intended to be + * Base class used to maintain a strongly typed enumeration. This is the + * superclass of {@link AccessibleState} and {@link AccessibleRole}. + *

+ * The {@link #toDisplayString()} method allows you to obtain the localized + * string for a locale independent key from a predefined {@code ResourceBundle} + * for the keys defined in this class. This localized string is intended to be * readable by humans. * + * @author Willie Walker + * @author Peter Korn + * @author Lynn Monsanto * @see AccessibleRole * @see AccessibleState - * - * @author Willie Walker - * @author Peter Korn - * @author Lynn Monsanto */ public abstract class AccessibleBundle { private static Hashtable> table = new Hashtable<>(); + private final String defaultResourceBundleName = "com.sun.accessibility.internal.resources.accessibility"; @@ -72,23 +73,24 @@ } /** - * The locale independent name of the state. This is a programmatic - * name that is not intended to be read by humans. + * The locale independent name of the state. This is a programmatic name + * that is not intended to be read by humans. + * * @see #toDisplayString */ protected String key = null; /** - * Obtains the key as a localized string. - * If a localized string cannot be found for the key, the - * locale independent key stored in the role will be returned. - * This method is intended to be used only by subclasses so that they - * can specify their own resource bundles which contain localized + * Obtains the key as a localized string. If a localized string cannot be + * found for the key, the locale independent key stored in the role will be + * returned. This method is intended to be used only by subclasses so that + * they can specify their own resource bundles which contain localized * strings for their keys. - * @param resourceBundleName the name of the resource bundle to use for - * lookup - * @param locale the locale for which to obtain a localized string - * @return a localized String for the key. + * + * @param resourceBundleName the name of the resource bundle to use for + * lookup + * @param locale the locale for which to obtain a localized string + * @return a localized string for the key */ protected String toDisplayString(String resourceBundleName, Locale locale) { @@ -108,12 +110,12 @@ } /** - * Obtains the key as a localized string. - * If a localized string cannot be found for the key, the - * locale independent key stored in the role will be returned. + * Obtains the key as a localized string. If a localized string cannot be + * found for the key, the locale independent key stored in the role will be + * returned. * - * @param locale the locale for which to obtain a localized string - * @return a localized String for the key. + * @param locale the locale for which to obtain a localized string + * @return a localized string for the key */ public String toDisplayString(Locale locale) { return toDisplayString(defaultResourceBundleName, locale); @@ -121,7 +123,8 @@ /** * Gets localized string describing the key using the default locale. - * @return a localized String describing the key for the default locale + * + * @return a localized string describing the key using the default locale */ public String toDisplayString() { return toDisplayString(Locale.getDefault()); @@ -129,14 +132,15 @@ /** * Gets localized string describing the key using the default locale. - * @return a localized String describing the key using the default locale + * + * @return a localized string describing the key using the default locale * @see #toDisplayString */ public String toString() { return toDisplayString(); } - /* + /** * Loads the Accessibility resource bundle if necessary. */ private void loadResourceBundle(String resourceBundleName, @@ -164,5 +168,4 @@ } } } - } diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleComponent.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleComponent.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleComponent.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,36 +25,40 @@ package javax.accessibility; -import java.awt.*; -import java.awt.event.*; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.event.FocusListener; /** - * The AccessibleComponent interface should be supported by any object - * that is rendered on the screen. This interface provides the standard - * mechanism for an assistive technology to determine and set the - * graphical representation of an object. Applications can determine - * if an object supports the AccessibleComponent interface by first - * obtaining its AccessibleContext - * and then calling the - * {@link AccessibleContext#getAccessibleComponent} method. - * If the return value is not null, the object supports this interface. + * The {@code AccessibleComponent} interface should be supported by any object + * that is rendered on the screen. This interface provides the standard + * mechanism for an assistive technology to determine and set the graphical + * representation of an object. Applications can determine if an object supports + * the {@code AccessibleComponent} interface by first obtaining its + * {@code AccessibleContext} and then calling the + * {@link AccessibleContext#getAccessibleComponent} method. If the return value + * is not {@code null}, the object supports this interface. * + * @author Peter Korn + * @author Hans Muller + * @author Willie Walker * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleContext#getAccessibleComponent - * - * @author Peter Korn - * @author Hans Muller - * @author Willie Walker */ public interface AccessibleComponent { /** * Gets the background color of this object. * - * @return the background color, if supported, of the object; - * otherwise, null + * @return the background color, if supported, of the object; otherwise, + * {@code null} * @see #setBackground */ public Color getBackground(); @@ -62,7 +66,7 @@ /** * Sets the background color of this object. * - * @param c the new Color for the background + * @param c the new color for the background * @see #setBackground */ public void setBackground(Color c); @@ -70,8 +74,8 @@ /** * Gets the foreground color of this object. * - * @return the foreground color, if supported, of the object; - * otherwise, null + * @return the foreground color, if supported, of the object; otherwise, + * {@code null} * @see #setForeground */ public Color getForeground(); @@ -79,58 +83,59 @@ /** * Sets the foreground color of this object. * - * @param c the new Color for the foreground + * @param c the new color for the foreground * @see #getForeground */ public void setForeground(Color c); /** - * Gets the Cursor of this object. + * Gets the cursor of this object. * - * @return the Cursor, if supported, of the object; otherwise, null + * @return the cursor, if supported, of the object; otherwise, {@code null} * @see #setCursor */ public Cursor getCursor(); /** - * Sets the Cursor of this object. + * Sets the cursor of this object. * - * @param cursor the new Cursor for the object + * @param cursor the new cursor for the object * @see #getCursor */ public void setCursor(Cursor cursor); /** - * Gets the Font of this object. + * Gets the font of this object. * - * @return the Font,if supported, for the object; otherwise, null + * @return the font, if supported, for the object; otherwise, {@code null} * @see #setFont */ public Font getFont(); /** - * Sets the Font of this object. + * Sets the font of this object. * - * @param f the new Font for the object + * @param f the new font for the object * @see #getFont */ public void setFont(Font f); /** - * Gets the FontMetrics of this object. + * Gets the {@code FontMetrics} of this object. * - * @param f the Font - * @return the FontMetrics, if supported, the object; otherwise, null + * @param f the font for which font metrics is to be obtained + * @return the {@code FontMetrics}, if supported, the object; otherwise, + * {@code null} * @see #getFont */ public FontMetrics getFontMetrics(Font f); /** - * Determines if the object is enabled. Objects that are enabled - * will also have the AccessibleState.ENABLED state set in their - * AccessibleStateSets. + * Determines if the object is enabled. Objects that are enabled will also + * have the {@code AccessibleState.ENABLED} state set in their + * {@code AccessibleStateSets}. * - * @return true if object is enabled; otherwise, false + * @return {@code true} if object is enabled; otherwise, {@code false} * @see #setEnabled * @see AccessibleContext#getAccessibleStateSet * @see AccessibleState#ENABLED @@ -141,21 +146,23 @@ /** * Sets the enabled state of the object. * - * @param b if true, enables this object; otherwise, disables it + * @param b if {@code true}, enables this object; otherwise, disables it * @see #isEnabled */ public void setEnabled(boolean b); /** - * Determines if the object is visible. Note: this means that the - * object intends to be visible; however, it may not be - * showing on the screen because one of the objects that this object - * is contained by is currently not visible. To determine if an object is - * showing on the screen, use isShowing(). - *

Objects that are visible will also have the - * AccessibleState.VISIBLE state set in their AccessibleStateSets. + * Determines if the object is visible. Note: this means that the object + * intends to be visible; however, it may not be showing on the screen + * because one of the objects that this object is contained by is currently + * not visible. To determine if an object is showing on the screen, use + * {@link #isShowing()} + *

+ * Objects that are visible will also have the + * {@code AccessibleState.VISIBLE} state set in their + * {@code AccessibleStateSets}. * - * @return true if object is visible; otherwise, false + * @return {@code true} if object is visible; otherwise, {@code false} * @see #setVisible * @see AccessibleContext#getAccessibleStateSet * @see AccessibleState#VISIBLE @@ -166,29 +173,28 @@ /** * Sets the visible state of the object. * - * @param b if true, shows this object; otherwise, hides it + * @param b if {@code true}, shows this object; otherwise, hides it * @see #isVisible */ public void setVisible(boolean b); /** - * Determines if the object is showing. This is determined by checking - * the visibility of the object and its ancestors. - * Note: this - * will return true even if the object is obscured by another (for example, - * it is underneath a menu that was pulled down). + * Determines if the object is showing. This is determined by checking the + * visibility of the object and its ancestors. Note: this will return + * {@code true} even if the object is obscured by another (for example, it + * is underneath a menu that was pulled down). * - * @return true if object is showing; otherwise, false + * @return {@code true} if object is showing; otherwise, {@code false} */ public boolean isShowing(); /** - * Checks whether the specified point is within this object's bounds, - * where the point's x and y coordinates are defined to be relative to the + * Checks whether the specified point is within this object's bounds, where + * the point's x and y coordinates are defined to be relative to the * coordinate system of the object. * - * @param p the Point relative to the coordinate system of the object - * @return true if object contains Point; otherwise false + * @param p the point relative to the coordinate system of the object + * @return {@code true} if object contains point; otherwise {@code false} * @see #getBounds */ public boolean contains(Point p); @@ -196,21 +202,21 @@ /** * Returns the location of the object on the screen. * - * @return the location of the object on screen; null if this object - * is not on the screen + * @return the location of the object on screen; {@code null} if this object + * is not on the screen * @see #getBounds * @see #getLocation */ public Point getLocationOnScreen(); /** - * Gets the location of the object relative to the parent in the form - * of a point specifying the object's top-left corner in the screen's - * coordinate space. + * Gets the location of the object relative to the parent in the form of a + * point specifying the object's top-left corner in the screen's coordinate + * space. * - * @return An instance of Point representing the top-left corner of the - * object's bounds in the coordinate space of the screen; null if - * this object or its parent are not on the screen + * @return An instance of {@code Point} representing the top-left corner of + * the object's bounds in the coordinate space of the screen; + * {@code null} if this object or its parent are not on the screen * @see #getBounds * @see #getLocationOnScreen */ @@ -218,40 +224,41 @@ /** * Sets the location of the object relative to the parent. - * @param p the new position for the top-left corner + * + * @param p the new position for the top-left corner * @see #getLocation */ public void setLocation(Point p); /** - * Gets the bounds of this object in the form of a Rectangle object. - * The bounds specify this object's width, height, and location - * relative to its parent. + * Gets the bounds of this object in the form of a {@code Rectangle} object. + * The bounds specify this object's width, height, and location relative to + * its parent. * - * @return A rectangle indicating this component's bounds; null if - * this object is not on the screen. + * @return A rectangle indicating this component's bounds; {@code null} if + * this object is not on the screen. * @see #contains */ public Rectangle getBounds(); /** - * Sets the bounds of this object in the form of a Rectangle object. - * The bounds specify this object's width, height, and location - * relative to its parent. + * Sets the bounds of this object in the form of a {@code Rectangle} object. + * The bounds specify this object's width, height, and location relative to + * its parent. * - * @param r rectangle indicating this component's bounds + * @param r rectangle indicating this component's bounds * @see #getBounds */ public void setBounds(Rectangle r); /** - * Returns the size of this object in the form of a Dimension object. - * The height field of the Dimension object contains this object's - * height, and the width field of the Dimension object contains this - * object's width. + * Returns the size of this object in the form of a {@code Dimension} + * object. The {@code height} field of the {@code Dimension} object contains + * this object's height, and the {@code width} field of the + * {@code Dimension} object contains this object's width. * - * @return A Dimension object that indicates the size of this component; - * null if this object is not on the screen + * @return A {@code Dimension} object that indicates the size of this + * component; {@code null} if this object is not on the screen * @see #setSize */ public Dimension getSize(); @@ -259,27 +266,27 @@ /** * Resizes this object so that it has width and height. * - * @param d The dimension specifying the new size of the object. + * @param d The dimension specifying the new size of the object * @see #getSize */ public void setSize(Dimension d); /** - * Returns the Accessible child, if one exists, contained at the local - * coordinate Point. + * Returns the {@code Accessible} child, if one exists, contained at the + * local coordinate {@code Point}. * - * @param p The point relative to the coordinate system of this object. - * @return the Accessible, if it exists, at the specified location; - * otherwise null + * @param p The point relative to the coordinate system of this object + * @return the {@code Accessible}, if it exists, at the specified location; + * otherwise {@code null} */ public Accessible getAccessibleAt(Point p); /** - * Returns whether this object can accept focus or not. Objects that - * can accept focus will also have the AccessibleState.FOCUSABLE state - * set in their AccessibleStateSets. + * Returns whether this object can accept focus or not. Objects that can + * accept focus will also have the {@code AccessibleState.FOCUSABLE} state + * set in their {@code AccessibleStateSets}. * - * @return true if object can accept focus; otherwise false + * @return {@code true} if object can accept focus; otherwise {@code false} * @see AccessibleContext#getAccessibleStateSet * @see AccessibleState#FOCUSABLE * @see AccessibleState#FOCUSED @@ -288,9 +295,9 @@ public boolean isFocusTraversable(); /** - * Requests focus for this object. If this object cannot accept focus, - * nothing will happen. Otherwise, the object will attempt to take - * focus. + * Requests focus for this object. If this object cannot accept focus, + * nothing will happen. Otherwise, the object will attempt to take focus. + * * @see #isFocusTraversable */ public void requestFocus(); @@ -299,7 +306,7 @@ * Adds the specified focus listener to receive focus events from this * component. * - * @param l the focus listener + * @param l the focus listener * @see #removeFocusListener */ public void addFocusListener(FocusListener l); @@ -308,7 +315,7 @@ * Removes the specified focus listener so it no longer receives focus * events from this component. * - * @param l the focus listener + * @param l the focus listener * @see #addFocusListener */ public void removeFocusListener(FocusListener l); diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleContext.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleContext.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleContext.java Tue Jun 13 02:27:01 2017 +0300 @@ -25,63 +25,63 @@ package javax.accessibility; +import java.awt.IllegalComponentStateException; +import java.beans.BeanProperty; +import java.beans.JavaBean; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; +import java.util.Locale; + import sun.awt.AWTAccessor; import sun.awt.AppContext; -import java.util.Locale; -import java.beans.JavaBean; -import java.beans.BeanProperty; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; -import java.beans.PropertyChangeEvent; -import java.awt.IllegalComponentStateException; - /** - * AccessibleContext represents the minimum information all accessible objects - * return. This information includes the accessible name, description, role, - * and state of the object, as well as information about its parent and - * children. AccessibleContext also contains methods for - * obtaining more specific accessibility information about a component. - * If the component supports them, these methods will return an object that - * implements one or more of the following interfaces: + * {@code AccessibleContext} represents the minimum information all accessible + * objects return. This information includes the accessible name, description, + * role, and state of the object, as well as information about its parent and + * children. {@code AccessibleContext} also contains methods for obtaining more + * specific accessibility information about a component. If the component + * supports them, these methods will return an object that implements one or + * more of the following interfaces: *

+ *
  • {@link AccessibleAction} - the object can perform one or more actions. + * This interface provides the standard mechanism for an assistive technology + * to determine what those actions are and tell the object to perform them. + * Any object that can be manipulated should support this interface. + *
  • {@link AccessibleComponent} - the object has a graphical + * representation. This interface provides the standard mechanism for an + * assistive technology to determine and set the graphical representation of + * the object. Any object that is rendered on the screen should support this + * interface. + *
  • {@link AccessibleSelection} - the object allows its children to be + * selected. This interface provides the standard mechanism for an assistive + * technology to determine the currently selected children of the object as + * well as modify its selection set. Any object that has children that can be + * selected should support this interface. + *
  • {@link AccessibleText} - the object presents editable textual + * information on the display. This interface provides the standard mechanism + * for an assistive technology to access that text via its content, + * attributes, and spatial location. Any object that contains editable text + * should support this interface. + *
  • {@link AccessibleValue} - the object supports a numerical value. This + * interface provides the standard mechanism for an assistive technology to + * determine and set the current value of the object, as well as obtain its + * minimum and maximum values. Any object that supports a numerical value + * should support this interface. + * * - * @author Peter Korn - * @author Hans Muller - * @author Willie Walker - * @author Lynn Monsanto + * @author Peter Korn + * @author Hans Muller + * @author Willie Walker + * @author Lynn Monsanto */ @JavaBean(description = "Minimal information that all accessible objects return") public abstract class AccessibleContext { /** - * The AppContext that should be used to dispatch events for this - * AccessibleContext + * The {@code AppContext} that should be used to dispatch events for this + * {@code AccessibleContext}. */ private volatile AppContext targetAppContext; @@ -109,115 +109,118 @@ }); } - /** - * Constant used to determine when the accessibleName property has - * changed. The old value in the PropertyChangeEvent will be the old - * accessibleName and the new value will be the new accessibleName. - * - * @see #getAccessibleName - * @see #addPropertyChangeListener - */ - public static final String ACCESSIBLE_NAME_PROPERTY = "AccessibleName"; - - /** - * Constant used to determine when the accessibleDescription property has - * changed. The old value in the PropertyChangeEvent will be the - * old accessibleDescription and the new value will be the new - * accessibleDescription. - * - * @see #getAccessibleDescription - * @see #addPropertyChangeListener - */ - public static final String ACCESSIBLE_DESCRIPTION_PROPERTY = "AccessibleDescription"; + /** + * Constant used to determine when the {@link #accessibleName} property has + * changed. The old value in the {@code PropertyChangeEvent} will be the old + * {@code accessibleName} and the new value will be the new + * {@code accessibleName}. + * + * @see #getAccessibleName + * @see #addPropertyChangeListener + */ + public static final String ACCESSIBLE_NAME_PROPERTY = "AccessibleName"; - /** - * Constant used to determine when the accessibleStateSet property has - * changed. The old value will be the old AccessibleState and the new - * value will be the new AccessibleState in the accessibleStateSet. - * For example, if a component that supports the vertical and horizontal - * states changes its orientation from vertical to horizontal, the old - * value will be AccessibleState.VERTICAL and the new value will be - * AccessibleState.HORIZONTAL. Please note that either value can also - * be null. For example, when a component changes from being enabled - * to disabled, the old value will be AccessibleState.ENABLED - * and the new value will be null. - * - * @see #getAccessibleStateSet - * @see AccessibleState - * @see AccessibleStateSet - * @see #addPropertyChangeListener - */ - public static final String ACCESSIBLE_STATE_PROPERTY = "AccessibleState"; - - /** - * Constant used to determine when the accessibleValue property has - * changed. The old value in the PropertyChangeEvent will be a Number - * representing the old value and the new value will be a Number - * representing the new value - * - * @see #getAccessibleValue - * @see #addPropertyChangeListener - */ - public static final String ACCESSIBLE_VALUE_PROPERTY = "AccessibleValue"; + /** + * Constant used to determine when the {@link #accessibleDescription} + * property has changed. The old value in the {@code PropertyChangeEvent} + * will be the old {@code accessibleDescription} and the new value will be + * the new {@code accessibleDescription}. + * + * @see #getAccessibleDescription + * @see #addPropertyChangeListener + */ + public static final String ACCESSIBLE_DESCRIPTION_PROPERTY = "AccessibleDescription"; - /** - * Constant used to determine when the accessibleSelection has changed. - * The old and new values in the PropertyChangeEvent are currently - * reserved for future use. - * - * @see #getAccessibleSelection - * @see #addPropertyChangeListener - */ - public static final String ACCESSIBLE_SELECTION_PROPERTY = "AccessibleSelection"; - - /** - * Constant used to determine when the accessibleText caret has changed. - * The old value in the PropertyChangeEvent will be an - * integer representing the old caret position, and the new value will - * be an integer representing the new/current caret position. - * - * @see #addPropertyChangeListener - */ - public static final String ACCESSIBLE_CARET_PROPERTY = "AccessibleCaret"; + /** + * Constant used to determine when the {@code accessibleStateSet} property + * has changed. The old value will be the old {@code AccessibleState} and + * the new value will be the new {@code AccessibleState} in the + * {@code accessibleStateSet}. For example, if a component that supports the + * vertical and horizontal states changes its orientation from vertical to + * horizontal, the old value will be {@code AccessibleState.VERTICAL} and + * the new value will be {@code AccessibleState.HORIZONTAL}. Please note + * that either value can also be {@code null}. For example, when a component + * changes from being enabled to disabled, the old value will be + * {@code AccessibleState.ENABLED} and the new value will be {@code null}. + * + * @see #getAccessibleStateSet + * @see AccessibleState + * @see AccessibleStateSet + * @see #addPropertyChangeListener + */ + public static final String ACCESSIBLE_STATE_PROPERTY = "AccessibleState"; - /** - * Constant used to determine when the visual appearance of the object - * has changed. The old and new values in the PropertyChangeEvent are - * currently reserved for future use. - * - * @see #addPropertyChangeListener - */ - public static final String ACCESSIBLE_VISIBLE_DATA_PROPERTY = "AccessibleVisibleData"; - - /** - * Constant used to determine when Accessible children are added/removed - * from the object. If an Accessible child is being added, the old - * value will be null and the new value will be the Accessible child. If an - * Accessible child is being removed, the old value will be the Accessible - * child, and the new value will be null. - * - * @see #addPropertyChangeListener - */ - public static final String ACCESSIBLE_CHILD_PROPERTY = "AccessibleChild"; - - /** - * Constant used to determine when the active descendant of a component - * has changed. The active descendant is used for objects such as - * list, tree, and table, which may have transient children. When the - * active descendant has changed, the old value of the property change - * event will be the Accessible representing the previous active child, and - * the new value will be the Accessible representing the current active - * child. - * - * @see #addPropertyChangeListener - */ - public static final String ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY = "AccessibleActiveDescendant"; + /** + * Constant used to determine when the {@code accessibleValue} property has + * changed. The old value in the {@code PropertyChangeEvent} will be a + * {@code Number} representing the old value and the new value will be a + * {@code Number} representing the new value. + * + * @see #getAccessibleValue + * @see #addPropertyChangeListener + */ + public static final String ACCESSIBLE_VALUE_PROPERTY = "AccessibleValue"; /** - * Constant used to indicate that the table caption has changed - * The old value in the PropertyChangeEvent will be an Accessible - * representing the previous table caption and the new value will - * be an Accessible representing the new table caption. + * Constant used to determine when the {@code accessibleSelection} has + * changed. The old and new values in the {@code PropertyChangeEvent} are + * currently reserved for future use. + * + * @see #getAccessibleSelection + * @see #addPropertyChangeListener + */ + public static final String ACCESSIBLE_SELECTION_PROPERTY = "AccessibleSelection"; + + /** + * Constant used to determine when the {@code accessibleText} caret has + * changed. The old value in the {@code PropertyChangeEvent} will be an + * integer representing the old caret position, and the new value will be an + * integer representing the new/current caret position. + * + * @see #addPropertyChangeListener + */ + public static final String ACCESSIBLE_CARET_PROPERTY = "AccessibleCaret"; + + /** + * Constant used to determine when the visual appearance of the object has + * changed. The old and new values in the {@code PropertyChangeEvent} are + * currently reserved for future use. + * + * @see #addPropertyChangeListener + */ + public static final String ACCESSIBLE_VISIBLE_DATA_PROPERTY = "AccessibleVisibleData"; + + /** + * Constant used to determine when {@code Accessible} children are + * added/removed from the object. If an {@code Accessible} child is being + * added, the old value will be {@code null} and the new value will be the + * {@code Accessible} child. If an {@code Accessible} child is being + * removed, the old value will be the {@code Accessible} child, and the new + * value will be {@code null}. + * + * @see #addPropertyChangeListener + */ + public static final String ACCESSIBLE_CHILD_PROPERTY = "AccessibleChild"; + + /** + * Constant used to determine when the active descendant of a component has + * changed. The active descendant is used for objects such as list, tree, + * and table, which may have transient children. When the active descendant + * has changed, the old value of the property change event will be the + * {@code Accessible} representing the previous active child, and the new + * value will be the {@code Accessible} representing the current active + * child. + * + * @see #addPropertyChangeListener + */ + public static final String ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY = "AccessibleActiveDescendant"; + + /** + * Constant used to indicate that the table caption has changed. The old + * value in the {@code PropertyChangeEvent} will be an {@code Accessible} + * representing the previous table caption and the new value will be an + * {@code Accessible} representing the new table caption. + * * @see Accessible * @see AccessibleTable */ @@ -225,10 +228,11 @@ "accessibleTableCaptionChanged"; /** - * Constant used to indicate that the table summary has changed - * The old value in the PropertyChangeEvent will be an Accessible - * representing the previous table summary and the new value will - * be an Accessible representing the new table summary. + * Constant used to indicate that the table summary has changed. The old + * value in the {@code PropertyChangeEvent} will be an {@code Accessible} + * representing the previous table summary and the new value will be an + * {@code Accessible} representing the new table summary. + * * @see Accessible * @see AccessibleTable */ @@ -236,10 +240,11 @@ "accessibleTableSummaryChanged"; /** - * Constant used to indicate that table data has changed. - * The old value in the PropertyChangeEvent will be null and the - * new value will be an AccessibleTableModelChange representing - * the table change. + * Constant used to indicate that table data has changed. The old value in + * the {@code PropertyChangeEvent} will be {@code null} and the new value + * will be an {@code AccessibleTableModelChange} representing the table + * change. + * * @see AccessibleTable * @see AccessibleTableModelChange */ @@ -247,10 +252,11 @@ "accessibleTableModelChanged"; /** - * Constant used to indicate that the row header has changed - * The old value in the PropertyChangeEvent will be null and the - * new value will be an AccessibleTableModelChange representing - * the header change. + * Constant used to indicate that the row header has changed. The old value + * in the {@code PropertyChangeEvent} will be {@code null} and the new value + * will be an {@code AccessibleTableModelChange} representing the header + * change. + * * @see AccessibleTable * @see AccessibleTableModelChange */ @@ -258,19 +264,21 @@ "accessibleTableRowHeaderChanged"; /** - * Constant used to indicate that the row description has changed - * The old value in the PropertyChangeEvent will be null and the - * new value will be an Integer representing the row index. + * Constant used to indicate that the row description has changed. The old + * value in the {@code PropertyChangeEvent} will be {@code null} and the new + * value will be an {@code Integer} representing the row index. + * * @see AccessibleTable */ public static final String ACCESSIBLE_TABLE_ROW_DESCRIPTION_CHANGED = "accessibleTableRowDescriptionChanged"; /** - * Constant used to indicate that the column header has changed - * The old value in the PropertyChangeEvent will be null and the - * new value will be an AccessibleTableModelChange representing - * the header change. + * Constant used to indicate that the column header has changed. The old + * value in the {@code PropertyChangeEvent} will be {@code null} and the new + * value will be an {@code AccessibleTableModelChange} representing the + * header change. + * * @see AccessibleTable * @see AccessibleTableModelChange */ @@ -278,20 +286,22 @@ "accessibleTableColumnHeaderChanged"; /** - * Constant used to indicate that the column description has changed - * The old value in the PropertyChangeEvent will be null and the - * new value will be an Integer representing the column index. + * Constant used to indicate that the column description has changed. The + * old value in the {@code PropertyChangeEvent} will be {@code null} and the + * new value will be an {@code Integer} representing the column index. + * * @see AccessibleTable */ public static final String ACCESSIBLE_TABLE_COLUMN_DESCRIPTION_CHANGED = "accessibleTableColumnDescriptionChanged"; /** - * Constant used to indicate that the supported set of actions - * has changed. The old value in the PropertyChangeEvent will - * be an Integer representing the old number of actions supported - * and the new value will be an Integer representing the new - * number of actions supported. + * Constant used to indicate that the supported set of actions has changed. + * The old value in the {@code PropertyChangeEvent} will be an + * {@code Integer} representing the old number of actions supported and the + * new value will be an {@code Integer} representing the new number of + * actions supported. + * * @see AccessibleAction */ public static final String ACCESSIBLE_ACTION_PROPERTY = @@ -299,30 +309,33 @@ /** * Constant used to indicate that a hypertext element has received focus. - * The old value in the PropertyChangeEvent will be an Integer - * representing the start index in the document of the previous element - * that had focus and the new value will be an Integer representing - * the start index in the document of the current element that has - * focus. A value of -1 indicates that an element does not or did - * not have focus. + * The old value in the {@code PropertyChangeEvent} will be an + * {@code Integer} representing the start index in the document of the + * previous element that had focus and the new value will be an + * {@code Integer} representing the start index in the document of the + * current element that has focus. A value of -1 indicates that an element + * does not or did not have focus. + * * @see AccessibleHyperlink */ public static final String ACCESSIBLE_HYPERTEXT_OFFSET = "AccessibleHypertextOffset"; /** - * PropertyChangeEvent which indicates that text has changed. + * {@code PropertyChangeEvent} which indicates that text has changed. *
    - * For text insertion, the oldValue is null and the newValue - * is an AccessibleTextSequence specifying the text that was - * inserted. + * For text insertion, the {@code oldValue} is {@code null} and the + * {@code newValue} is an {@code AccessibleTextSequence} specifying the text + * that was inserted. *
    - * For text deletion, the oldValue is an AccessibleTextSequence - * specifying the text that was deleted and the newValue is null. + * For text deletion, the {@code oldValue} is an + * {@code AccessibleTextSequence} specifying the text that was deleted and + * the {@code newValue} is {@code null}. *
    - * For text replacement, the oldValue is an AccessibleTextSequence - * specifying the old text and the newValue is an AccessibleTextSequence - * specifying the new text. + * For text replacement, the {@code oldValue} is an + * {@code AccessibleTextSequence} specifying the old text and the + * {@code newValue} is an {@code AccessibleTextSequence} specifying the new + * text. * * @see #getAccessibleText * @see #addPropertyChangeListener @@ -332,53 +345,51 @@ = "AccessibleText"; /** - * PropertyChangeEvent which indicates that a significant change - * has occurred to the children of a component like a tree or text. - * This change notifies the event listener that it needs to - * reacquire the state of the subcomponents. The oldValue is - * null and the newValue is the component whose children have - * become invalid. + * {@code PropertyChangeEvent} which indicates that a significant change has + * occurred to the children of a component like a tree or text. This change + * notifies the event listener that it needs to reacquire the state of the + * subcomponents. The {@code oldValue} is {@code null} and the + * {@code newValue} is the component whose children have become invalid. * * @see #getAccessibleText * @see #addPropertyChangeListener * @see AccessibleTextSequence - * * @since 1.5 */ public static final String ACCESSIBLE_INVALIDATE_CHILDREN = "accessibleInvalidateChildren"; - /** - * PropertyChangeEvent which indicates that text attributes have changed. + /** + * {@code PropertyChangeEvent} which indicates that text attributes have + * changed. *
    - * For attribute insertion, the oldValue is null and the newValue - * is an AccessibleAttributeSequence specifying the attributes that were - * inserted. + * For attribute insertion, the {@code oldValue} is {@code null} and the + * {@code newValue} is an {@code AccessibleAttributeSequence} specifying the + * attributes that were inserted. *
    - * For attribute deletion, the oldValue is an AccessibleAttributeSequence - * specifying the attributes that were deleted and the newValue is null. + * For attribute deletion, the {@code oldValue} is an + * {@code AccessibleAttributeSequence} specifying the attributes that were + * deleted and the {@code newValue} is {@code null}. *
    - * For attribute replacement, the oldValue is an AccessibleAttributeSequence - * specifying the old attributes and the newValue is an - * AccessibleAttributeSequence specifying the new attributes. + * For attribute replacement, the {@code oldValue} is an + * {@code AccessibleAttributeSequence} specifying the old attributes and the + * {@code newValue} is an {@code AccessibleAttributeSequence} specifying the + * new attributes. * * @see #getAccessibleText * @see #addPropertyChangeListener * @see AccessibleAttributeSequence - * * @since 1.5 */ public static final String ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED = "accessibleTextAttributesChanged"; - /** - * PropertyChangeEvent which indicates that a change has occurred - * in a component's bounds. - * The oldValue is the old component bounds and the newValue is - * the new component bounds. + /** + * {@code PropertyChangeEvent} which indicates that a change has occurred in + * a component's bounds. The {@code oldValue} is the old component bounds + * and the {@code newValue} is the new component bounds. * * @see #addPropertyChangeListener - * * @since 1.5 */ public static final String ACCESSIBLE_COMPONENT_BOUNDS_CHANGED = @@ -418,7 +429,8 @@ private PropertyChangeSupport accessibleChangeSupport = null; /** - * Used to represent the context's relation set + * Used to represent the context's relation set. + * * @see #getAccessibleRelationSet */ private AccessibleRelationSet relationSet @@ -427,18 +439,17 @@ private Object nativeAXResource; /** - * Gets the accessibleName property of this object. The accessibleName - * property of an object is a localized String that designates the purpose - * of the object. For example, the accessibleName property of a label - * or button might be the text of the label or button itself. In the - * case of an object that doesn't display its name, the accessibleName - * should still be set. For example, in the case of a text field used - * to enter the name of a city, the accessibleName for the en_US locale - * could be 'city.' + * Gets the {@code accessibleName} property of this object. The + * {@code accessibleName} property of an object is a localized + * {@code String} that designates the purpose of the object. For example, + * the {@code accessibleName} property of a label or button might be the + * text of the label or button itself. In the case of an object that doesn't + * display its name, the {@code accessibleName} should still be set. For + * example, in the case of a text field used to enter the name of a city, + * the {@code accessibleName} for the {@code en_US} locale could be 'city.' * - * @return the localized name of the object; null if this - * object does not have a name - * + * @return the localized name of the object; {@code null} if this object + * does not have a name * @see #setAccessibleName */ public String getAccessibleName() { @@ -446,12 +457,11 @@ } /** - * Sets the localized accessible name of this object. Changing the - * name will cause a PropertyChangeEvent to be fired for the - * ACCESSIBLE_NAME_PROPERTY property. + * Sets the localized accessible name of this object. Changing the name will + * cause a {@code PropertyChangeEvent} to be fired for the + * {@code ACCESSIBLE_NAME_PROPERTY} property. * - * @param s the new localized name of the object. - * + * @param s the new localized name of the object * @see #getAccessibleName * @see #addPropertyChangeListener */ @@ -464,15 +474,14 @@ } /** - * Gets the accessibleDescription property of this object. The - * accessibleDescription property of this object is a short localized - * phrase describing the purpose of the object. For example, in the - * case of a 'Cancel' button, the accessibleDescription could be + * Gets the {@code accessibleDescription} property of this object. The + * {@code accessibleDescription} property of this object is a short + * localized phrase describing the purpose of the object. For example, in + * the case of a 'Cancel' button, the {@code accessibleDescription} could be * 'Ignore changes and close dialog box.' * - * @return the localized description of the object; null if - * this object does not have a description - * + * @return the localized description of the object; {@code null} if this + * object does not have a description * @see #setAccessibleDescription */ public String getAccessibleDescription() { @@ -480,12 +489,11 @@ } /** - * Sets the accessible description of this object. Changing the - * name will cause a PropertyChangeEvent to be fired for the - * ACCESSIBLE_DESCRIPTION_PROPERTY property. + * Sets the accessible description of this object. Changing the name will + * cause a {@code PropertyChangeEvent} to be fired for the + * {@code ACCESSIBLE_DESCRIPTION_PROPERTY} property. * - * @param s the new localized description of the object - * + * @param s the new localized description of the object * @see #setAccessibleName * @see #addPropertyChangeListener */ @@ -499,33 +507,36 @@ } /** - * Gets the role of this object. The role of the object is the generic - * purpose or use of the class of this object. For example, the role - * of a push button is AccessibleRole.PUSH_BUTTON. The roles in - * AccessibleRole are provided so component developers can pick from - * a set of predefined roles. This enables assistive technologies to - * provide a consistent interface to various tweaked subclasses of - * components (e.g., use AccessibleRole.PUSH_BUTTON for all components - * that act like a push button) as well as distinguish between subclasses - * that behave differently (e.g., AccessibleRole.CHECK_BOX for check boxes - * and AccessibleRole.RADIO_BUTTON for radio buttons). - *

    Note that the AccessibleRole class is also extensible, so - * custom component developers can define their own AccessibleRole's - * if the set of predefined roles is inadequate. + * Gets the role of this object. The role of the object is the generic + * purpose or use of the class of this object. For example, the role of a + * push button is {@code AccessibleRole.PUSH_BUTTON}. The roles in + * {@code AccessibleRole} are provided so component developers can pick from + * a set of predefined roles. This enables assistive technologies to provide + * a consistent interface to various tweaked subclasses of components (e.g., + * use {@code AccessibleRole.PUSH_BUTTON} for all components that act like a + * push button) as well as distinguish between subclasses that behave + * differently (e.g., {@code AccessibleRole.CHECK_BOX} for check boxes and + * {@code AccessibleRole.RADIO_BUTTON} for radio buttons). + *

    + * Note that the {@code AccessibleRole} class is also extensible, so custom + * component developers can define their own {@code AccessibleRole}'s if the + * set of predefined roles is inadequate. * - * @return an instance of AccessibleRole describing the role of the object + * @return an instance of {@code AccessibleRole} describing the role of the + * object * @see AccessibleRole */ public abstract AccessibleRole getAccessibleRole(); /** - * Gets the state set of this object. The AccessibleStateSet of an object - * is composed of a set of unique AccessibleStates. A change in the - * AccessibleStateSet of an object will cause a PropertyChangeEvent to - * be fired for the ACCESSIBLE_STATE_PROPERTY property. + * Gets the state set of this object. The {@code AccessibleStateSet} of an + * object is composed of a set of unique {@code AccessibleStates}. A change + * in the {@code AccessibleStateSet} of an object will cause a + * {@code PropertyChangeEvent} to be fired for the + * {@code ACCESSIBLE_STATE_PROPERTY} property. * - * @return an instance of AccessibleStateSet containing the - * current state set of the object + * @return an instance of {@code AccessibleStateSet} containing the current + * state set of the object * @see AccessibleStateSet * @see AccessibleState * @see #addPropertyChangeListener @@ -533,22 +544,22 @@ public abstract AccessibleStateSet getAccessibleStateSet(); /** - * Gets the Accessible parent of this object. + * Gets the {@code Accessible} parent of this object. * - * @return the Accessible parent of this object; null if this - * object does not have an Accessible parent + * @return the {@code Accessible} parent of this object; {@code null} if + * this object does not have an {@code Accessible} parent */ public Accessible getAccessibleParent() { return accessibleParent; } /** - * Sets the Accessible parent of this object. This is meant to be used - * only in the situations where the actual component's parent should - * not be treated as the component's accessible parent and is a method - * that should only be called by the parent of the accessible child. + * Sets the {@code Accessible} parent of this object. This is meant to be + * used only in the situations where the actual component's parent should + * not be treated as the component's accessible parent and is a method that + * should only be called by the parent of the accessible child. * - * @param a - Accessible to be set as the parent + * @param a - {@code Accessible} to be set as the parent */ public void setAccessibleParent(Accessible a) { accessibleParent = a; @@ -557,9 +568,8 @@ /** * Gets the 0-based index of this object in its accessible parent. * - * @return the 0-based index of this object in its parent; -1 if this - * object does not have an accessible parent. - * + * @return the 0-based index of this object in its parent; -1 if this object + * does not have an accessible parent. * @see #getAccessibleParent * @see #getAccessibleChildrenCount * @see #getAccessibleChild @@ -574,13 +584,13 @@ public abstract int getAccessibleChildrenCount(); /** - * Returns the specified Accessible child of the object. The Accessible - * children of an Accessible object are zero-based, so the first child - * of an Accessible child is at index 0, the second child is at index 1, - * and so on. + * Returns the specified {@code Accessible} child of the object. The + * {@code Accessible} children of an {@code Accessible} object are + * zero-based, so the first child of an {@code Accessible} child is at index + * 0, the second child is at index 1, and so on. * - * @param i zero-based index of child - * @return the Accessible child of the object + * @param i zero-based index of child + * @return the {@code Accessible} child of the object * @see #getAccessibleChildrenCount */ public abstract Accessible getAccessibleChild(int i); @@ -589,21 +599,21 @@ * Gets the locale of the component. If the component does not have a * locale, then the locale of its parent is returned. * - * @return this component's locale. If this component does not have - * a locale, the locale of its parent is returned. - * - * @exception IllegalComponentStateException - * If the Component does not have its own locale and has not yet been - * added to a containment hierarchy such that the locale can be - * determined from the containing parent. + * @return this component's locale. If this component does not have a + * locale, the locale of its parent is returned. + * @throws IllegalComponentStateException If the component does not have its + * own locale and has not yet been added to a containment hierarchy + * such that the locale can be determined from the containing + * parent */ public abstract Locale getLocale() throws IllegalComponentStateException; /** - * Adds a PropertyChangeListener to the listener list. - * The listener is registered for all Accessible properties and will - * be called when those properties change. + * Adds a {@code PropertyChangeListener} to the listener list. The listener + * is registered for all {@code Accessible} properties and will be called + * when those properties change. * + * @param listener The PropertyChangeListener to be added * @see #ACCESSIBLE_NAME_PROPERTY * @see #ACCESSIBLE_DESCRIPTION_PROPERTY * @see #ACCESSIBLE_STATE_PROPERTY @@ -611,8 +621,6 @@ * @see #ACCESSIBLE_SELECTION_PROPERTY * @see #ACCESSIBLE_TEXT_PROPERTY * @see #ACCESSIBLE_VISIBLE_DATA_PROPERTY - * - * @param listener The PropertyChangeListener to be added */ public void addPropertyChangeListener(PropertyChangeListener listener) { if (accessibleChangeSupport == null) { @@ -622,11 +630,11 @@ } /** - * Removes a PropertyChangeListener from the listener list. - * This removes a PropertyChangeListener that was registered - * for all properties. + * Removes a {@code PropertyChangeListener} from the listener list. This + * removes a {@code PropertyChangeListener} that was registered for all + * properties. * - * @param listener The PropertyChangeListener to be removed + * @param listener The PropertyChangeListener to be removed */ public void removePropertyChangeListener(PropertyChangeListener listener) { if (accessibleChangeSupport != null) { @@ -635,10 +643,11 @@ } /** - * Gets the AccessibleAction associated with this object that supports - * one or more actions. + * Gets the {@code AccessibleAction} associated with this object that + * supports one or more actions. * - * @return AccessibleAction if supported by object; else return null + * @return {@code AccessibleAction} if supported by object; else return + * {@code null} * @see AccessibleAction */ public AccessibleAction getAccessibleAction() { @@ -646,10 +655,11 @@ } /** - * Gets the AccessibleComponent associated with this object that has a - * graphical representation. + * Gets the {@code AccessibleComponent} associated with this object that has + * a graphical representation. * - * @return AccessibleComponent if supported by object; else return null + * @return {@code AccessibleComponent} if supported by object; else return + * {@code null} * @see AccessibleComponent */ public AccessibleComponent getAccessibleComponent() { @@ -657,10 +667,11 @@ } /** - * Gets the AccessibleSelection associated with this object which allows its - * Accessible children to be selected. + * Gets the {@code AccessibleSelection} associated with this object which + * allows its {@code Accessible} children to be selected. * - * @return AccessibleSelection if supported by object; else return null + * @return {@code AccessibleSelection} if supported by object; else return + * {@code null} * @see AccessibleSelection */ public AccessibleSelection getAccessibleSelection() { @@ -668,10 +679,11 @@ } /** - * Gets the AccessibleText associated with this object presenting + * Gets the {@code AccessibleText} associated with this object presenting * text on the display. * - * @return AccessibleText if supported by object; else return null + * @return {@code AccessibleText} if supported by object; else return + * {@code null} * @see AccessibleText */ public AccessibleText getAccessibleText() { @@ -679,10 +691,11 @@ } /** - * Gets the AccessibleEditableText associated with this object + * Gets the {@code AccessibleEditableText} associated with this object * presenting editable text on the display. * - * @return AccessibleEditableText if supported by object; else return null + * @return {@code AccessibleEditableText} if supported by object; else + * return {@code null} * @see AccessibleEditableText * @since 1.4 */ @@ -690,12 +703,12 @@ return null; } - /** - * Gets the AccessibleValue associated with this object that supports a - * Numerical value. + * Gets the {@code AccessibleValue} associated with this object that + * supports a {@code Numerical} value. * - * @return AccessibleValue if supported by object; else return null + * @return {@code AccessibleValue} if supported by object; else return + * {@code null} * @see AccessibleValue */ public AccessibleValue getAccessibleValue() { @@ -703,11 +716,11 @@ } /** - * Gets the AccessibleIcons associated with an object that has - * one or more associated icons + * Gets the {@code AccessibleIcons} associated with an object that has one + * or more associated icons. * - * @return an array of AccessibleIcon if supported by object; - * otherwise return null + * @return an array of {@code AccessibleIcon} if supported by object; + * otherwise return {@code null} * @see AccessibleIcon * @since 1.3 */ @@ -716,10 +729,10 @@ } /** - * Gets the AccessibleRelationSet associated with an object + * Gets the {@code AccessibleRelationSet} associated with an object. * - * @return an AccessibleRelationSet if supported by object; - * otherwise return null + * @return an {@code AccessibleRelationSet} if supported by object; + * otherwise return {@code null} * @see AccessibleRelationSet * @since 1.3 */ @@ -728,10 +741,10 @@ } /** - * Gets the AccessibleTable associated with an object + * Gets the {@code AccessibleTable} associated with an object. * - * @return an AccessibleTable if supported by object; - * otherwise return null + * @return an {@code AccessibleTable} if supported by object; otherwise return + * {@code null} * @see AccessibleTable * @since 1.3 */ @@ -740,16 +753,17 @@ } /** - * Support for reporting bound property changes. If oldValue and - * newValue are not equal and the PropertyChangeEvent listener list - * is not empty, then fire a PropertyChange event to each listener. - * In general, this is for use by the Accessible objects themselves - * and should not be called by an application program. - * @param propertyName The programmatic name of the property that - * was changed. - * @param oldValue The old value of the property. - * @param newValue The new value of the property. - * @see java.beans.PropertyChangeSupport + * Support for reporting bound property changes. If {@code oldValue} and + * {@code newValue} are not equal and the {@code PropertyChangeEvent} + * listener list is not empty, then fire a {@code PropertyChange} event to + * each listener. In general, this is for use by the {@code Accessible} + * objects themselves and should not be called by an application program. + * + * @param propertyName The programmatic name of the property that was + * changed + * @param oldValue The old value of the property + * @param newValue The new value of the property + * @see PropertyChangeSupport * @see #addPropertyChangeListener * @see #removePropertyChangeListener * @see #ACCESSIBLE_NAME_PROPERTY diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleEditableText.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleEditableText.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleEditableText.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,109 +25,102 @@ package javax.accessibility; -import java.util.*; -import java.awt.*; -import javax.swing.text.*; +import javax.swing.text.AttributeSet; /** - *

    The AccessibleEditableText interface should be implemented by all - * classes that present editable textual information on the display. - * Along with the AccessibleText interface, this interface provides - * the standard mechanism for an assistive technology to access - * that text via its content, attributes, and spatial location. - * Applications can determine if an object supports the AccessibleEditableText - * interface by first obtaining its AccessibleContext (see {@link Accessible}) - * and then calling the {@link AccessibleContext#getAccessibleEditableText} - * method of AccessibleContext. If the return value is not null, the object - * supports this interface. + * The {@code AccessibleEditableText} interface should be implemented by all + * classes that present editable textual information on the display. Along with + * the {@code AccessibleText} interface, this interface provides the standard + * mechanism for an assistive technology to access that text via its content, + * attributes, and spatial location. Applications can determine if an object + * supports the {@code AccessibleEditableText} interface by first obtaining its + * {@code AccessibleContext} (see {@link Accessible}) and then calling the + * {@link AccessibleContext#getAccessibleEditableText} method of + * {@code AccessibleContext}. If the return value is not {@code null}, the + * object supports this interface. * + * @author Lynn Monsanto * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleContext#getAccessibleText * @see AccessibleContext#getAccessibleEditableText - * - * @author Lynn Monsanto * @since 1.4 */ - public interface AccessibleEditableText extends AccessibleText { /** * Sets the text contents to the specified string. * - * @param s the string to set the text contents + * @param s the string to set the text contents */ public void setTextContents(String s); /** - * Inserts the specified string at the given index/ + * Inserts the specified string at the given index. * - * @param index the index in the text where the string will - * be inserted - * @param s the string to insert in the text + * @param index the index in the text where the string will be inserted + * @param s the string to insert in the text */ public void insertTextAtIndex(int index, String s); /** * Returns the text string between two indices. * - * @param startIndex the starting index in the text - * @param endIndex the ending index in the text + * @param startIndex the starting index in the text + * @param endIndex the ending index in the text * @return the text string between the indices */ public String getTextRange(int startIndex, int endIndex); /** - * Deletes the text between two indices + * Deletes the text between two indices. * - * @param startIndex the starting index in the text - * @param endIndex the ending index in the text + * @param startIndex the starting index in the text + * @param endIndex the ending index in the text */ public void delete(int startIndex, int endIndex); /** * Cuts the text between two indices into the system clipboard. * - * @param startIndex the starting index in the text - * @param endIndex the ending index in the text + * @param startIndex the starting index in the text + * @param endIndex the ending index in the text */ public void cut(int startIndex, int endIndex); /** - * Pastes the text from the system clipboard into the text - * starting at the specified index. + * Pastes the text from the system clipboard into the text starting at the + * specified index. * - * @param startIndex the starting index in the text + * @param startIndex the starting index in the text */ public void paste(int startIndex); /** - * Replaces the text between two indices with the specified - * string. + * Replaces the text between two indices with the specified string. * - * @param startIndex the starting index in the text - * @param endIndex the ending index in the text - * @param s the string to replace the text between two indices + * @param startIndex the starting index in the text + * @param endIndex the ending index in the text + * @param s the string to replace the text between two indices */ public void replaceText(int startIndex, int endIndex, String s); /** * Selects the text between two indices. * - * @param startIndex the starting index in the text - * @param endIndex the ending index in the text + * @param startIndex the starting index in the text + * @param endIndex the ending index in the text */ public void selectText(int startIndex, int endIndex); /** * Sets attributes for the text between two indices. * - * @param startIndex the starting index in the text - * @param endIndex the ending index in the text - * @param as the attribute set + * @param startIndex the starting index in the text + * @param endIndex the ending index in the text + * @param as the attribute set * @see AttributeSet */ public void setAttributes(int startIndex, int endIndex, AttributeSet as); - } diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleExtendedComponent.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleExtendedComponent.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleExtendedComponent.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,48 +26,46 @@ package javax.accessibility; /** - * The AccessibleExtendedComponent interface should be supported by any object - * that is rendered on the screen. This interface provides the standard - * mechanism for an assistive technology to determine the extended - * graphical representation of an object. Applications can determine - * if an object supports the AccessibleExtendedComponent interface by first - * obtaining its AccessibleContext - * and then calling the - * {@link AccessibleContext#getAccessibleComponent} method. - * If the return value is not null and the type of the return value is - * AccessibleExtendedComponent, the object supports this interface. + * The {@code AccessibleExtendedComponent} interface should be supported by any + * object that is rendered on the screen. This interface provides the standard + * mechanism for an assistive technology to determine the extended graphical + * representation of an object. Applications can determine if an object supports + * the {@code AccessibleExtendedComponent} interface by first obtaining its + * {@code AccessibleContext} and then calling the + * {@link AccessibleContext#getAccessibleComponent} method. If the return value + * is not {@code null} and the type of the return value is + * {@code AccessibleExtendedComponent}, the object supports this interface. * + * @author Lynn Monsanto * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleContext#getAccessibleComponent - * - * @author Lynn Monsanto * @since 1.4 */ public interface AccessibleExtendedComponent extends AccessibleComponent { /** - * Returns the tool tip text + * Returns the tool tip text. * - * @return the tool tip text, if supported, of the object; - * otherwise, null + * @return the tool tip text, if supported, of the object; otherwise, + * {@code null} */ public String getToolTipText(); /** - * Returns the titled border text + * Returns the titled border text. * - * @return the titled border text, if supported, of the object; - * otherwise, null + * @return the titled border text, if supported, of the object; otherwise, + * {@code null} */ public String getTitledBorderText(); /** - * Returns key bindings associated with this object + * Returns key bindings associated with this object. * - * @return the key bindings, if supported, of the object; - * otherwise, null + * @return the key bindings, if supported, of the object; otherwise, + * {@code null} * @see AccessibleKeyBinding */ public AccessibleKeyBinding getAccessibleKeyBinding(); diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleExtendedTable.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleExtendedTable.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleExtendedTable.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,52 +22,49 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.accessibility; /** - * Class AccessibleExtendedTable provides extended information about - * a user-interface component that presents data in a two-dimensional - * table format. - * Applications can determine if an object supports the - * AccessibleExtendedTable interface by first obtaining its - * AccessibleContext and then calling the - * {@link AccessibleContext#getAccessibleTable} method. - * If the return value is not null and the type of the return value is - * AccessibleExtendedTable, the object supports this interface. - * - * @author Lynn Monsanto - * @since 1.4 - */ + * Class {@code AccessibleExtendedTable} provides extended information about a + * user-interface component that presents data in a two-dimensional table + * format. Applications can determine if an object supports the + * {@code AccessibleExtendedTable} interface by first obtaining its + * {@code AccessibleContext} and then calling the + * {@link AccessibleContext#getAccessibleTable} method. If the return value is + * not {@code null} and the type of the return value is + * {@code AccessibleExtendedTable}, the object supports this interface. + * + * @author Lynn Monsanto + * @since 1.4 + */ public interface AccessibleExtendedTable extends AccessibleTable { - /** - * Returns the row number of an index in the table. - * - * @param index the zero-based index in the table. The index is - * the table cell offset from row == 0 and column == 0. - * @return the zero-based row of the table if one exists; - * otherwise -1. - */ - public int getAccessibleRow(int index); - - /** - * Returns the column number of an index in the table. - * - * @param index the zero-based index in the table. The index is - * the table cell offset from row == 0 and column == 0. - * @return the zero-based column of the table if one exists; - * otherwise -1. - */ - public int getAccessibleColumn(int index); + /** + * Returns the row number of an index in the table. + * + * @param index the zero-based index in the table. The index is the table + * cell offset from row == 0 and column == 0. + * @return the zero-based row of the table if one exists; otherwise -1 + */ + public int getAccessibleRow(int index); /** - * Returns the index at a row and column in the table. - * - * @param r zero-based row of the table - * @param c zero-based column of the table - * @return the zero-based index in the table if one exists; - * otherwise -1. The index is the table cell offset from - * row == 0 and column == 0. - */ - public int getAccessibleIndex(int r, int c); + * Returns the column number of an index in the table. + * + * @param index the zero-based index in the table. The index is the table + * cell offset from row == 0 and column == 0. + * @return the zero-based column of the table if one exists; otherwise -1 + */ + public int getAccessibleColumn(int index); + + /** + * Returns the index at a row and column in the table. + * + * @param r zero-based row of the table + * @param c zero-based column of the table + * @return the zero-based index in the table if one exists; otherwise -1. + * The index is the table cell offset from row == 0 and column == 0. + */ + public int getAccessibleIndex(int r, int c); } diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleExtendedText.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleExtendedText.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleExtendedText.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,29 +25,25 @@ package javax.accessibility; - -import java.util.*; -import java.awt.*; -import javax.swing.text.*; - +import java.awt.Rectangle; /** - *

    The AccessibleExtendedText interface contains additional methods - * not provided by the AccessibleText interface + * The {@code AccessibleExtendedText} interface contains additional methods not + * provided by the {@code AccessibleText} interface. + *

    + * Applications can determine if an object supports the + * {@code AccessibleExtendedText} interface by first obtaining its + * {@code AccessibleContext} (see {@link Accessible}) and then calling the + * {@link AccessibleContext#getAccessibleText} method of + * {@code AccessibleContext}. If the return value is an instance of + * {@code AccessibleExtendedText}, the object supports this interface. * - * Applications can determine if an object supports the AccessibleExtendedText - * interface by first obtaining its AccessibleContext (see {@link Accessible}) - * and then calling the {@link AccessibleContext#getAccessibleText} method of - * AccessibleContext. If the return value is an instance of - * AccessibleExtendedText, the object supports this interface. - * + * @author Peter Korn + * @author Lynn Monsanto * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleContext#getAccessibleText - * - * @author Peter Korn - * @author Lynn Monsanto * @since 1.5 */ public interface AccessibleExtendedText { @@ -73,25 +69,24 @@ public static final int ATTRIBUTE_RUN = 5; // BugID: 4849720 /** - * Returns the text between two indices + * Returns the text between two indices. * - * @param startIndex the start index in the text - * @param endIndex the end index in the text - * @return the text string if the indices are valid. - * Otherwise, null is returned. + * @param startIndex the start index in the text + * @param endIndex the end index in the text + * @return the text string if the indices are valid. Otherwise, {@code null} + * is returned. */ public String getTextRange(int startIndex, int endIndex); /** * Returns the {@code AccessibleTextSequence} at a given index. * - * @param part the {@code CHARACTER}, {@code WORD}, - * {@code SENTENCE}, {@code LINE} or {@code ATTRIBUTE_RUN} - * to retrieve - * @param index an index within the text - * @return an {@code AccessibleTextSequence} specifying the text - * if part and index are valid. Otherwise, null is returned. - * + * @param part the {@code CHARACTER}, {@code WORD}, {@code SENTENCE}, + * {@code LINE} or {@code ATTRIBUTE_RUN} to retrieve + * @param index an index within the text + * @return an {@code AccessibleTextSequence} specifying the text if + * {@code part} and {@code index} are valid. Otherwise, {@code null} + * is returned. * @see AccessibleText#CHARACTER * @see AccessibleText#WORD * @see AccessibleText#SENTENCE @@ -101,13 +96,12 @@ /** * Returns the {@code AccessibleTextSequence} after a given index. * - * @param part the {@code CHARACTER}, {@code WORD}, - * {@code SENTENCE}, {@code LINE} or {@code ATTRIBUTE_RUN} - * to retrieve - * @param index an index within the text - * @return an {@code AccessibleTextSequence} specifying the text - * if part and index are valid. Otherwise, null is returned. - * + * @param part the {@code CHARACTER}, {@code WORD}, {@code SENTENCE}, + * {@code LINE} or {@code ATTRIBUTE_RUN} to retrieve + * @param index an index within the text + * @return an {@code AccessibleTextSequence} specifying the text if + * {@code part} and {@code index} are valid. Otherwise, {@code null} + * is returned. * @see AccessibleText#CHARACTER * @see AccessibleText#WORD * @see AccessibleText#SENTENCE @@ -117,13 +111,12 @@ /** * Returns the {@code AccessibleTextSequence} before a given index. * - * @param part the {@code CHARACTER}, {@code WORD}, - * {@code SENTENCE}, {@code LINE} or {@code ATTRIBUTE_RUN} - * to retrieve - * @param index an index within the text - * @return an {@code AccessibleTextSequence} specifying the text - * if part and index are valid. Otherwise, null is returned. - * + * @param part the {@code CHARACTER}, {@code WORD}, {@code SENTENCE}, + * {@code LINE} or {@code ATTRIBUTE_RUN} to retrieve + * @param index an index within the text + * @return an {@code AccessibleTextSequence} specifying the text if + * {@code part} and {@code index} are valid. Otherwise, {@code null} + * is returned. * @see AccessibleText#CHARACTER * @see AccessibleText#WORD * @see AccessibleText#SENTENCE @@ -133,10 +126,10 @@ /** * Returns the bounding rectangle of the text between two indices. * - * @param startIndex the start index in the text - * @param endIndex the end index in the text + * @param startIndex the start index in the text + * @param endIndex the end index in the text * @return the bounding rectangle of the text if the indices are valid. - * Otherwise, null is returned. + * Otherwise, {@code null} is returned. */ public Rectangle getTextBounds(int startIndex, int endIndex); } diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleHyperlink.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleHyperlink.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleHyperlink.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,116 +25,103 @@ package javax.accessibility; - -import java.util.*; -import java.awt.*; -import javax.swing.text.*; - - /** - * Encapsulation of a link, or set of links (e.g. client side imagemap) - * in a Hypertext document + * Encapsulation of a link, or set of links (e.g. client side imagemap) in a + * Hypertext document * + * @author Peter Korn * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleText * @see AccessibleContext#getAccessibleText - * - * @author Peter Korn */ public abstract class AccessibleHyperlink implements AccessibleAction { - /** - * Since the document a link is associated with may have - * changed, this method returns whether or not this Link is still valid - * (with respect to the document it references). - * - * @return a flag indicating whether this link is still valid with - * respect to the AccessibleHypertext it belongs to - */ - public abstract boolean isValid(); - - /** - * Returns the number of accessible actions available in this Link - * If there are more than one, the first one is NOT considered the - * "default" action of this LINK object (e.g. in an HTML imagemap). - * In general, links will have only one AccessibleAction in them. - * - * @return the zero-based number of Actions in this object - */ - public abstract int getAccessibleActionCount(); + /** + * Since the document a link is associated with may have changed, this + * method returns whether or not this Link is still valid (with respect to + * the document it references). + * + * @return a flag indicating whether this link is still valid with respect + * to the {@code AccessibleHypertext} it belongs to + */ + public abstract boolean isValid(); - /** - * Performs the specified Action on the object - * - * @param i zero-based index of actions - * @return true if the action was performed; otherwise false. - * @see #getAccessibleActionCount - */ - public abstract boolean doAccessibleAction(int i); + /** + * Returns the number of accessible actions available in this Link If there + * are more than one, the first one is NOT considered the "default" action + * of this LINK object (e.g. in an HTML imagemap). In general, links will + * have only one {@code AccessibleAction} in them. + * + * @return the zero-based number of actions in this object + */ + public abstract int getAccessibleActionCount(); - /** - * Returns a String description of this particular - * link action. This should be a text string - * associated with anchoring text, this should be the - * anchor text. E.g. from HTML: - * <a HREF="http://www.sun.com/access">Accessibility</a> - * this method would return "Accessibility". - * - * Similarly, from this HTML: - * <a HREF="#top"><img src="top-hat.gif" alt="top hat"></a> - * this method would return "top hat" - * - * @param i zero-based index of the actions - * @return a String description of the action - * @see #getAccessibleActionCount - */ - public abstract String getAccessibleActionDescription(int i); + /** + * Performs the specified action on the object. + * + * @param i zero-based index of actions + * @return {@code true} if the action was performed; otherwise {@code false} + * @see #getAccessibleActionCount + */ + public abstract boolean doAccessibleAction(int i); - /** - * Returns an object that represents the link action, - * as appropriate for that link. E.g. from HTML: - * <a HREF="http://www.sun.com/access">Accessibility</a> - * this method would return a - * java.net.URL("http://www.sun.com/access.html"); - * - * @param i zero-based index of the actions - * @return an Object representing the hypertext link itself - * @see #getAccessibleActionCount - */ - public abstract Object getAccessibleActionObject(int i); + /** + * Returns a string description of this particular link action. This should + * be a text string associated with anchoring text, this should be the + * anchor text. E.g. from HTML: <a + * HREF="http://www.sun.com/access">Accessibility</a> this method + * would return "Accessibility". + *

    + * Similarly, from this HTML: <a HREF="#top"><img src="top-hat.gif" + * alt="top hat"></a> this method would return "top hat" + * + * @param i zero-based index of the actions + * @return a string description of the action + * @see #getAccessibleActionCount + */ + public abstract String getAccessibleActionDescription(int i); + + /** + * Returns an object that represents the link action, as appropriate for + * that link. E.g. from HTML: <a + * HREF="http://www.sun.com/access">Accessibility</a> this method + * would return a java.net.URL("http://www.sun.com/access.html"); + * + * @param i zero-based index of the actions + * @return an object representing the hypertext link itself + * @see #getAccessibleActionCount + */ + public abstract Object getAccessibleActionObject(int i); - /** - * Returns an object that represents the link anchor, - * as appropriate for that link. E.g. from HTML: - * <a href="http://www.sun.com/access">Accessibility</a> - * this method would return a String containing the text: - * "Accessibility". - * - * Similarly, from this HTML: - * <a HREF="#top"><img src="top-hat.gif" alt="top hat"></a> - * this might return the object ImageIcon("top-hat.gif", "top hat"); - * - * @param i zero-based index of the actions - * @return an Object representing the hypertext anchor - * @see #getAccessibleActionCount - */ - public abstract Object getAccessibleActionAnchor(int i); + /** + * Returns an object that represents the link anchor, as appropriate for + * that link. E.g. from HTML: <a + * href="http://www.sun.com/access">Accessibility</a> this method + * would return a {@code String} containing the text: "Accessibility". + *

    + * Similarly, from this HTML: <a HREF="#top"><img src="top-hat.gif" + * alt="top hat"></a> this might return the object + * ImageIcon("top-hat.gif", "top hat"); + * + * @param i zero-based index of the actions + * @return an object representing the hypertext anchor + * @see #getAccessibleActionCount + */ + public abstract Object getAccessibleActionAnchor(int i); - /** - * Gets the index with the hypertext document at which this - * link begins - * - * @return index of start of link - */ - public abstract int getStartIndex(); + /** + * Gets the index with the hypertext document at which this link begins. + * + * @return index of start of link + */ + public abstract int getStartIndex(); - /** - * Gets the index with the hypertext document at which this - * link ends - * - * @return index of end of link - */ - public abstract int getEndIndex(); + /** + * Gets the index with the hypertext document at which this link ends. + * + * @return index of end of link + */ + public abstract int getEndIndex(); } diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleHypertext.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleHypertext.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleHypertext.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,56 +25,50 @@ package javax.accessibility; - -import java.util.*; -import java.awt.*; -import javax.swing.text.*; - - /** - *

    The AccessibleHypertext class is the base class for all - * classes that present hypertext information on the display. This class - * provides the standard mechanism for an assistive technology to access - * that text via its content, attributes, and spatial location. - * It also provides standard mechanisms for manipulating hyperlinks. - * Applications can determine if an object supports the AccessibleHypertext - * interface by first obtaining its AccessibleContext (see {@link Accessible}) - * and then calling the {@link AccessibleContext#getAccessibleText} - * method of AccessibleContext. If the return value is a class which extends - * AccessibleHypertext, then that object supports AccessibleHypertext. + * The {@code AccessibleHypertext} class is the base class for all classes that + * present hypertext information on the display. This class provides the + * standard mechanism for an assistive technology to access that text via its + * content, attributes, and spatial location. It also provides standard + * mechanisms for manipulating hyperlinks. Applications can determine if an + * object supports the {@code AccessibleHypertext} interface by first obtaining + * its {@code AccessibleContext} (see {@link Accessible}) and then calling the + * {@link AccessibleContext#getAccessibleText} method of + * {@code AccessibleContext}. If the return value is a class which extends + * {@code AccessibleHypertext}, then that object supports + * {@code AccessibleHypertext}. * + * @author Peter Korn * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleText * @see AccessibleContext#getAccessibleText - * - * @author Peter Korn */ public interface AccessibleHypertext extends AccessibleText { /** * Returns the number of links within this hypertext document. * - * @return number of links in this hypertext doc. + * @return number of links in this hypertext doc */ public abstract int getLinkCount(); /** * Returns the nth Link of this Hypertext document. * - * @param linkIndex within the links of this Hypertext + * @param linkIndex within the links of this Hypertext * @return Link object encapsulating the nth link(s) */ public abstract AccessibleHyperlink getLink(int linkIndex); /** - * Returns the index into an array of hyperlinks that - * is associated with this character index, or -1 if there - * is no hyperlink associated with this index. + * Returns the index into an array of hyperlinks that is associated with + * this character index, or -1 if there is no hyperlink associated with this + * index. * - * @param charIndex index within the text - * @return index into the set of hyperlinks for this hypertext doc. + * @param charIndex index within the text + * @return index into the set of hyperlinks for this hypertext doc */ public abstract int getLinkIndex(int charIndex); } diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleIcon.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleIcon.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleIcon.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,57 +26,51 @@ package javax.accessibility; /** - * The AccessibleIcon interface should be supported by any object - * that has an associated icon (e.g., buttons). This interface - * provides the standard mechanism for an assistive technology - * to get descriptive information about icons. - * Applications can determine - * if an object supports the AccessibleIcon interface by first - * obtaining its AccessibleContext (see - * {@link Accessible}) and then calling the - * {@link AccessibleContext#getAccessibleIcon} method. - * If the return value is not null, the object supports this interface. + * The {@code AccessibleIcon} interface should be supported by any object that + * has an associated icon (e.g., buttons). This interface provides the standard + * mechanism for an assistive technology to get descriptive information about + * icons. Applications can determine if an object supports the + * {@code AccessibleIcon} interface by first obtaining its + * {@code AccessibleContext} (see {@link Accessible}) and then calling the + * {@link AccessibleContext#getAccessibleIcon} method. If the return value is + * not {@code null}, the object supports this interface. * + * @author Lynn Monsanto * @see Accessible * @see AccessibleContext - * - * @author Lynn Monsanto * @since 1.3 */ public interface AccessibleIcon { /** - * Gets the description of the icon. This is meant to be a brief - * textual description of the object. For example, it might be - * presented to a blind user to give an indication of the purpose - * of the icon. + * Gets the description of the icon. This is meant to be a brief textual + * description of the object. For example, it might be presented to a blind + * user to give an indication of the purpose of the icon. * * @return the description of the icon */ public String getAccessibleIconDescription(); /** - * Sets the description of the icon. This is meant to be a brief - * textual description of the object. For example, it might be - * presented to a blind user to give an indication of the purpose - * of the icon. + * Sets the description of the icon. This is meant to be a brief textual + * description of the object. For example, it might be presented to a blind + * user to give an indication of the purpose of the icon. * - * @param description the description of the icon + * @param description the description of the icon */ public void setAccessibleIconDescription(String description); /** - * Gets the width of the icon + * Gets the width of the icon. * - * @return the width of the icon. + * @return the width of the icon */ public int getAccessibleIconWidth(); /** - * Gets the height of the icon + * Gets the height of the icon. * - * @return the height of the icon. + * @return the height of the icon */ public int getAccessibleIconHeight(); - } diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleKeyBinding.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleKeyBinding.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleKeyBinding.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,38 +26,36 @@ package javax.accessibility; /** - * The AccessibleKeyBinding interface should be supported by any object + * The {@code AccessibleKeyBinding} interface should be supported by any object * that has a keyboard bindings such as a keyboard mnemonic and/or keyboard - * shortcut which can be used to select the object. This interface provides - * the standard mechanism for an assistive technology to determine the - * key bindings which exist for this object. - * Any object that has such key bindings should support this - * interface. + * shortcut which can be used to select the object. This interface provides the + * standard mechanism for an assistive technology to determine the key bindings + * which exist for this object. Any object that has such key bindings should + * support this interface. * + * @author Lynn Monsanto * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext - * - * @author Lynn Monsanto * @since 1.4 */ public interface AccessibleKeyBinding { /** - * Returns the number of key bindings for this object + * Returns the number of key bindings for this object. * * @return the zero-based number of key bindings for this object */ public int getAccessibleKeyBindingCount(); /** - * Returns a key binding for this object. The value returned is an - * java.lang.Object which must be cast to appropriate type depending + * Returns a key binding for this object. The value returned is an + * {@code java.lang.Object} which must be cast to appropriate type depending * on the underlying implementation of the key. * - * @param i zero-based index of the key bindings - * @return a javax.lang.Object which specifies the key binding + * @param i zero-based index of the key bindings + * @return a {@code javax.lang.Object} which specifies the key binding * @see #getAccessibleKeyBindingCount */ - public java.lang.Object getAccessibleKeyBinding(int i); + public Object getAccessibleKeyBinding(int i); } diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleRelation.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleRelation.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleRelation.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,39 +25,36 @@ package javax.accessibility; -import java.util.Vector; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - /** - *

    Class AccessibleRelation describes a relation between the - * object that implements the AccessibleRelation and one or more other - * objects. The actual relations that an object has with other - * objects are defined as an AccessibleRelationSet, which is a composed - * set of AccessibleRelations. - *

    The toDisplayString method allows you to obtain the localized string - * for a locale independent key from a predefined ResourceBundle for the - * keys defined in this class. - *

    The constants in this class present a strongly typed enumeration - * of common object roles. If the constants in this class are not sufficient - * to describe the role of an object, a subclass should be generated - * from this class and it should provide constants in a similar manner. + * Class {@code AccessibleRelation} describes a relation between the object that + * implements the {@code AccessibleRelation} and one or more other objects. The + * actual relations that an object has with other objects are defined as an + * {@code AccessibleRelationSet}, which is a composed set of + * {@code AccessibleRelations}. + *

    + * The {@link #toDisplayString()} method allows you to obtain the localized + * string for a locale independent key from a predefined {@code ResourceBundle} + * for the keys defined in this class. + *

    + * The constants in this class present a strongly typed enumeration of common + * object roles. If the constants in this class are not sufficient to describe + * the role of an object, a subclass should be generated from this class and it + * should provide constants in a similar manner. * - * @author Lynn Monsanto + * @author Lynn Monsanto * @since 1.3 */ public class AccessibleRelation extends AccessibleBundle { - /* - * The group of objects that participate in the relation. - * The relation may be one-to-one or one-to-many. For - * example, in the case of a LABEL_FOR relation, the target - * vector would contain a list of objects labeled by the object - * that implements this AccessibleRelation. In the case of a - * MEMBER_OF relation, the target vector would contain all - * of the components that are members of the same group as the - * object that implements this AccessibleRelation. + /** + * The group of objects that participate in the relation. The relation may + * be one-to-one or one-to-many. For example, in the case of a + * {@code LABEL_FOR} relation, the target vector would contain a list of + * objects labeled by the object that implements this + * {@code AccessibleRelation}. In the case of a {@code MEMBER_OF} relation, + * the target vector would contain all of the components that are members of + * the same group as the object that implements this + * {@code AccessibleRelation}. */ private Object [] target = new Object[0]; @@ -84,8 +81,7 @@ public static final String LABELED_BY = new String("labeledBy"); /** - * Indicates an object is a member of a group of one or more - * target objects. + * Indicates an object is a member of a group of one or more target objects. * * @see #getTarget * @see #CONTROLLER_FOR @@ -96,8 +92,7 @@ public static final String MEMBER_OF = new String("memberOf"); /** - * Indicates an object is a controller for one or more target - * objects. + * Indicates an object is a controller for one or more target objects. * * @see #getTarget * @see #CONTROLLED_BY @@ -108,8 +103,7 @@ public static final String CONTROLLER_FOR = new String("controllerFor"); /** - * Indicates an object is controlled by one or more target - * objects. + * Indicates an object is controlled by one or more target objects. * * @see #getTarget * @see #CONTROLLER_FOR @@ -120,83 +114,73 @@ public static final String CONTROLLED_BY = new String("controlledBy"); /** - * Indicates an object is logically contiguous with a second - * object where the second object occurs after the object. - * An example is a paragraph of text that runs to the end of - * a page and continues on the next page with an intervening - * text footer and/or text header. The two parts of - * the paragraph are separate text elements but are related - * in that the second element is a continuation - * of the first - * element. In other words, the first element "flows to" - * the second element. + * Indicates an object is logically contiguous with a second object where + * the second object occurs after the object. An example is a paragraph of + * text that runs to the end of a page and continues on the next page with + * an intervening text footer and/or text header. The two parts of the + * paragraph are separate text elements but are related in that the second + * element is a continuation of the first element. In other words, the first + * element "flows to" the second element. * * @since 1.5 */ public static final String FLOWS_TO = "flowsTo"; /** - * Indicates an object is logically contiguous with a second - * object where the second object occurs before the object. - * An example is a paragraph of text that runs to the end of - * a page and continues on the next page with an intervening - * text footer and/or text header. The two parts of - * the paragraph are separate text elements but are related - * in that the second element is a continuation of the first - * element. In other words, the second element "flows from" - * the second element. + * Indicates an object is logically contiguous with a second object where + * the second object occurs before the object. An example is a paragraph of + * text that runs to the end of a page and continues on the next page with + * an intervening text footer and/or text header. The two parts of the + * paragraph are separate text elements but are related in that the second + * element is a continuation of the first element. In other words, the + * second element "flows from" the second element. * * @since 1.5 */ public static final String FLOWS_FROM = "flowsFrom"; /** - * Indicates that an object is a subwindow of one or more - * objects. + * Indicates that an object is a subwindow of one or more objects. * * @since 1.5 */ public static final String SUBWINDOW_OF = "subwindowOf"; /** - * Indicates that an object is a parent window of one or more - * objects. + * Indicates that an object is a parent window of one or more objects. * * @since 1.5 */ public static final String PARENT_WINDOW_OF = "parentWindowOf"; /** - * Indicates that an object has one or more objects - * embedded in it. + * Indicates that an object has one or more objects embedded in it. * * @since 1.5 */ public static final String EMBEDS = "embeds"; /** - * Indicates that an object is embedded in one or more - * objects. + * Indicates that an object is embedded in one or more objects. * * @since 1.5 */ public static final String EMBEDDED_BY = "embeddedBy"; /** - * Indicates that an object is a child node of one - * or more objects. + * Indicates that an object is a child node of one or more objects. * * @since 1.5 */ public static final String CHILD_NODE_OF = "childNodeOf"; /** - * Identifies that the target group for a label has changed + * Identifies that the target group for a label has changed. */ public static final String LABEL_FOR_PROPERTY = "labelForProperty"; /** - * Identifies that the objects that are doing the labeling have changed + * Identifies that the objects that are doing the labeling have changed. */ public static final String LABELED_BY_PROPERTY = "labeledByProperty"; @@ -206,34 +190,33 @@ public static final String MEMBER_OF_PROPERTY = "memberOfProperty"; /** - * Identifies that the controller for the target object has changed + * Identifies that the controller for the target object has changed. */ public static final String CONTROLLER_FOR_PROPERTY = "controllerForProperty"; /** * Identifies that the target object that is doing the controlling has - * changed + * changed. */ public static final String CONTROLLED_BY_PROPERTY = "controlledByProperty"; /** - * Indicates the FLOWS_TO relation between two objects - * has changed. + * Indicates the {@code FLOWS_TO} relation between two objects has changed. * * @since 1.5 */ public static final String FLOWS_TO_PROPERTY = "flowsToProperty"; /** - * Indicates the FLOWS_FROM relation between two objects - * has changed. + * Indicates the {@code FLOWS_FROM} relation between two objects has + * changed. * * @since 1.5 */ public static final String FLOWS_FROM_PROPERTY = "flowsFromProperty"; /** - * Indicates the SUBWINDOW_OF relation between two or more objects + * Indicates the {@code SUBWINDOW_OF} relation between two or more objects * has changed. * * @since 1.5 @@ -241,23 +224,23 @@ public static final String SUBWINDOW_OF_PROPERTY = "subwindowOfProperty"; /** - * Indicates the PARENT_WINDOW_OF relation between two or more objects - * has changed. + * Indicates the {@code PARENT_WINDOW_OF} relation between two or more + * objects has changed. * * @since 1.5 */ public static final String PARENT_WINDOW_OF_PROPERTY = "parentWindowOfProperty"; /** - * Indicates the EMBEDS relation between two or more objects - * has changed. + * Indicates the {@code EMBEDS} relation between two or more objects has + * changed. * * @since 1.5 */ public static final String EMBEDS_PROPERTY = "embedsProperty"; /** - * Indicates the EMBEDDED_BY relation between two or more objects + * Indicates the {@code EMBEDDED_BY} relation between two or more objects * has changed. * * @since 1.5 @@ -265,7 +248,7 @@ public static final String EMBEDDED_BY_PROPERTY = "embeddedByProperty"; /** - * Indicates the CHILD_NODE_OF relation between two or more objects + * Indicates the {@code CHILD_NODE_OF} relation between two or more objects * has changed. * * @since 1.5 @@ -273,12 +256,13 @@ public static final String CHILD_NODE_OF_PROPERTY = "childNodeOfProperty"; /** - * Create a new AccessibleRelation using the given locale independent key. - * The key String should be a locale independent key for the relation. - * It is not intended to be used as the actual String to display - * to the user. To get the localized string, use toDisplayString. + * Create a new {@code AccessibleRelation} using the given locale + * independent key. The key {@code String} should be a locale independent + * key for the relation. It is not intended to be used as the actual + * {@code String} to display to the user. To get the localized string, use + * {@link #toDisplayString()}. * - * @param key the locale independent name of the relation. + * @param key the locale independent name of the relation * @see AccessibleBundle#toDisplayString */ public AccessibleRelation(String key) { @@ -287,13 +271,14 @@ } /** - * Creates a new AccessibleRelation using the given locale independent key. - * The key String should be a locale independent key for the relation. - * It is not intended to be used as the actual String to display - * to the user. To get the localized string, use toDisplayString. + * Creates a new {@code AccessibleRelation} using the given locale + * independent key. The key {@code String} should be a locale independent + * key for the relation. It is not intended to be used as the actual + * {@code String} to display to the user. To get the localized string, use + * {@link #toDisplayString()}. * - * @param key the locale independent name of the relation. - * @param target the target object for this relation + * @param key the locale independent name of the relation + * @param target the target object for this relation * @see AccessibleBundle#toDisplayString */ public AccessibleRelation(String key, Object target) { @@ -303,25 +288,25 @@ } /** - * Creates a new AccessibleRelation using the given locale independent key. - * The key String should be a locale independent key for the relation. - * It is not intended to be used as the actual String to display - * to the user. To get the localized string, use toDisplayString. + * Creates a new {@code AccessibleRelation} using the given locale + * independent key. The key {@code String} should be a locale independent + * key for the relation. It is not intended to be used as the actual + * {@code String} to display to the user. To get the localized string, use + * {@link #toDisplayString()}. * - * @param key the locale independent name of the relation. - * @param target the target object(s) for this relation + * @param key the locale independent name of the relation + * @param target the target object(s) for this relation * @see AccessibleBundle#toDisplayString */ - public AccessibleRelation(String key, Object [] target) { + public AccessibleRelation(String key, Object[] target) { this.key = key; this.target = target; } /** - * Returns the key for this relation + * Returns the key for this relation. * * @return the key for this relation - * * @see #CONTROLLER_FOR * @see #CONTROLLED_BY * @see #LABEL_FOR @@ -333,7 +318,7 @@ } /** - * Returns the target objects for this relation + * Returns the target objects for this relation. * * @return an array containing the target objects for this relation */ @@ -349,9 +334,9 @@ } /** - * Sets the target object for this relation + * Sets the target object for this relation. * - * @param target the target object for this relation + * @param target the target object for this relation */ public void setTarget(Object target) { this.target = new Object[1]; @@ -359,9 +344,9 @@ } /** - * Sets the target objects for this relation + * Sets the target objects for this relation. * - * @param target an array containing the target objects for this relation + * @param target an array containing the target objects for this relation */ public void setTarget(Object [] target) { this.target = target; diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleRelationSet.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleRelationSet.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleRelationSet.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,24 +26,22 @@ package javax.accessibility; import java.util.Vector; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** - * Class AccessibleRelationSet determines a component's relation set. The - * relation set of a component is a set of AccessibleRelation objects that - * describe the component's relationships with other components. + * Class {@code AccessibleRelationSet} determines a component's relation set. + * The relation set of a component is a set of {@code AccessibleRelation} + * objects that describe the component's relationships with other components. * + * @author Lynn Monsanto * @see AccessibleRelation - * - * @author Lynn Monsanto * @since 1.3 */ public class AccessibleRelationSet { /** - * Each entry in the Vector represents an AccessibleRelation. + * Each entry in the {@code Vector} represents an + * {@code AccessibleRelation}. + * * @see #add * @see #addAll * @see #remove @@ -63,11 +61,11 @@ } /** - * Creates a new relation with the initial set of relations contained in - * the array of relations passed in. Duplicate entries are ignored. + * Creates a new relation with the initial set of relations contained in the + * array of relations passed in. Duplicate entries are ignored. * - * @param relations an array of AccessibleRelation describing the - * relation set. + * @param relations an array of {@code AccessibleRelation} describing the + * relation set */ public AccessibleRelationSet(AccessibleRelation[] relations) { if (relations.length != 0) { @@ -79,14 +77,14 @@ } /** - * Adds a new relation to the current relation set. If the relation - * is already in the relation set, the target(s) of the specified - * relation is merged with the target(s) of the existing relation. - * Otherwise, the new relation is added to the relation set. + * Adds a new relation to the current relation set. If the relation is + * already in the relation set, the target(s) of the specified relation is + * merged with the target(s) of the existing relation. Otherwise, the new + * relation is added to the relation set. * - * @param relation the relation to add to the relation set - * @return true if relation is added to the relation set; false if the - * relation set is unchanged + * @param relation the relation to add to the relation set + * @return {@code true} if relation is added to the relation set; + * {@code false} if the relation set is unchanged */ public boolean add(AccessibleRelation relation) { if (relations == null) { @@ -117,10 +115,11 @@ } /** - * Adds all of the relations to the existing relation set. Duplicate - * entries are ignored. + * Adds all of the relations to the existing relation set. Duplicate entries + * are ignored. * - * @param relations AccessibleRelation array describing the relation set. + * @param relations {@code AccessibleRelation} array describing the + * relation set */ public void addAll(AccessibleRelation[] relations) { if (relations.length != 0) { @@ -134,15 +133,14 @@ } /** - * Removes a relation from the current relation set. If the relation - * is not in the set, the relation set will be unchanged and the - * return value will be false. If the relation is in the relation - * set, it will be removed from the set and the return value will be - * true. + * Removes a relation from the current relation set. If the relation is not + * in the set, the relation set will be unchanged and the return value will + * be {@code false}. If the relation is in the relation set, it will be + * removed from the set and the return value will be {@code true}. * - * @param relation the relation to remove from the relation set - * @return true if the relation is in the relation set; false if the - * relation set is unchanged + * @param relation the relation to remove from the relation set + * @return {@code true} if the relation is in the relation set; + * {@code false} if the relation set is unchanged */ public boolean remove(AccessibleRelation relation) { if (relations == null) { @@ -163,6 +161,7 @@ /** * Returns the number of relations in the relation set. + * * @return the number of relations in the relation set */ public int size() { @@ -174,10 +173,12 @@ } /** - * Returns whether the relation set contains a relation - * that matches the specified key. - * @param key the AccessibleRelation key - * @return true if the relation is in the relation set; otherwise false + * Returns whether the relation set contains a relation that matches the + * specified key. + * + * @param key the {@code AccessibleRelation} key + * @return {@code true} if the relation is in the relation set; otherwise + * {@code false} */ public boolean contains(String key) { return get(key) != null; @@ -185,9 +186,10 @@ /** * Returns the relation that matches the specified key. - * @param key the AccessibleRelation key + * + * @param key the {@code AccessibleRelation} key * @return the relation, if one exists, that matches the specified key. - * Otherwise, null is returned. + * Otherwise, {@code null} is returned. */ public AccessibleRelation get(String key) { if (relations == null) { @@ -205,8 +207,10 @@ } /** - * Returns the current relation set as an array of AccessibleRelation - * @return AccessibleRelation array contacting the current relation. + * Returns the current relation set as an array of + * {@code AccessibleRelation}. + * + * @return {@code AccessibleRelation} array contacting the current relation */ public AccessibleRelation[] toArray() { if (relations == null) { @@ -222,10 +226,10 @@ } /** - * Creates a localized String representing all the relations in the set + * Creates a localized string representing all the relations in the set * using the default locale. * - * @return comma separated localized String + * @return comma separated localized string * @see AccessibleBundle#toDisplayString */ public String toString() { diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleResourceBundle.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleResourceBundle.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleResourceBundle.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,19 +29,20 @@ /** * A resource bundle containing the localized strings in the accessibility - * package. This is meant only for internal use by Java Accessibility and - * is not meant to be used by assistive technologies or applications. + * package. This is meant only for internal use by Java Accessibility and is not + * meant to be used by assistive technologies or applications. * - * @author Willie Walker - * @deprecated This class is deprecated as of version 1.3 of the - * Java Platform. + * @author Willie Walker + * @deprecated This class is deprecated as of version 1.3 of the Java Platform */ @Deprecated public class AccessibleResourceBundle extends ListResourceBundle { /** - * Returns the mapping between the programmatic keys and the - * localized display strings. + * Returns the mapping between the programmatic keys and the localized + * display strings. + * + * @return an array of an {@code Object} array representing a key-value pair */ public Object[][] getContents() { // The table holding the mapping between the programmatic keys diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleRole.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleRole.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleRole.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,32 +25,30 @@ package javax.accessibility; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - /** - *

    Class AccessibleRole determines the role of a component. The role of a - * component describes its generic function. (E.G., -* "push button," "table," or "list.") - *

    The toDisplayString method allows you to obtain the localized string - * for a locale independent key from a predefined ResourceBundle for the - * keys defined in this class. - *

    The constants in this class present a strongly typed enumeration - * of common object roles. A public constructor for this class has been - * purposely omitted and applications should use one of the constants - * from this class. If the constants in this class are not sufficient - * to describe the role of an object, a subclass should be generated - * from this class and it should provide constants in a similar manner. + * Class {@code AccessibleRole} determines the role of a component. The role of + * a component describes its generic function. (E.G., "push button," "table," or + * "list.") + *

    + * The {@link #toDisplayString()} method allows you to obtain the localized + * string for a locale independent key from a predefined {@code ResourceBundle} + * for the keys defined in this class. + *

    + * The constants in this class present a strongly typed enumeration of common + * object roles. A public constructor for this class has been purposely omitted + * and applications should use one of the constants from this class. If the + * constants in this class are not sufficient to describe the role of an object, + * a subclass should be generated from this class and it should provide + * constants in a similar manner. * - * @author Willie Walker - * @author Peter Korn - * @author Lynn Monsanto + * @author Willie Walker + * @author Peter Korn + * @author Lynn Monsanto */ public class AccessibleRole extends AccessibleBundle { -// If you add or remove anything from here, make sure you -// update AccessibleResourceBundle.java. + // If you add or remove anything from here, make sure you + // update AccessibleResourceBundle.java. /** * Object is used to alert the user about something. @@ -65,8 +63,8 @@ = new AccessibleRole("columnheader"); /** - * Object that can be drawn into and is used to trap - * events. + * Object that can be drawn into and is used to trap events. + * * @see #FRAME * @see #GLASS_PANE * @see #LAYERED_PANE @@ -75,14 +73,15 @@ = new AccessibleRole("canvas"); /** - * A list of choices the user can select from. Also optionally - * allows the user to enter a choice of their own. + * A list of choices the user can select from. Also optionally allows the + * user to enter a choice of their own. */ public static final AccessibleRole COMBO_BOX = new AccessibleRole("combobox"); /** - * An iconified internal frame in a DESKTOP_PANE. + * An iconified internal frame in a {@code DESKTOP_PANE}. + * * @see #DESKTOP_PANE * @see #INTERNAL_FRAME */ @@ -90,11 +89,12 @@ = new AccessibleRole("desktopicon"); /** - * An object containing a collection of {@code Accessibles} that - * together represents {@code HTML} content. The child - * {@code Accessibles} would include objects implementing - * {@code AccessibleText}, {@code AccessibleHypertext}, - * {@code AccessibleIcon}, and other interfaces. + * An object containing a collection of {@code Accessibles} that together + * represents {@code HTML} content. The child {@code Accessibles} would + * include objects implementing {@code AccessibleText}, + * {@code AccessibleHypertext}, {@code AccessibleIcon}, and other + * interfaces. + * * @see #HYPERLINK * @see AccessibleText * @see AccessibleHypertext @@ -106,10 +106,10 @@ = new AccessibleRole("htmlcontainer"); /** - * A frame-like object that is clipped by a desktop pane. The - * desktop pane, internal frame, and desktop icon objects are - * often used to create multiple document interfaces within an - * application. + * A frame-like object that is clipped by a desktop pane. The desktop pane, + * internal frame, and desktop icon objects are often used to create + * multiple document interfaces within an application. + * * @see #DESKTOP_ICON * @see #DESKTOP_PANE * @see #FRAME @@ -118,8 +118,9 @@ = new AccessibleRole("internalframe"); /** - * A pane that supports internal frames and - * iconified versions of those internal frames. + * A pane that supports internal frames and iconified versions of those + * internal frames. + * * @see #DESKTOP_ICON * @see #INTERNAL_FRAME */ @@ -127,7 +128,8 @@ = new AccessibleRole("desktoppane"); /** - * A specialized pane whose primary use is inside a DIALOG + * A specialized pane whose primary use is inside a {@code DIALOG}. + * * @see #DIALOG */ public static final AccessibleRole OPTION_PANE @@ -135,6 +137,7 @@ /** * A top level window with no title or border. + * * @see #FRAME * @see #DIALOG */ @@ -142,8 +145,9 @@ = new AccessibleRole("window"); /** - * A top level window with a title bar, border, menu bar, etc. It is - * often used as the primary window for an application. + * A top level window with a title bar, border, menu bar, etc. It is often + * used as the primary window for an application. + * * @see #DIALOG * @see #CANVAS * @see #WINDOW @@ -152,9 +156,10 @@ = new AccessibleRole("frame"); /** - * A top level window with title bar and a border. A dialog is similar - * to a frame, but it has fewer properties and is often used as a - * secondary window for an application. + * A top level window with title bar and a border. A dialog is similar to a + * frame, but it has fewer properties and is often used as a secondary + * window for an application. + * * @see #FRAME * @see #WINDOW */ @@ -169,34 +174,34 @@ /** - * A pane that allows the user to navigate through - * and select the contents of a directory. May be used - * by a file chooser. + * A pane that allows the user to navigate through and select the contents + * of a directory. May be used by a file chooser. + * * @see #FILE_CHOOSER */ public static final AccessibleRole DIRECTORY_PANE = new AccessibleRole("directorypane"); /** - * A specialized dialog that displays the files in the directory - * and lets the user select a file, browse a different directory, - * or specify a filename. May use the directory pane to show the - * contents of a directory. + * A specialized dialog that displays the files in the directory and lets + * the user select a file, browse a different directory, or specify a + * filename. May use the directory pane to show the contents of a directory. + * * @see #DIRECTORY_PANE */ public static final AccessibleRole FILE_CHOOSER = new AccessibleRole("filechooser"); /** - * An object that fills up space in a user interface. It is often - * used in interfaces to tweak the spacing between components, - * but serves no other purpose. + * An object that fills up space in a user interface. It is often used in + * interfaces to tweak the spacing between components, but serves no other + * purpose. */ public static final AccessibleRole FILLER = new AccessibleRole("filler"); /** - * A hypertext anchor + * A hypertext anchor. */ public static final AccessibleRole HYPERLINK = new AccessibleRole("hyperlink"); @@ -216,6 +221,7 @@ /** * A specialized pane that has a glass pane and a layered pane as its * children. + * * @see #GLASS_PANE * @see #LAYERED_PANE */ @@ -223,8 +229,8 @@ = new AccessibleRole("rootpane"); /** - * A pane that is guaranteed to be painted on top - * of all panes beneath it. + * A pane that is guaranteed to be painted on top of all panes beneath it. + * * @see #ROOT_PANE * @see #CANVAS */ @@ -233,9 +239,10 @@ /** * A specialized pane that allows its children to be drawn in layers, - * providing a form of stacking order. This is usually the pane that - * holds the menu bar as well as the pane that contains most of the - * visual components in a window. + * providing a form of stacking order. This is usually the pane that holds + * the menu bar as well as the pane that contains most of the visual + * components in a window. + * * @see #GLASS_PANE * @see #ROOT_PANE */ @@ -243,9 +250,10 @@ = new AccessibleRole("layeredpane"); /** - * An object that presents a list of objects to the user and allows the - * user to select one or more of them. A list is usually contained - * within a scroll pane. + * An object that presents a list of objects to the user and allows the user + * to select one or more of them. A list is usually contained within a + * scroll pane. + * * @see #SCROLL_PANE * @see #LIST_ITEM */ @@ -253,8 +261,9 @@ = new AccessibleRole("list"); /** - * An object that presents an element in a list. A list is usually - * contained within a scroll pane. + * An object that presents an element in a list. A list is usually contained + * within a scroll pane. + * * @see #SCROLL_PANE * @see #LIST */ @@ -262,10 +271,10 @@ = new AccessibleRole("listitem"); /** - * An object usually drawn at the top of the primary dialog box of - * an application that contains a list of menus the user can choose - * from. For example, a menu bar might contain menus for "File," - * "Edit," and "Help." + * An object usually drawn at the top of the primary dialog box of an + * application that contains a list of menus the user can choose from. For + * example, a menu bar might contain menus for "File," "Edit," and "Help." + * * @see #MENU * @see #POPUP_MENU * @see #LAYERED_PANE @@ -274,9 +283,9 @@ = new AccessibleRole("menubar"); /** - * A temporary window that is usually used to offer the user a - * list of choices, and then hides when the user selects one of - * those choices. + * A temporary window that is usually used to offer the user a list of + * choices, and then hides when the user selects one of those choices. + * * @see #MENU * @see #MENU_ITEM */ @@ -284,12 +293,12 @@ = new AccessibleRole("popupmenu"); /** - * An object usually found inside a menu bar that contains a list - * of actions the user can choose from. A menu can have any object - * as its children, but most often they are menu items, other menus, - * or rudimentary objects such as radio buttons, check boxes, or - * separators. For example, an application may have an "Edit" menu - * that contains menu items for "Cut" and "Paste." + * An object usually found inside a menu bar that contains a list of actions + * the user can choose from. A menu can have any object as its children, but + * most often they are menu items, other menus, or rudimentary objects such + * as radio buttons, check boxes, or separators. For example, an application + * may have an "Edit" menu that contains menu items for "Cut" and "Paste." + * * @see #MENU_BAR * @see #MENU_ITEM * @see #SEPARATOR @@ -301,10 +310,11 @@ = new AccessibleRole("menu"); /** - * An object usually contained in a menu that presents an action - * the user can choose. For example, the "Cut" menu item in an - * "Edit" menu would be an action the user can select to cut the - * selected area of text in a document. + * An object usually contained in a menu that presents an action the user + * can choose. For example, the "Cut" menu item in an "Edit" menu would be + * an action the user can select to cut the selected area of text in a + * document. + * * @see #MENU_BAR * @see #SEPARATOR * @see #POPUP_MENU @@ -313,11 +323,11 @@ = new AccessibleRole("menuitem"); /** - * An object usually contained in a menu to provide a visual - * and logical separation of the contents in a menu. For example, - * the "File" menu of an application might contain menu items for - * "Open," "Close," and "Exit," and will place a separator between - * "Close" and "Exit" menu items. + * An object usually contained in a menu to provide a visual and logical + * separation of the contents in a menu. For example, the "File" menu of an + * application might contain menu items for "Open," "Close," and "Exit," and + * will place a separator between "Close" and "Exit" menu items. + * * @see #MENU * @see #MENU_ITEM */ @@ -325,19 +335,21 @@ = new AccessibleRole("separator"); /** - * An object that presents a series of panels (or page tabs), one at a - * time, through some mechanism provided by the object. The most common - * mechanism is a list of tabs at the top of the panel. The children of - * a page tab list are all page tabs. + * An object that presents a series of panels (or page tabs), one at a time, + * through some mechanism provided by the object. The most common mechanism + * is a list of tabs at the top of the panel. The children of a page tab + * list are all page tabs. + * * @see #PAGE_TAB */ public static final AccessibleRole PAGE_TAB_LIST = new AccessibleRole("pagetablist"); /** - * An object that is a child of a page tab list. Its sole child is - * the panel that is to be presented to the user when the user - * selects the page tab from the list of tabs in the page tab list. + * An object that is a child of a page tab list. Its sole child is the panel + * that is to be presented to the user when the user selects the page tab + * from the list of tabs in the page tab list. + * * @see #PAGE_TAB_LIST */ public static final AccessibleRole PAGE_TAB @@ -356,8 +368,8 @@ = new AccessibleRole("progressbar"); /** - * A text object used for passwords, or other places where the - * text contents is not shown visibly to the user + * A text object used for passwords, or other places where the text contents + * is not shown visibly to the user. */ public static final AccessibleRole PASSWORD_TEXT = new AccessibleRole("passwordtext"); @@ -365,6 +377,7 @@ /** * An object the user can manipulate to tell the application to do * something. + * * @see #CHECK_BOX * @see #TOGGLE_BUTTON * @see #RADIO_BUTTON @@ -373,8 +386,9 @@ = new AccessibleRole("pushbutton"); /** - * A specialized push button that can be checked or unchecked, but - * does not provide a separate indicator for the current state. + * A specialized push button that can be checked or unchecked, but does not + * provide a separate indicator for the current state. + * * @see #PUSH_BUTTON * @see #CHECK_BOX * @see #RADIO_BUTTON @@ -383,8 +397,9 @@ = new AccessibleRole("togglebutton"); /** - * A choice that can be checked or unchecked and provides a - * separate indicator for the current state. + * A choice that can be checked or unchecked and provides a separate + * indicator for the current state. + * * @see #PUSH_BUTTON * @see #TOGGLE_BUTTON * @see #RADIO_BUTTON @@ -393,8 +408,9 @@ = new AccessibleRole("checkbox"); /** - * A specialized check box that will cause other radio buttons in the - * same group to become unchecked when this one is checked. + * A specialized check box that will cause other radio buttons in the same + * group to become unchecked when this one is checked. + * * @see #PUSH_BUTTON * @see #TOGGLE_BUTTON * @see #CHECK_BOX @@ -409,8 +425,9 @@ = new AccessibleRole("rowheader"); /** - * An object that allows a user to incrementally view a large amount - * of information. Its children can include scroll bars and a viewport. + * An object that allows a user to incrementally view a large amount of + * information. Its children can include scroll bars and a viewport. + * * @see #SCROLL_BAR * @see #VIEWPORT */ @@ -418,24 +435,26 @@ = new AccessibleRole("scrollpane"); /** - * An object usually used to allow a user to incrementally view a - * large amount of data. Usually used only by a scroll pane. + * An object usually used to allow a user to incrementally view a large + * amount of data. Usually used only by a scroll pane. + * * @see #SCROLL_PANE */ public static final AccessibleRole SCROLL_BAR = new AccessibleRole("scrollbar"); /** - * An object usually used in a scroll pane. It represents the portion - * of the entire data that the user can see. As the user manipulates - * the scroll bars, the contents of the viewport can change. + * An object usually used in a scroll pane. It represents the portion of the + * entire data that the user can see. As the user manipulates the scroll + * bars, the contents of the viewport can change. + * * @see #SCROLL_PANE */ public static final AccessibleRole VIEWPORT = new AccessibleRole("viewport"); /** - * An object that allows the user to select from a bounded range. For + * An object that allows the user to select from a bounded range. For * example, a slider might be used to select a number between 0 and 100. */ public static final AccessibleRole SLIDER @@ -443,54 +462,56 @@ /** * A specialized panel that presents two other panels at the same time. - * Between the two panels is a divider the user can manipulate to make - * one panel larger and the other panel smaller. + * Between the two panels is a divider the user can manipulate to make one + * panel larger and the other panel smaller. */ public static final AccessibleRole SPLIT_PANE = new AccessibleRole("splitpane"); /** - * An object used to present information in terms of rows and columns. - * An example might include a spreadsheet application. + * An object used to present information in terms of rows and columns. An + * example might include a spreadsheet application. */ public static final AccessibleRole TABLE = new AccessibleRole("table"); /** - * An object that presents text to the user. The text is usually - * editable by the user as opposed to a label. + * An object that presents text to the user. The text is usually editable by + * the user as opposed to a label. + * * @see #LABEL */ public static final AccessibleRole TEXT = new AccessibleRole("text"); /** - * An object used to present hierarchical information to the user. - * The individual nodes in the tree can be collapsed and expanded - * to provide selective disclosure of the tree's contents. + * An object used to present hierarchical information to the user. The + * individual nodes in the tree can be collapsed and expanded to provide + * selective disclosure of the tree's contents. */ public static final AccessibleRole TREE = new AccessibleRole("tree"); /** - * A bar or palette usually composed of push buttons or toggle buttons. - * It is often used to provide the most frequently used functions for an + * A bar or palette usually composed of push buttons or toggle buttons. It + * is often used to provide the most frequently used functions for an * application. */ public static final AccessibleRole TOOL_BAR = new AccessibleRole("toolbar"); /** - * An object that provides information about another object. The - * accessibleDescription property of the tool tip is often displayed - * to the user in a small "help bubble" when the user causes the - * mouse to hover over the object associated with the tool tip. + * An object that provides information about another object. The + * {@code accessibleDescription} property of the tool tip is often displayed + * to the user in a small "help bubble" when the user causes the mouse to + * hover over the object associated with the tool tip. */ public static final AccessibleRole TOOL_TIP = new AccessibleRole("tooltip"); /** * An AWT component, but nothing else is known about it. + * * @see #SWING_COMPONENT * @see #UNKNOWN */ @@ -499,6 +520,7 @@ /** * A Swing component, but nothing else is known about it. + * * @see #AWT_COMPONENT * @see #UNKNOWN */ @@ -506,8 +528,9 @@ = new AccessibleRole("swingcomponent"); /** - * The object contains some Accessible information, but its role is + * The object contains some {@code Accessible} information, but its role is * not known. + * * @see #AWT_COMPONENT * @see #SWING_COMPONENT */ @@ -515,42 +538,42 @@ = new AccessibleRole("unknown"); /** - * A STATUS_BAR is an simple component that can contain - * multiple labels of status information to the user. + * A {@code STATUS_BAR} is an simple component that can contain multiple + * labels of status information to the user. */ public static final AccessibleRole STATUS_BAR = new AccessibleRole("statusbar"); /** - * A DATE_EDITOR is a component that allows users to edit - * java.util.Date and java.util.Time objects + * A {@code DATE_EDITOR} is a component that allows users to edit + * {@code java.util.Date} and {@code java.util.Time} objects. */ public static final AccessibleRole DATE_EDITOR = new AccessibleRole("dateeditor"); /** - * A SPIN_BOX is a simple spinner component and its main use - * is for simple numbers. + * A {@code SPIN_BOX} is a simple spinner component and its main use is for + * simple numbers. */ public static final AccessibleRole SPIN_BOX = new AccessibleRole("spinbox"); /** - * A FONT_CHOOSER is a component that lets the user pick various + * A {@code FONT_CHOOSER} is a component that lets the user pick various * attributes for fonts. */ public static final AccessibleRole FONT_CHOOSER = new AccessibleRole("fontchooser"); /** - * A GROUP_BOX is a simple container that contains a border - * around it and contains components inside it. + * A {@code GROUP_BOX} is a simple container that contains a border around + * it and contains components inside it. */ public static final AccessibleRole GROUP_BOX = new AccessibleRole("groupbox"); /** - * A text header + * A text header. * * @since 1.5 */ @@ -558,7 +581,7 @@ new AccessibleRole("header"); /** - * A text footer + * A text footer. * * @since 1.5 */ @@ -566,7 +589,7 @@ new AccessibleRole("footer"); /** - * A text paragraph + * A text paragraph. * * @since 1.5 */ @@ -574,7 +597,7 @@ new AccessibleRole("paragraph"); /** - * A ruler is an object used to measure distance + * A ruler is an object used to measure distance. * * @since 1.5 */ @@ -582,9 +605,8 @@ new AccessibleRole("ruler"); /** - * A role indicating the object acts as a formula for - * calculating a value. An example is a formula in - * a spreadsheet cell. + * A role indicating the object acts as a formula for calculating a value. + * An example is a formula in a spreadsheet cell. * * @since 1.5 */ @@ -592,8 +614,7 @@ new AccessibleRole("editbar"); /** - * A role indicating the object monitors the progress - * of some operation. + * A role indicating the object monitors the progress of some operation. * * @since 1.5 */ @@ -643,16 +664,16 @@ // = new AccessibleRole("treenode"); /** - * Creates a new AccessibleRole using the given locale independent key. - * This should not be a public method. Instead, it is used to create + * Creates a new {@code AccessibleRole} using the given locale independent + * key. This should not be a public method. Instead, it is used to create * the constants in this file to make it a strongly typed enumeration. * Subclasses of this class should enforce similar policy. *

    - * The key String should be a locale independent key for the role. - * It is not intended to be used as the actual String to display - * to the user. To get the localized string, use toDisplayString. + * The key {@code String} should be a locale independent key for the role. + * It is not intended to be used as the actual {@code String} to display to + * the user. To get the localized string, use {@link #toDisplayString()}. * - * @param key the locale independent name of the role. + * @param key the locale independent name of the role * @see AccessibleBundle#toDisplayString */ protected AccessibleRole(String key) { diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleSelection.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleSelection.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleSelection.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,89 +26,90 @@ package javax.accessibility; /** - * This AccessibleSelection interface - * provides the standard mechanism for an assistive technology to determine - * what the current selected children are, as well as modify the selection set. - * Any object that has children that can be selected should support - * the AccessibleSelection interface. Applications can determine if an object supports the - * AccessibleSelection interface by first obtaining its AccessibleContext (see - * {@link Accessible}) and then calling the - * {@link AccessibleContext#getAccessibleSelection} method. - * If the return value is not null, the object supports this interface. + * This {@code AccessibleSelection} interface provides the standard mechanism + * for an assistive technology to determine what the current selected children + * are, as well as modify the selection set. Any object that has children that + * can be selected should support the {@code AccessibleSelection} interface. + * Applications can determine if an object supports the + * {@code AccessibleSelection} interface by first obtaining its + * {@code AccessibleContext} (see {@link Accessible}) and then calling the + * {@link AccessibleContext#getAccessibleSelection} method. If the return value + * is not {@code null}, the object supports this interface. * + * @author Peter Korn + * @author Hans Muller + * @author Willie Walker * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleContext#getAccessibleSelection - * - * @author Peter Korn - * @author Hans Muller - * @author Willie Walker */ public interface AccessibleSelection { /** - * Returns the number of Accessible children currently selected. - * If no children are selected, the return value will be 0. + * Returns the number of {@code Accessible} children currently selected. If + * no children are selected, the return value will be 0. * - * @return the number of items currently selected. + * @return the number of items currently selected */ - public int getAccessibleSelectionCount(); + public int getAccessibleSelectionCount(); /** - * Returns an Accessible representing the specified selected child - * of the object. If there isn't a selection, or there are - * fewer children selected than the integer passed in, the return - * value will be null. - *

    Note that the index represents the i-th selected child, which - * is different from the i-th child. + * Returns an {@code Accessible} representing the specified selected child + * of the object. If there isn't a selection, or there are fewer children + * selected than the integer passed in, the return value will be + * {@code null}. + *

    + * Note that the index represents the i-th selected child, which is + * different from the i-th child. * - * @param i the zero-based index of selected children + * @param i the zero-based index of selected children * @return the i-th selected child * @see #getAccessibleSelectionCount */ - public Accessible getAccessibleSelection(int i); + public Accessible getAccessibleSelection(int i); /** * Determines if the current child of this object is selected. * - * @return true if the current child of this object is selected; else false. - * @param i the zero-based index of the child in this Accessible object. + * @param i the zero-based index of the child in this {@code Accessible} + * object + * @return {@code true} if the current child of this object is selected; + * else {@code false} * @see AccessibleContext#getAccessibleChild */ - public boolean isAccessibleChildSelected(int i); + public boolean isAccessibleChildSelected(int i); /** - * Adds the specified Accessible child of the object to the object's - * selection. If the object supports multiple selections, - * the specified child is added to any existing selection, otherwise - * it replaces any existing selection in the object. If the - * specified child is already selected, this method has no effect. + * Adds the specified {@code Accessible} child of the object to the object's + * selection. If the object supports multiple selections, the specified + * child is added to any existing selection, otherwise it replaces any + * existing selection in the object. If the specified child is already + * selected, this method has no effect. * - * @param i the zero-based index of the child + * @param i the zero-based index of the child * @see AccessibleContext#getAccessibleChild */ - public void addAccessibleSelection(int i); + public void addAccessibleSelection(int i); /** - * Removes the specified child of the object from the object's - * selection. If the specified item isn't currently selected, this - * method has no effect. + * Removes the specified child of the object from the object's selection. If + * the specified item isn't currently selected, this method has no effect. * - * @param i the zero-based index of the child + * @param i the zero-based index of the child * @see AccessibleContext#getAccessibleChild */ - public void removeAccessibleSelection(int i); + public void removeAccessibleSelection(int i); /** - * Clears the selection in the object, so that no children in the - * object are selected. + * Clears the selection in the object, so that no children in the object are + * selected. */ - public void clearAccessibleSelection(); + public void clearAccessibleSelection(); /** - * Causes every child of the object to be selected - * if the object supports multiple selections. + * Causes every child of the object to be selected if the object supports + * multiple selections. */ - public void selectAllAccessibleSelection(); + public void selectAllAccessibleSelection(); } diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleState.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleState.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleState.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,27 +25,24 @@ package javax.accessibility; -import java.util.Vector; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - /** - *

    Class AccessibleState describes a component's particular state. The actual - * state of the component is defined as an AccessibleStateSet, which is a - * composed set of AccessibleStates. - *

    The toDisplayString method allows you to obtain the localized string - * for a locale independent key from a predefined ResourceBundle for the - * keys defined in this class. - *

    The constants in this class present a strongly typed enumeration - * of common object roles. A public constructor for this class has been - * purposely omitted and applications should use one of the constants - * from this class. If the constants in this class are not sufficient - * to describe the role of an object, a subclass should be generated - * from this class and it should provide constants in a similar manner. + * Class {@code AccessibleState} describes a component's particular state. The + * actual state of the component is defined as an {@code AccessibleStateSet}, + * which is a composed set of {@code AccessibleStates}. + *

    + * The {@link #toDisplayString()} method allows you to obtain the localized + * string for a locale independent key from a predefined {@code ResourceBundle} + * for the keys defined in this class. + *

    + * The constants in this class present a strongly typed enumeration of common + * object roles. A public constructor for this class has been purposely omitted + * and applications should use one of the constants from this class. If the + * constants in this class are not sufficient to describe the role of an object, + * a subclass should be generated from this class and it should provide + * constants in a similar manner. * - * @author Willie Walker - * @author Peter Korn + * @author Willie Walker + * @author Peter Korn */ public class AccessibleState extends AccessibleBundle { @@ -53,11 +50,12 @@ // update AccessibleResourceBundle.java. /** - * Indicates a window is currently the active window. This includes - * windows, dialogs, frames, etc. In addition, this state is used - * to indicate the currently active child of a component such as a - * list, table, or tree. For example, the active child of a list - * is the child that is drawn with a rectangle around it. + * Indicates a window is currently the active window. This includes windows, + * dialogs, frames, etc. In addition, this state is used to indicate the + * currently active child of a component such as a list, table, or tree. For + * example, the active child of a list is the child that is drawn with a + * rectangle around it. + * * @see AccessibleRole#WINDOW * @see AccessibleRole#FRAME * @see AccessibleRole#DIALOG @@ -66,28 +64,30 @@ = new AccessibleState("active"); /** - * Indicates this object is currently pressed. This is usually - * associated with buttons and indicates the user has pressed a - * mouse button while the pointer was over the button and has - * not yet released the mouse button. + * Indicates this object is currently pressed. This is usually associated + * with buttons and indicates the user has pressed a mouse button while the + * pointer was over the button and has not yet released the mouse button. + * * @see AccessibleRole#PUSH_BUTTON */ public static final AccessibleState PRESSED = new AccessibleState("pressed"); /** - * Indicates that the object is armed. This is usually used on buttons - * that have been pressed but not yet released, and the mouse pointer - * is still over the button. + * Indicates that the object is armed. This is usually used on buttons that + * have been pressed but not yet released, and the mouse pointer is still + * over the button. + * * @see AccessibleRole#PUSH_BUTTON */ public static final AccessibleState ARMED = new AccessibleState("armed"); /** - * Indicates the current object is busy. This is usually used on objects - * such as progress bars, sliders, or scroll bars to indicate they are - * in a state of transition. + * Indicates the current object is busy. This is usually used on objects + * such as progress bars, sliders, or scroll bars to indicate they are in a + * state of transition. + * * @see AccessibleRole#PROGRESS_BAR * @see AccessibleRole#SCROLL_BAR * @see AccessibleRole#SLIDER @@ -96,8 +96,9 @@ = new AccessibleState("busy"); /** - * Indicates this object is currently checked. This is usually used on + * Indicates this object is currently checked. This is usually used on * objects such as toggle buttons, radio buttons, and check boxes. + * * @see AccessibleRole#TOGGLE_BUTTON * @see AccessibleRole#RADIO_BUTTON * @see AccessibleRole#CHECK_BOX @@ -106,19 +107,21 @@ = new AccessibleState("checked"); /** - * Indicates the user can change the contents of this object. This - * is usually used primarily for objects that allow the user to - * enter text. Other objects, such as scroll bars and sliders, - * are automatically editable if they are enabled. + * Indicates the user can change the contents of this object. This is + * usually used primarily for objects that allow the user to enter text. + * Other objects, such as scroll bars and sliders, are automatically + * editable if they are enabled. + * * @see #ENABLED */ public static final AccessibleState EDITABLE = new AccessibleState("editable"); /** - * Indicates this object allows progressive disclosure of its children. - * This is usually used with hierarchical objects such as trees and - * is often paired with the EXPANDED or COLLAPSED states. + * Indicates this object allows progressive disclosure of its children. This + * is usually used with hierarchical objects such as trees and is often + * paired with the {@code EXPANDED} or {@code COLLAPSED} states. + * * @see #EXPANDED * @see #COLLAPSED * @see AccessibleRole#TREE @@ -127,9 +130,10 @@ = new AccessibleState("expandable"); /** - * Indicates this object is collapsed. This is usually paired with the - * EXPANDABLE state and is used on objects that provide progressive + * Indicates this object is collapsed. This is usually paired with the + * {@code EXPANDABLE} state and is used on objects that provide progressive * disclosure such as trees. + * * @see #EXPANDABLE * @see #EXPANDED * @see AccessibleRole#TREE @@ -138,9 +142,10 @@ = new AccessibleState("collapsed"); /** - * Indicates this object is expanded. This is usually paired with the - * EXPANDABLE state and is used on objects that provide progressive + * Indicates this object is expanded. This is usually paired with the + * {@code EXPANDABLE} state and is used on objects that provide progressive * disclosure such as trees. + * * @see #EXPANDABLE * @see #COLLAPSED * @see AccessibleRole#TREE @@ -149,18 +154,19 @@ = new AccessibleState("expanded"); /** - * Indicates this object is enabled. The absence of this state from an - * object's state set indicates this object is not enabled. An object - * that is not enabled cannot be manipulated by the user. In a graphical - * display, it is usually grayed out. + * Indicates this object is enabled. The absence of this state from an + * object's state set indicates this object is not enabled. An object that + * is not enabled cannot be manipulated by the user. In a graphical display, + * it is usually grayed out. */ public static final AccessibleState ENABLED = new AccessibleState("enabled"); /** - * Indicates this object can accept keyboard focus, which means all - * events resulting from typing on the keyboard will normally be - * passed to it when it has focus. + * Indicates this object can accept keyboard focus, which means all events + * resulting from typing on the keyboard will normally be passed to it when + * it has focus. + * * @see #FOCUSED */ public static final AccessibleState FOCUSABLE @@ -168,15 +174,16 @@ /** * Indicates this object currently has the keyboard focus. + * * @see #FOCUSABLE */ public static final AccessibleState FOCUSED = new AccessibleState("focused"); /** - * Indicates this object is minimized and is represented only by an - * icon. This is usually only associated with frames and internal - * frames. + * Indicates this object is minimized and is represented only by an icon. + * This is usually only associated with frames and internal frames. + * * @see AccessibleRole#FRAME * @see AccessibleRole#INTERNAL_FRAME */ @@ -184,20 +191,21 @@ = new AccessibleState("iconified"); /** - * Indicates something must be done with this object before the - * user can interact with an object in a different window. This - * is usually associated only with dialogs. + * Indicates something must be done with this object before the user can + * interact with an object in a different window. This is usually associated + * only with dialogs. + * * @see AccessibleRole#DIALOG */ public static final AccessibleState MODAL = new AccessibleState("modal"); /** - * Indicates this object paints every pixel within its - * rectangular region. A non-opaque component paints only some of - * its pixels, allowing the pixels underneath it to "show through". - * A component that does not fully paint its pixels therefore - * provides a degree of transparency. + * Indicates this object paints every pixel within its rectangular region. A + * non-opaque component paints only some of its pixels, allowing the pixels + * underneath it to "show through". A component that does not fully paint + * its pixels therefore provides a degree of transparency. + * * @see Accessible#getAccessibleContext * @see AccessibleContext#getAccessibleComponent * @see AccessibleComponent#getBounds @@ -207,6 +215,7 @@ /** * Indicates the size of this object is not fixed. + * * @see Accessible#getAccessibleContext * @see AccessibleContext#getAccessibleComponent * @see AccessibleComponent#getSize @@ -217,8 +226,9 @@ /** - * Indicates this object allows more than one of its children to - * be selected at the same time. + * Indicates this object allows more than one of its children to be selected + * at the same time. + * * @see Accessible#getAccessibleContext * @see AccessibleContext#getAccessibleSelection * @see AccessibleSelection @@ -227,9 +237,10 @@ = new AccessibleState("multiselectable"); /** - * Indicates this object is the child of an object that allows its - * children to be selected, and that this child is one of those - * children that can be selected. + * Indicates this object is the child of an object that allows its children + * to be selected, and that this child is one of those children that can be + * selected. + * * @see #SELECTED * @see Accessible#getAccessibleContext * @see AccessibleContext#getAccessibleSelection @@ -239,9 +250,10 @@ = new AccessibleState("selectable"); /** - * Indicates this object is the child of an object that allows its - * children to be selected, and that this child is one of those - * children that has been selected. + * Indicates this object is the child of an object that allows its children + * to be selected, and that this child is one of those children that has + * been selected. + * * @see #SELECTABLE * @see Accessible#getAccessibleContext * @see AccessibleContext#getAccessibleSelection @@ -251,29 +263,31 @@ = new AccessibleState("selected"); /** - * Indicates this object, the object's parent, the object's parent's - * parent, and so on, are all visible. Note that this does not - * necessarily mean the object is painted on the screen. It might - * be occluded by some other showing object. + * Indicates this object, the object's parent, the object's parent's parent, + * and so on, are all visible. Note that this does not necessarily mean the + * object is painted on the screen. It might be occluded by some other + * showing object. + * * @see #VISIBLE */ public static final AccessibleState SHOWING = new AccessibleState("showing"); /** - * Indicates this object is visible. Note: this means that the - * object intends to be visible; however, it may not in fact be - * showing on the screen because one of the objects that this object - * is contained by is not visible. + * Indicates this object is visible. Note: this means that the object + * intends to be visible; however, it may not in fact be showing on the + * screen because one of the objects that this object is contained by is not + * visible. + * * @see #SHOWING */ public static final AccessibleState VISIBLE = new AccessibleState("visible"); /** - * Indicates the orientation of this object is vertical. This is - * usually associated with objects such as scrollbars, sliders, and - * progress bars. + * Indicates the orientation of this object is vertical. This is usually + * associated with objects such as scrollbars, sliders, and progress bars. + * * @see #VERTICAL * @see AccessibleRole#SCROLL_BAR * @see AccessibleRole#SLIDER @@ -283,9 +297,9 @@ = new AccessibleState("vertical"); /** - * Indicates the orientation of this object is horizontal. This is - * usually associated with objects such as scrollbars, sliders, and - * progress bars. + * Indicates the orientation of this object is horizontal. This is usually + * associated with objects such as scrollbars, sliders, and progress bars. + * * @see #HORIZONTAL * @see AccessibleRole#SCROLL_BAR * @see AccessibleRole#SLIDER @@ -295,39 +309,38 @@ = new AccessibleState("horizontal"); /** - * Indicates this (text) object can contain only a single line of text + * Indicates this (text) object can contain only a single line of text. */ public static final AccessibleState SINGLE_LINE = new AccessibleState("singleline"); /** - * Indicates this (text) object can contain multiple lines of text + * Indicates this (text) object can contain multiple lines of text. */ public static final AccessibleState MULTI_LINE = new AccessibleState("multiline"); /** - * Indicates this object is transient. An assistive technology should - * not add a PropertyChange listener to an object with transient state, - * as that object will never generate any events. Transient objects - * are typically created to answer Java Accessibility method queries, - * but otherwise do not remain linked to the underlying object (for - * example, those objects underneath lists, tables, and trees in Swing, - * where only one actual UI Component does shared rendering duty for - * all of the data objects underneath the actual list/table/tree elements). + * Indicates this object is transient. An assistive technology should not + * add a {@code PropertyChange} listener to an object with transient state, + * as that object will never generate any events. Transient objects are + * typically created to answer Java Accessibility method queries, but + * otherwise do not remain linked to the underlying object (for example, + * those objects underneath lists, tables, and trees in Swing, where only + * one actual {@code UI Component} does shared rendering duty for all of the + * data objects underneath the actual list/table/tree elements). * * @since 1.5 - * */ public static final AccessibleState TRANSIENT = new AccessibleState("transient"); /** - * Indicates this object is responsible for managing its - * subcomponents. This is typically used for trees and tables - * that have a large number of subcomponents and where the - * objects are created only when needed and otherwise remain virtual. - * The application should not manage the subcomponents directly. + * Indicates this object is responsible for managing its subcomponents. This + * is typically used for trees and tables that have a large number of + * subcomponents and where the objects are created only when needed and + * otherwise remain virtual. The application should not manage the + * subcomponents directly. * * @since 1.5 */ @@ -335,10 +348,9 @@ = new AccessibleState ("managesDescendants"); /** - * Indicates that the object state is indeterminate. An example - * is selected text that is partially bold and partially not - * bold. In this case the attributes associated with the selected - * text are indeterminate. + * Indicates that the object state is indeterminate. An example is selected + * text that is partially bold and partially not bold. In this case the + * attributes associated with the selected text are indeterminate. * * @since 1.5 */ @@ -346,10 +358,9 @@ = new AccessibleState ("indeterminate"); /** - * A state indicating that text is truncated by a bounding rectangle - * and that some of the text is not displayed on the screen. An example - * is text in a spreadsheet cell that is truncated by the bounds of - * the cell. + * A state indicating that text is truncated by a bounding rectangle and + * that some of the text is not displayed on the screen. An example is text + * in a spreadsheet cell that is truncated by the bounds of the cell. * * @since 1.5 */ @@ -357,16 +368,16 @@ = new AccessibleState("truncated"); /** - * Creates a new AccessibleState using the given locale independent key. - * This should not be a public method. Instead, it is used to create + * Creates a new {@code AccessibleState} using the given locale independent + * key. This should not be a public method. Instead, it is used to create * the constants in this file to make it a strongly typed enumeration. * Subclasses of this class should enforce similar policy. *

    - * The key String should be a locale independent key for the state. - * It is not intended to be used as the actual String to display - * to the user. To get the localized string, use toDisplayString. + * The key {@code String} should be a locale independent key for the state. + * It is not intended to be used as the actual {@code String} to display to + * the user. To get the localized string, use {@link #toDisplayString()}. * - * @param key the locale independent name of the state. + * @param key the locale independent name of the state * @see AccessibleBundle#toDisplayString */ protected AccessibleState(String key) { diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleStateSet.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleStateSet.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleStateSet.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,24 +26,21 @@ package javax.accessibility; import java.util.Vector; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; /** - * Class AccessibleStateSet determines a component's state set. The state set - * of a component is a set of AccessibleState objects and descriptions. E.G., The - * current overall state of the object, such as whether it is enabled, - * has focus, etc. + * Class {@code AccessibleStateSet} determines a component's state set. The + * state set of a component is a set of {@code AccessibleState} objects and + * descriptions. E.G., The current overall state of the object, such as whether + * it is enabled, has focus, etc. * + * @author Willie Walker * @see AccessibleState - * - * @author Willie Walker */ public class AccessibleStateSet { /** - * Each entry in the Vector represents an AccessibleState. + * Each entry in the {@code Vector} represents an {@code AccessibleState}. + * * @see #add * @see #addAll * @see #remove @@ -61,10 +58,11 @@ } /** - * Creates a new state with the initial set of states contained in - * the array of states passed in. Duplicate entries are ignored. + * Creates a new state with the initial set of states contained in the array + * of states passed in. Duplicate entries are ignored. * - * @param states an array of AccessibleState describing the state set. + * @param states an array of {@code AccessibleState} describing the state + * set */ public AccessibleStateSet(AccessibleState[] states) { if (states.length != 0) { @@ -78,14 +76,14 @@ } /** - * Adds a new state to the current state set if it is not already - * present. If the state is already in the state set, the state - * set is unchanged and the return value is false. Otherwise, - * the state is added to the state set and the return value is - * true. - * @param state the state to add to the state set - * @return true if state is added to the state set; false if the state set - * is unchanged + * Adds a new state to the current state set if it is not already present. + * If the state is already in the state set, the state set is unchanged and + * the return value is {@code false}. Otherwise, the state is added to the + * state set and the return value is {@code true}. + * + * @param state the state to add to the state set + * @return {@code true} if state is added to the state set; {@code false} if + * the state set is unchanged */ public boolean add(AccessibleState state) { // [[[ PENDING: WDW - the implementation of this does not need @@ -104,9 +102,10 @@ } /** - * Adds all of the states to the existing state set. Duplicate entries - * are ignored. - * @param states AccessibleState array describing the state set. + * Adds all of the states to the existing state set. Duplicate entries are + * ignored. + * + * @param states {@code AccessibleState} array describing the state set */ public void addAll(AccessibleState[] states) { if (states.length != 0) { @@ -122,14 +121,14 @@ } /** - * Removes a state from the current state set. If the state is not - * in the set, the state set will be unchanged and the return value - * will be false. If the state is in the state set, it will be removed - * from the set and the return value will be true. + * Removes a state from the current state set. If the state is not in the + * set, the state set will be unchanged and the return value will be + * {@code false}. If the state is in the state set, it will be removed from + * the set and the return value will be {@code true}. * - * @param state the state to remove from the state set - * @return true if the state is in the state set; false if the state set - * will be unchanged + * @param state the state to remove from the state set + * @return {@code true} if the state is in the state set; {@code false} if + * the state set will be unchanged */ public boolean remove(AccessibleState state) { if (states == null) { @@ -150,8 +149,10 @@ /** * Checks if the current state is in the state set. - * @param state the state - * @return true if the state is in the state set; otherwise false + * + * @param state the state + * @return {@code true} if the state is in the state set; otherwise + * {@code false} */ public boolean contains(AccessibleState state) { if (states == null) { @@ -162,8 +163,9 @@ } /** - * Returns the current state set as an array of AccessibleState - * @return AccessibleState array containing the current state. + * Returns the current state set as an array of {@code AccessibleState}. + * + * @return {@code AccessibleState} array containing the current state */ public AccessibleState[] toArray() { if (states == null) { @@ -178,10 +180,10 @@ } /** - * Creates a localized String representing all the states in the set - * using the default locale. + * Creates a localized string representing all the states in the set using + * the default locale. * - * @return comma separated localized String + * @return comma separated localized string * @see AccessibleBundle#toDisplayString */ public String toString() { diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleStreamable.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleStreamable.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleStreamable.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,41 +25,40 @@ package javax.accessibility; +import java.awt.datatransfer.DataFlavor; import java.io.InputStream; -import java.awt.datatransfer.DataFlavor; /** - * - * The {@code AccessibleStreamable} interface should be implemented - * by the {@code AccessibleContext} of any component that presents the - * raw stream behind a component on the display screen. Examples of such - * components are HTML, bitmap images and MathML. An object that implements - * {@code AccessibleStreamable} provides two things: a list of MIME - * types supported by the object and a streaming interface for each MIME type to - * get the data. + * The {@code AccessibleStreamable} interface should be implemented by the + * {@code AccessibleContext} of any component that presents the raw stream + * behind a component on the display screen. Examples of such components are + * HTML, bitmap images and MathML. An object that implements + * {@code AccessibleStreamable} provides two things: a list of MIME types + * supported by the object and a streaming interface for each MIME type to get + * the data. * * @author Lynn Monsanto * @author Peter Korn - * - * @see javax.accessibility.AccessibleContext + * @see AccessibleContext * @since 1.5 */ public interface AccessibleStreamable { - /** - * Returns an array of DataFlavor objects for the MIME types - * this object supports. - * - * @return an array of DataFlavor objects for the MIME types - * this object supports. - */ - DataFlavor[] getMimeTypes(); /** - * Returns an InputStream for a DataFlavor - * - * @param flavor the DataFlavor - * @return an ImputStream if an ImputStream for this DataFlavor exists. - * Otherwise, null is returned. - */ - InputStream getStream(DataFlavor flavor); + * Returns an array of {@code DataFlavor} objects for the MIME types this + * object supports. + * + * @return an array of {@code DataFlavor} objects for the MIME types this + * object supports + */ + DataFlavor[] getMimeTypes(); + + /** + * Returns an {@code InputStream} for a {@code DataFlavor}. + * + * @param flavor the {@code DataFlavor} + * @return an {@code ImputStream} if an input stream for this + * {@code DataFlavor} exists. Otherwise, {@code null} is returned. + */ + InputStream getStream(DataFlavor flavor); } diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleTable.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleTable.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleTable.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,10 +26,10 @@ package javax.accessibility; /** - * Class AccessibleTable describes a user-interface component that + * Class {@code AccessibleTable} describes a user-interface component that * presents data in a two-dimensional table format. * - * @author Lynn Monsanto + * @author Lynn Monsanto * @since 1.3 */ public interface AccessibleTable { @@ -44,7 +44,7 @@ /** * Sets the caption for the table. * - * @param a the caption for the table + * @param a the caption for the table */ public void setAccessibleCaption(Accessible a); @@ -56,9 +56,9 @@ public Accessible getAccessibleSummary(); /** - * Sets the summary description of the table + * Sets the summary description of the table. * - * @param a the summary description of the table + * @param a the summary description of the table */ public void setAccessibleSummary(Accessible a); @@ -77,73 +77,69 @@ public int getAccessibleColumnCount(); /** - * Returns the Accessible at a specified row and column - * in the table. + * Returns the {@code Accessible} at a specified row and column in the + * table. * - * @param r zero-based row of the table - * @param c zero-based column of the table - * @return the Accessible at the specified row and column + * @param r zero-based row of the table + * @param c zero-based column of the table + * @return the {@code Accessible} at the specified row and column */ public Accessible getAccessibleAt(int r, int c); /** - * Returns the number of rows occupied by the Accessible at - * a specified row and column in the table. + * Returns the number of rows occupied by the {@code Accessible} at a + * specified row and column in the table. * - * @param r zero-based row of the table - * @param c zero-based column of the table - * @return the number of rows occupied by the Accessible at a - * given specified (row, column) + * @param r zero-based row of the table + * @param c zero-based column of the table + * @return the number of rows occupied by the {@code Accessible} at a given + * specified (row, column) */ public int getAccessibleRowExtentAt(int r, int c); /** - * Returns the number of columns occupied by the Accessible at - * a specified row and column in the table. + * Returns the number of columns occupied by the {@code Accessible} at a + * specified row and column in the table. * - * @param r zero-based row of the table - * @param c zero-based column of the table - * @return the number of columns occupied by the Accessible at a - * given specified row and column + * @param r zero-based row of the table + * @param c zero-based column of the table + * @return the number of columns occupied by the {@code Accessible} at a + * given specified row and column */ public int getAccessibleColumnExtentAt(int r, int c); /** - * Returns the row headers as an AccessibleTable. + * Returns the row headers as an {@code AccessibleTable}. * - * @return an AccessibleTable representing the row - * headers + * @return an {@code AccessibleTable} representing the row headers */ public AccessibleTable getAccessibleRowHeader(); /** * Sets the row headers. * - * @param table an AccessibleTable representing the - * row headers + * @param table an {@code AccessibleTable} representing the row headers */ public void setAccessibleRowHeader(AccessibleTable table); /** - * Returns the column headers as an AccessibleTable. + * Returns the column headers as an {@code AccessibleTable}. * - * @return an AccessibleTable representing the column - * headers + * @return an {@code AccessibleTable} representing the column headers */ public AccessibleTable getAccessibleColumnHeader(); /** * Sets the column headers. * - * @param table an AccessibleTable representing the - * column headers + * @param table an {@code AccessibleTable} representing the column headers */ public void setAccessibleColumnHeader(AccessibleTable table); /** * Returns the description of the specified row in the table. * - * @param r zero-based row of the table + * @param r zero-based row of the table * @return the description of the row */ public Accessible getAccessibleRowDescription(int r); @@ -151,15 +147,15 @@ /** * Sets the description text of the specified row of the table. * - * @param r zero-based row of the table - * @param a the description of the row + * @param r zero-based row of the table + * @param a the description of the row */ public void setAccessibleRowDescription(int r, Accessible a); /** * Returns the description text of the specified column in the table. * - * @param c zero-based column of the table + * @param c zero-based column of the table * @return the text description of the column */ public Accessible getAccessibleColumnDescription(int c); @@ -167,56 +163,54 @@ /** * Sets the description text of the specified column in the table. * - * @param c zero-based column of the table - * @param a the text description of the column + * @param c zero-based column of the table + * @param a the text description of the column */ public void setAccessibleColumnDescription(int c, Accessible a); /** - * Returns a boolean value indicating whether the accessible at - * a specified row and column is selected. + * Returns a boolean value indicating whether the accessible at a specified + * row and column is selected. * - * @param r zero-based row of the table - * @param c zero-based column of the table - * @return the boolean value true if the accessible at the - * row and column is selected. Otherwise, the boolean value - * false + * @param r zero-based row of the table + * @param c zero-based column of the table + * @return the boolean value {@code true} if the accessible at the row and + * column is selected. Otherwise, the boolean value {@code false} */ public boolean isAccessibleSelected(int r, int c); /** - * Returns a boolean value indicating whether the specified row - * is selected. + * Returns a boolean value indicating whether the specified row is selected. * - * @param r zero-based row of the table - * @return the boolean value true if the specified row is selected. - * Otherwise, false. + * @param r zero-based row of the table + * @return the boolean value {@code true} if the specified row is selected. + * Otherwise, {@code false}. */ public boolean isAccessibleRowSelected(int r); /** - * Returns a boolean value indicating whether the specified column - * is selected. + * Returns a boolean value indicating whether the specified column is + * selected. * - * @param c zero-based column of the table - * @return the boolean value true if the specified column is selected. - * Otherwise, false. + * @param c zero-based column of the table + * @return the boolean value {@code true} if the specified column is + * selected. Otherwise, {@code false}. */ public boolean isAccessibleColumnSelected(int c); /** * Returns the selected rows in a table. * - * @return an array of selected rows where each element is a - * zero-based row of the table + * @return an array of selected rows where each element is a zero-based row + * of the table */ - public int [] getSelectedAccessibleRows(); + public int[] getSelectedAccessibleRows(); /** * Returns the selected columns in a table. * - * @return an array of selected columns where each element is a - * zero-based column of the table + * @return an array of selected columns where each element is a zero-based + * column of the table */ - public int [] getSelectedAccessibleColumns(); + public int[] getSelectedAccessibleColumns(); } diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleTableModelChange.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleTableModelChange.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleTableModelChange.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,31 +26,30 @@ package javax.accessibility; /** - * The AccessibleTableModelChange interface describes a change to - * the table model. The attributes of the model change can be - * obtained by the following methods: + * The {@code AccessibleTableModelChange} interface describes a change to the + * table model. The attributes of the model change can be obtained by the + * following methods: *

    * The model change type returned by getType() will be one of: * - * The affected area of the table can be determined by the other - * four methods which specify ranges of rows and columns + * The affected area of the table can be determined by the other four methods + * which specify ranges of rows and columns * + * @author Lynn Monsanto * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleContext#getAccessibleTable - * - * @author Lynn Monsanto * @since 1.3 */ public interface AccessibleTableModelChange { @@ -71,34 +70,39 @@ public static final int DELETE = -1; /** - * Returns the type of event. - * @return the type of event - * @see #INSERT - * @see #UPDATE - * @see #DELETE + * Returns the type of event. + * + * @return the type of event + * @see #INSERT + * @see #UPDATE + * @see #DELETE */ public int getType(); /** * Returns the first row that changed. + * * @return the first row that changed */ public int getFirstRow(); /** * Returns the last row that changed. + * * @return the last row that changed */ public int getLastRow(); /** * Returns the first column that changed. + * * @return the first column that changed */ public int getFirstColumn(); /** * Returns the last column that changed. + * * @return the last column that changed */ public int getLastColumn(); diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleText.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleText.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleText.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,29 +25,27 @@ package javax.accessibility; +import java.awt.Point; +import java.awt.Rectangle; -import java.util.*; -import java.awt.*; -import javax.swing.text.*; - +import javax.swing.text.AttributeSet; /** - *

    The AccessibleText interface should be implemented by all - * classes that present textual information on the display. This interface - * provides the standard mechanism for an assistive technology to access - * that text via its content, attributes, and spatial location. - * Applications can determine if an object supports the AccessibleText - * interface by first obtaining its AccessibleContext (see {@link Accessible}) - * and then calling the {@link AccessibleContext#getAccessibleText} method of - * AccessibleContext. If the return value is not null, the object supports this - * interface. + * The {@code AccessibleText} interface should be implemented by all classes + * that present textual information on the display. This interface provides the + * standard mechanism for an assistive technology to access that text via its + * content, attributes, and spatial location. Applications can determine if an + * object supports the {@code AccessibleText} interface by first obtaining its + * {@code AccessibleContext} (see {@link Accessible}) and then calling the + * {@link AccessibleContext#getAccessibleText} method of + * {@code AccessibleContext}. If the return value is not {@code null}, the + * object supports this interface. * + * @author Peter Korn * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleContext#getAccessibleText - * - * @author Peter Korn */ public interface AccessibleText { @@ -74,13 +72,13 @@ /** * Constant used to indicate that the part of the text that should be * retrieved is a sentence. - * - * A sentence is a string of words which expresses an assertion, - * a question, a command, a wish, an exclamation, or the performance - * of an action. In English locales, the string usually begins with - * a capital letter and concludes with appropriate end punctuation; - * such as a period, question or exclamation mark. Other locales may - * use different capitalization and/or punctuation. + *

    + * A sentence is a string of words which expresses an assertion, a question, + * a command, a wish, an exclamation, or the performance of an action. In + * English locales, the string usually begins with a capital letter and + * concludes with appropriate end punctuation; such as a period, question or + * exclamation mark. Other locales may use different capitalization and/or + * punctuation. * * @see #getAtIndex * @see #getAfterIndex @@ -89,29 +87,29 @@ public static final int SENTENCE = 3; /** - * Given a point in local coordinates, return the zero-based index - * of the character under that Point. If the point is invalid, - * this method returns -1. + * Given a point in local coordinates, return the zero-based index of the + * character under that point. If the point is invalid, this method returns + * -1. * - * @param p the Point in local coordinates - * @return the zero-based index of the character under Point p; if - * Point is invalid return -1. + * @param p the point in local coordinates + * @return the zero-based index of the character under {@code Point p}; if + * point is invalid return -1. */ public int getIndexAtPoint(Point p); /** - * Determines the bounding box of the character at the given - * index into the string. The bounds are returned in local - * coordinates. If the index is invalid an empty rectangle is returned. + * Determines the bounding box of the character at the given index into the + * string. The bounds are returned in local coordinates. If the index is + * invalid an empty rectangle is returned. * - * @param i the index into the String - * @return the screen coordinates of the character's bounding box, - * if index is invalid return an empty rectangle. + * @param i the index into the string + * @return the screen coordinates of the character's bounding box, if index + * is invalid return an empty rectangle. */ public Rectangle getCharacterBounds(int i); /** - * Returns the number of characters (valid indicies) + * Returns the number of characters (valid indicies). * * @return the number of characters */ @@ -119,61 +117,62 @@ /** * Returns the zero-based offset of the caret. + *

    + * Note: That to the right of the caret will have the same index value as + * the offset (the caret is between two characters). * - * Note: That to the right of the caret will have the same index - * value as the offset (the caret is between two characters). - * @return the zero-based offset of the caret. + * @return the zero-based offset of the caret */ public int getCaretPosition(); /** - * Returns the String at a given index. + * Returns the {@code String} at a given index. * - * @param part the CHARACTER, WORD, or SENTENCE to retrieve - * @param index an index within the text + * @param part the CHARACTER, WORD, or SENTENCE to retrieve + * @param index an index within the text * @return the letter, word, or sentence */ public String getAtIndex(int part, int index); /** - * Returns the String after a given index. + * Returns the {@code String} after a given index. * - * @param part the CHARACTER, WORD, or SENTENCE to retrieve - * @param index an index within the text + * @param part the CHARACTER, WORD, or SENTENCE to retrieve + * @param index an index within the text * @return the letter, word, or sentence */ public String getAfterIndex(int part, int index); /** - * Returns the String before a given index. + * Returns the {@code String} before a given index. * - * @param part the CHARACTER, WORD, or SENTENCE to retrieve - * @param index an index within the text + * @param part the CHARACTER, WORD, or SENTENCE to retrieve + * @param index an index within the text * @return the letter, word, or sentence */ public String getBeforeIndex(int part, int index); /** - * Returns the AttributeSet for a given character at a given index + * Returns the {@code AttributeSet} for a given character at a given index. * - * @param i the zero-based index into the text - * @return the AttributeSet of the character + * @param i the zero-based index into the text + * @return the {@code AttributeSet} of the character */ public AttributeSet getCharacterAttribute(int i); /** - * Returns the start offset within the selected text. - * If there is no selection, but there is - * a caret, the start and end offsets will be the same. + * Returns the start offset within the selected text. If there is no + * selection, but there is a caret, the start and end offsets will be the + * same. * * @return the index into the text of the start of the selection */ public int getSelectionStart(); /** - * Returns the end offset within the selected text. - * If there is no selection, but there is - * a caret, the start and end offsets will be the same. + * Returns the end offset within the selected text. If there is no + * selection, but there is a caret, the start and end offsets will be the + * same. * * @return the index into the text of the end of the selection */ @@ -182,7 +181,7 @@ /** * Returns the portion of the text that is selected. * - * @return the String portion of the text that is selected + * @return the {@code String} portion of the text that is selected */ public String getSelectedText(); } diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleTextSequence.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleTextSequence.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleTextSequence.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,50 +22,41 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package javax.accessibility; - /** - *

    The AccessibleTextSequence provides information about - * a contiguous sequence of text. - * - * @see Accessible - * @see Accessible#getAccessibleContext - * @see AccessibleContext - * @see AccessibleContext#getAccessibleText - * @see AccessibleAttributeSequence + * This class collects together key details of a span of text. It is used by + * implementors of the class {@code AccessibleExtendedText} in order to return + * the requested triplet of a {@code String}, and the start and end + * indicies/offsets into a larger body of text that the {@code String} comes + * from. * - * @author Lynn Monsanto - */ - -/** - * This class collects together key details of a span of text. It - * is used by implementors of the class {@code AccessibleExtendedText} in - * order to return the requested triplet of a {@code String}, and the - * start and end indicies/offsets into a larger body of text that the - * {@code String} comes from. - * - * @see javax.accessibility.AccessibleExtendedText + * @see AccessibleExtendedText */ public class AccessibleTextSequence { - /** The start index of the text sequence */ + /** + * The start index of the text sequence. + */ public int startIndex; - /** The end index of the text sequence */ + /** + * The end index of the text sequence. + */ public int endIndex; - /** The text */ + /** + * The text. + */ public String text; /** - * Constructs an {@code AccessibleTextSequence} with the given - * parameters. + * Constructs an {@code AccessibleTextSequence} with the given parameters. * - * @param start the beginning index of the span of text - * @param end the ending index of the span of text - * @param txt the {@code String} shared by this text span - * + * @param start the beginning index of the span of text + * @param end the ending index of the span of text + * @param txt the {@code String} shared by this text span * @since 1.6 */ public AccessibleTextSequence(int start, int end, String txt) { diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/AccessibleValue.java --- a/src/java.desktop/share/classes/javax/accessibility/AccessibleValue.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/AccessibleValue.java Tue Jun 13 02:27:01 2017 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,31 +26,28 @@ package javax.accessibility; /** - * The AccessibleValue interface should be supported by any object - * that supports a numerical value (e.g., a scroll bar). This interface - * provides the standard mechanism for an assistive technology to determine - * and set the numerical value as well as get the minimum and maximum values. - * Applications can determine - * if an object supports the AccessibleValue interface by first - * obtaining its AccessibleContext (see - * {@link Accessible}) and then calling the - * {@link AccessibleContext#getAccessibleValue} method. - * If the return value is not null, the object supports this interface. + * The {@code AccessibleValue} interface should be supported by any object that + * supports a numerical value (e.g., a scroll bar). This interface provides the + * standard mechanism for an assistive technology to determine and set the + * numerical value as well as get the minimum and maximum values. Applications + * can determine if an object supports the {@code AccessibleValue} interface by + * first obtaining its {@code AccessibleContext} (see {@link Accessible}) and + * then calling the {@link AccessibleContext#getAccessibleValue} method. If the + * return value is not {@code null}, the object supports this interface. * + * @author Peter Korn + * @author Hans Muller + * @author Willie Walker * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleContext#getAccessibleValue - * - * @author Peter Korn - * @author Hans Muller - * @author Willie Walker */ public interface AccessibleValue { /** - * Get the value of this object as a Number. If the value has not been - * set, the return value will be null. + * Get the value of this object as a {@code Number}. If the value has not + * been set, the return value will be {@code null}. * * @return value of the object * @see #setCurrentAccessibleValue @@ -58,35 +55,35 @@ public Number getCurrentAccessibleValue(); /** - * Set the value of this object as a Number. + * Set the value of this object as a {@code Number}. * - * @param n the number to use for the value - * @return True if the value was set; else False + * @param n the number to use for the value + * @return {@code true} if the value was set; else {@code false} * @see #getCurrentAccessibleValue */ public boolean setCurrentAccessibleValue(Number n); -// /** -// * Get the description of the value of this object. -// * -// * @return description of the value of the object -// */ -// public String getAccessibleValueDescription(); + // /** + // * Get the description of the value of this object. + // * + // * @return description of the value of the object + // */ + // public String getAccessibleValueDescription(); /** - * Get the minimum value of this object as a Number. + * Get the minimum value of this object as a {@code Number}. * - * @return Minimum value of the object; null if this object does not - * have a minimum value + * @return minimum value of the object; {@code null} if this object does not + * have a minimum value * @see #getMaximumAccessibleValue */ public Number getMinimumAccessibleValue(); /** - * Get the maximum value of this object as a Number. + * Get the maximum value of this object as a {@code Number}. * - * @return Maximum value of the object; null if this object does not - * have a maximum value + * @return maximum value of the object; {@code null} if this object does not + * have a maximum value * @see #getMinimumAccessibleValue */ public Number getMaximumAccessibleValue(); diff -r 6e591955c8a8 -r 415b0831244f src/java.desktop/share/classes/javax/accessibility/package-info.java --- a/src/java.desktop/share/classes/javax/accessibility/package-info.java Thu Jun 08 22:07:08 2017 -0700 +++ b/src/java.desktop/share/classes/javax/accessibility/package-info.java Tue Jun 13 02:27:01 2017 +0300 @@ -57,7 +57,7 @@ * accessible name, description, role, and * state of the object, as well as information * about the parent and children of the object.  In addition, - * JavaBeans™ property change support is also included to allow assisitive + * JavaBeans™ property change support is also included to allow assistive * technologies learn when the values of the accessible properties change. * AccessibleContext also contains methods for obtaining more specific * accessibility information about a component. If the component supports it, @@ -175,7 +175,7 @@ * Accessible) and then calling the * {@code getAccessibleAction} method of * AccessibleContext. If the return value is - * not null, the object supports this interface. + * not {@code null}, the object supports this interface. * *

    * Interface AccessibleComponent

    @@ -188,7 +188,7 @@ * Accessible) and then calling the * {@code getAccessibleComponent} method of * AccessibleContext. If the return value is - * not null, the object supports this interface. + * not {@code null}, the object supports this interface. * *

    * Interface AccessibleSelection

    @@ -204,7 +204,7 @@ * Accessible) and then calling the * {@code getAccessibleSelection} method of * AccessibleContext. If the return value is - * not null, the object supports this interface. + * not {@code null}, the object supports this interface. * *

    Interface * AccessibleText

    @@ -228,7 +228,7 @@ * (see Accessible) and then calling the * {@code getAccessibleText} method of * AccessibleContext. If the return value is - * not null, the object supports this interface. + * not {@code null}, the object supports this interface. * *

    * Interface AccessibleHypertext

    @@ -268,7 +268,7 @@ * Accessible) and then calling the * {@code getAccessibleValue} method of * AccessibleContext. If the return value is - * not null, the object supports this interface. + * not {@code null}, the object supports this interface. * * @since 1.2 */