feat(jdk8): move files to new folder to avoid resources compiled.
This commit is contained in:
51
jdkSrc/jdk8/javax/accessibility/Accessible.java
Normal file
51
jdkSrc/jdk8/javax/accessibility/Accessible.java
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
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}.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
public AccessibleContext getAccessibleContext();
|
||||
}
|
||||
113
jdkSrc/jdk8/javax/accessibility/AccessibleAction.java
Normal file
113
jdkSrc/jdk8/javax/accessibility/AccessibleAction.java
Normal file
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
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.
|
||||
*
|
||||
* @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.
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final String TOGGLE_EXPAND =
|
||||
new String ("toggleexpand");
|
||||
|
||||
/**
|
||||
* An action which increments a value.
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final String INCREMENT =
|
||||
new String ("increment");
|
||||
|
||||
|
||||
/**
|
||||
* An action which decrements a value.
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final String DECREMENT =
|
||||
new String ("decrement");
|
||||
|
||||
/**
|
||||
* An action which causes a component to execute its default action.
|
||||
* @since 1.6
|
||||
*/
|
||||
public static final String CLICK = new String("click");
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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
|
||||
* @see #getAccessibleActionCount
|
||||
*/
|
||||
public String getAccessibleActionDescription(int i);
|
||||
|
||||
/**
|
||||
* 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 boolean doAccessibleAction(int i);
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2005, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.accessibility;
|
||||
|
||||
import javax.swing.text.AttributeSet;
|
||||
|
||||
|
||||
/**
|
||||
* <P>The AccessibleAttributeSequence provides information about
|
||||
* a contiguous sequence of text attributes
|
||||
*
|
||||
* @see Accessible
|
||||
* @see Accessible#getAccessibleContext
|
||||
* @see AccessibleContext
|
||||
* @see AccessibleContext#getAccessibleText
|
||||
* @see AccessibleTextSequence
|
||||
*
|
||||
* @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</code> in
|
||||
* order to generate <code>ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED</code> events.
|
||||
*
|
||||
* @see javax.accessibility.AccessibleContext
|
||||
* @see javax.accessibility.AccessibleContext#ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED
|
||||
*/
|
||||
public class AccessibleAttributeSequence {
|
||||
/** The start index of the text sequence */
|
||||
public int startIndex;
|
||||
|
||||
/** The end index of the text sequence */
|
||||
public int endIndex;
|
||||
|
||||
/** The text attributes */
|
||||
public AttributeSet attributes;
|
||||
|
||||
/**
|
||||
* Constructs an <code>AccessibleAttributeSequence</code> 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</code> shared by this text span
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public AccessibleAttributeSequence(int start, int end, AttributeSet attr) {
|
||||
startIndex = start;
|
||||
endIndex = end;
|
||||
attributes = attr;
|
||||
}
|
||||
|
||||
};
|
||||
158
jdkSrc/jdk8/javax/accessibility/AccessibleBundle.java
Normal file
158
jdkSrc/jdk8/javax/accessibility/AccessibleBundle.java
Normal file
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.accessibility;
|
||||
|
||||
import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
import java.util.Locale;
|
||||
import java.util.MissingResourceException;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
/**
|
||||
* <p>Base class used to maintain a strongly typed enumeration. This is
|
||||
* the superclass of {@link AccessibleState} and {@link AccessibleRole}.
|
||||
* <p>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
|
||||
* readable by humans.
|
||||
*
|
||||
* @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";
|
||||
|
||||
/**
|
||||
* Construct an {@code AccessibleBundle}.
|
||||
*/
|
||||
public AccessibleBundle() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* 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.
|
||||
*/
|
||||
protected String toDisplayString(String resourceBundleName,
|
||||
Locale locale) {
|
||||
|
||||
// loads the resource bundle if necessary
|
||||
loadResourceBundle(resourceBundleName, locale);
|
||||
|
||||
// returns the localized string
|
||||
Object o = table.get(locale);
|
||||
if (o != null && o instanceof Hashtable) {
|
||||
Hashtable resourceTable = (Hashtable) o;
|
||||
o = resourceTable.get(key);
|
||||
|
||||
if (o != null && o instanceof String) {
|
||||
return (String)o;
|
||||
}
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public String toDisplayString(Locale locale) {
|
||||
return toDisplayString(defaultResourceBundleName, locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets localized string describing the key using the default locale.
|
||||
* @return a localized String describing the key for the default locale
|
||||
*/
|
||||
public String toDisplayString() {
|
||||
return toDisplayString(Locale.getDefault());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets 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,
|
||||
Locale locale) {
|
||||
if (! table.contains(locale)) {
|
||||
|
||||
try {
|
||||
Hashtable resourceTable = new Hashtable();
|
||||
|
||||
ResourceBundle bundle = ResourceBundle.getBundle(resourceBundleName, locale);
|
||||
|
||||
Enumeration iter = bundle.getKeys();
|
||||
while(iter.hasMoreElements()) {
|
||||
String key = (String)iter.nextElement();
|
||||
resourceTable.put(key, bundle.getObject(key));
|
||||
}
|
||||
|
||||
table.put(locale, resourceTable);
|
||||
}
|
||||
catch (MissingResourceException e) {
|
||||
System.err.println("loadResourceBundle: " + e);
|
||||
// Just return so toDisplayString() returns the
|
||||
// non-localized key.
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
315
jdkSrc/jdk8/javax/accessibility/AccessibleComponent.java
Normal file
315
jdkSrc/jdk8/javax/accessibility/AccessibleComponent.java
Normal file
@@ -0,0 +1,315 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2003, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.accessibility;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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
|
||||
* @see #setBackground
|
||||
*/
|
||||
public Color getBackground();
|
||||
|
||||
/**
|
||||
* Sets the background color of this object.
|
||||
*
|
||||
* @param c the new Color for the background
|
||||
* @see #setBackground
|
||||
*/
|
||||
public void setBackground(Color c);
|
||||
|
||||
/**
|
||||
* Gets the foreground color of this object.
|
||||
*
|
||||
* @return the foreground color, if supported, of the object;
|
||||
* otherwise, null
|
||||
* @see #setForeground
|
||||
*/
|
||||
public Color getForeground();
|
||||
|
||||
/**
|
||||
* Sets the foreground color of this object.
|
||||
*
|
||||
* @param c the new Color for the foreground
|
||||
* @see #getForeground
|
||||
*/
|
||||
public void setForeground(Color c);
|
||||
|
||||
/**
|
||||
* Gets the Cursor of this object.
|
||||
*
|
||||
* @return the Cursor, if supported, of the object; otherwise, null
|
||||
* @see #setCursor
|
||||
*/
|
||||
public Cursor getCursor();
|
||||
|
||||
/**
|
||||
* Sets the Cursor of this object.
|
||||
*
|
||||
* @param cursor the new Cursor for the object
|
||||
* @see #getCursor
|
||||
*/
|
||||
public void setCursor(Cursor cursor);
|
||||
|
||||
/**
|
||||
* Gets the Font of this object.
|
||||
*
|
||||
* @return the Font,if supported, for the object; otherwise, null
|
||||
* @see #setFont
|
||||
*/
|
||||
public Font getFont();
|
||||
|
||||
/**
|
||||
* Sets the Font of this object.
|
||||
*
|
||||
* @param f the new Font for the object
|
||||
* @see #getFont
|
||||
*/
|
||||
public void setFont(Font f);
|
||||
|
||||
/**
|
||||
* Gets the FontMetrics of this object.
|
||||
*
|
||||
* @param f the Font
|
||||
* @return the FontMetrics, if supported, the object; otherwise, 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.
|
||||
*
|
||||
* @return true if object is enabled; otherwise, false
|
||||
* @see #setEnabled
|
||||
* @see AccessibleContext#getAccessibleStateSet
|
||||
* @see AccessibleState#ENABLED
|
||||
* @see AccessibleStateSet
|
||||
*/
|
||||
public boolean isEnabled();
|
||||
|
||||
/**
|
||||
* Sets the enabled state of the object.
|
||||
*
|
||||
* @param b if 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().
|
||||
* <p>Objects that are visible will also have the
|
||||
* AccessibleState.VISIBLE state set in their AccessibleStateSets.
|
||||
*
|
||||
* @return true if object is visible; otherwise, false
|
||||
* @see #setVisible
|
||||
* @see AccessibleContext#getAccessibleStateSet
|
||||
* @see AccessibleState#VISIBLE
|
||||
* @see AccessibleStateSet
|
||||
*/
|
||||
public boolean isVisible();
|
||||
|
||||
/**
|
||||
* Sets the visible state of the object.
|
||||
*
|
||||
* @param b if 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).
|
||||
*
|
||||
* @return true if object is showing; otherwise, 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
|
||||
* 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
|
||||
* @see #getBounds
|
||||
*/
|
||||
public boolean contains(Point p);
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @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.
|
||||
*
|
||||
* @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
|
||||
* @see #getBounds
|
||||
* @see #getLocationOnScreen
|
||||
*/
|
||||
public Point getLocation();
|
||||
|
||||
/**
|
||||
* Sets the location of the object relative to the parent.
|
||||
* @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.
|
||||
*
|
||||
* @return A rectangle indicating this component's bounds; 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.
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* @return A Dimension object that indicates the size of this component;
|
||||
* null if this object is not on the screen
|
||||
* @see #setSize
|
||||
*/
|
||||
public Dimension getSize();
|
||||
|
||||
/**
|
||||
* Resizes this object so that it has width and height.
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* @param p The point relative to the coordinate system of this object.
|
||||
* @return the Accessible, if it exists, at the specified location;
|
||||
* otherwise 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.
|
||||
*
|
||||
* @return true if object can accept focus; otherwise false
|
||||
* @see AccessibleContext#getAccessibleStateSet
|
||||
* @see AccessibleState#FOCUSABLE
|
||||
* @see AccessibleState#FOCUSED
|
||||
* @see AccessibleStateSet
|
||||
*/
|
||||
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.
|
||||
* @see #isFocusTraversable
|
||||
*/
|
||||
public void requestFocus();
|
||||
|
||||
/**
|
||||
* Adds the specified focus listener to receive focus events from this
|
||||
* component.
|
||||
*
|
||||
* @param l the focus listener
|
||||
* @see #removeFocusListener
|
||||
*/
|
||||
public void addFocusListener(FocusListener l);
|
||||
|
||||
/**
|
||||
* Removes the specified focus listener so it no longer receives focus
|
||||
* events from this component.
|
||||
*
|
||||
* @param l the focus listener
|
||||
* @see #addFocusListener
|
||||
*/
|
||||
public void removeFocusListener(FocusListener l);
|
||||
}
|
||||
774
jdkSrc/jdk8/javax/accessibility/AccessibleContext.java
Normal file
774
jdkSrc/jdk8/javax/accessibility/AccessibleContext.java
Normal file
@@ -0,0 +1,774 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.accessibility;
|
||||
|
||||
import sun.awt.AWTAccessor;
|
||||
import sun.awt.AppContext;
|
||||
|
||||
import java.util.Locale;
|
||||
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:
|
||||
* <P><ul>
|
||||
* <li>{@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.
|
||||
* <li>{@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.
|
||||
* <li>{@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.
|
||||
* <li>{@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.
|
||||
* <li>{@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.</ul>
|
||||
*
|
||||
*
|
||||
* @beaninfo
|
||||
* attribute: isContainer false
|
||||
* description: Minimal information that all accessible objects return
|
||||
*
|
||||
|
||||
* @author Peter Korn
|
||||
* @author Hans Muller
|
||||
* @author Willie Walker
|
||||
* @author Lynn Monsanto
|
||||
*/
|
||||
public abstract class AccessibleContext {
|
||||
|
||||
/**
|
||||
* The AppContext that should be used to dispatch events for this
|
||||
* AccessibleContext
|
||||
*/
|
||||
private volatile AppContext targetAppContext;
|
||||
|
||||
static {
|
||||
AWTAccessor.setAccessibleContextAccessor(new AWTAccessor.AccessibleContextAccessor() {
|
||||
@Override
|
||||
public void setAppContext(AccessibleContext accessibleContext, AppContext appContext) {
|
||||
accessibleContext.targetAppContext = appContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppContext getAppContext(AccessibleContext accessibleContext) {
|
||||
return accessibleContext.targetAppContext;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 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 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 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 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.
|
||||
* @see Accessible
|
||||
* @see AccessibleTable
|
||||
*/
|
||||
public static final String ACCESSIBLE_TABLE_CAPTION_CHANGED =
|
||||
"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.
|
||||
* @see Accessible
|
||||
* @see AccessibleTable
|
||||
*/
|
||||
public static final String ACCESSIBLE_TABLE_SUMMARY_CHANGED =
|
||||
"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.
|
||||
* @see AccessibleTable
|
||||
* @see AccessibleTableModelChange
|
||||
*/
|
||||
public static final String ACCESSIBLE_TABLE_MODEL_CHANGED =
|
||||
"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.
|
||||
* @see AccessibleTable
|
||||
* @see AccessibleTableModelChange
|
||||
*/
|
||||
public static final String ACCESSIBLE_TABLE_ROW_HEADER_CHANGED =
|
||||
"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.
|
||||
* @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.
|
||||
* @see AccessibleTable
|
||||
* @see AccessibleTableModelChange
|
||||
*/
|
||||
public static final String ACCESSIBLE_TABLE_COLUMN_HEADER_CHANGED =
|
||||
"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.
|
||||
* @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.
|
||||
* @see AccessibleAction
|
||||
*/
|
||||
public static final String ACCESSIBLE_ACTION_PROPERTY =
|
||||
"accessibleActionProperty";
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @see AccessibleHyperlink
|
||||
*/
|
||||
public static final String ACCESSIBLE_HYPERTEXT_OFFSET =
|
||||
"AccessibleHypertextOffset";
|
||||
|
||||
/**
|
||||
* PropertyChangeEvent which indicates that text has changed.
|
||||
* <br>
|
||||
* For text insertion, the oldValue is null and the newValue
|
||||
* is an AccessibleTextSequence specifying the text that was
|
||||
* inserted.
|
||||
* <br>
|
||||
* For text deletion, the oldValue is an AccessibleTextSequence
|
||||
* specifying the text that was deleted and the newValue is null.
|
||||
* <br>
|
||||
* For text replacement, the oldValue is an AccessibleTextSequence
|
||||
* specifying the old text and the newValue is an AccessibleTextSequence
|
||||
* specifying the new text.
|
||||
*
|
||||
* @see #getAccessibleText
|
||||
* @see #addPropertyChangeListener
|
||||
* @see AccessibleTextSequence
|
||||
*/
|
||||
public static final String ACCESSIBLE_TEXT_PROPERTY
|
||||
= "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.
|
||||
*
|
||||
* @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.
|
||||
* <br>
|
||||
* For attribute insertion, the oldValue is null and the newValue
|
||||
* is an AccessibleAttributeSequence specifying the attributes that were
|
||||
* inserted.
|
||||
* <br>
|
||||
* For attribute deletion, the oldValue is an AccessibleAttributeSequence
|
||||
* specifying the attributes that were deleted and the newValue is null.
|
||||
* <br>
|
||||
* For attribute replacement, the oldValue is an AccessibleAttributeSequence
|
||||
* specifying the old attributes and the newValue is an
|
||||
* 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.
|
||||
*
|
||||
* @see #addPropertyChangeListener
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final String ACCESSIBLE_COMPONENT_BOUNDS_CHANGED =
|
||||
"accessibleComponentBoundsChanged";
|
||||
|
||||
/**
|
||||
* The accessible parent of this object.
|
||||
*
|
||||
* @see #getAccessibleParent
|
||||
* @see #setAccessibleParent
|
||||
*/
|
||||
protected Accessible accessibleParent = null;
|
||||
|
||||
/**
|
||||
* A localized String containing the name of the object.
|
||||
*
|
||||
* @see #getAccessibleName
|
||||
* @see #setAccessibleName
|
||||
*/
|
||||
protected String accessibleName = null;
|
||||
|
||||
/**
|
||||
* A localized String containing the description of the object.
|
||||
*
|
||||
* @see #getAccessibleDescription
|
||||
* @see #setAccessibleDescription
|
||||
*/
|
||||
protected String accessibleDescription = null;
|
||||
|
||||
/**
|
||||
* Used to handle the listener list for property change events.
|
||||
*
|
||||
* @see #addPropertyChangeListener
|
||||
* @see #removePropertyChangeListener
|
||||
* @see #firePropertyChangeListener
|
||||
*/
|
||||
private PropertyChangeSupport accessibleChangeSupport = null;
|
||||
|
||||
/**
|
||||
* Used to represent the context's relation set
|
||||
* @see #getAccessibleRelationSet
|
||||
*/
|
||||
private AccessibleRelationSet relationSet
|
||||
= new AccessibleRelationSet();
|
||||
|
||||
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.'
|
||||
*
|
||||
* @return the localized name of the object; null if this
|
||||
* object does not have a name
|
||||
*
|
||||
* @see #setAccessibleName
|
||||
*/
|
||||
public String getAccessibleName() {
|
||||
return accessibleName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the localized accessible name of this object. Changing the
|
||||
* name will cause a PropertyChangeEvent to be fired for the
|
||||
* ACCESSIBLE_NAME_PROPERTY property.
|
||||
*
|
||||
* @param s the new localized name of the object.
|
||||
*
|
||||
* @see #getAccessibleName
|
||||
* @see #addPropertyChangeListener
|
||||
*
|
||||
* @beaninfo
|
||||
* preferred: true
|
||||
* description: Sets the accessible name for the component.
|
||||
*/
|
||||
public void setAccessibleName(String s) {
|
||||
String oldName = accessibleName;
|
||||
accessibleName = s;
|
||||
firePropertyChange(ACCESSIBLE_NAME_PROPERTY,oldName,accessibleName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* 'Ignore changes and close dialog box.'
|
||||
*
|
||||
* @return the localized description of the object; null if
|
||||
* this object does not have a description
|
||||
*
|
||||
* @see #setAccessibleDescription
|
||||
*/
|
||||
public String getAccessibleDescription() {
|
||||
return accessibleDescription;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the accessible description of this object. Changing the
|
||||
* name will cause a PropertyChangeEvent to be fired for the
|
||||
* ACCESSIBLE_DESCRIPTION_PROPERTY property.
|
||||
*
|
||||
* @param s the new localized description of the object
|
||||
*
|
||||
* @see #setAccessibleName
|
||||
* @see #addPropertyChangeListener
|
||||
*
|
||||
* @beaninfo
|
||||
* preferred: true
|
||||
* description: Sets the accessible description for the component.
|
||||
*/
|
||||
public void setAccessibleDescription(String s) {
|
||||
String oldDescription = accessibleDescription;
|
||||
accessibleDescription = s;
|
||||
firePropertyChange(ACCESSIBLE_DESCRIPTION_PROPERTY,
|
||||
oldDescription,accessibleDescription);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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).
|
||||
* <p>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.
|
||||
*
|
||||
* @return an instance of 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.
|
||||
*
|
||||
* @return an instance of AccessibleStateSet containing the
|
||||
* current state set of the object
|
||||
* @see AccessibleStateSet
|
||||
* @see AccessibleState
|
||||
* @see #addPropertyChangeListener
|
||||
*/
|
||||
public abstract AccessibleStateSet getAccessibleStateSet();
|
||||
|
||||
/**
|
||||
* Gets the Accessible parent of this object.
|
||||
*
|
||||
* @return the Accessible parent of this object; null if this
|
||||
* object does not have an 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.
|
||||
*
|
||||
* @param a - Accessible to be set as the parent
|
||||
*/
|
||||
public void setAccessibleParent(Accessible a) {
|
||||
accessibleParent = a;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @see #getAccessibleParent
|
||||
* @see #getAccessibleChildrenCount
|
||||
* @see #getAccessibleChild
|
||||
*/
|
||||
public abstract int getAccessibleIndexInParent();
|
||||
|
||||
/**
|
||||
* Returns the number of accessible children of the object.
|
||||
*
|
||||
* @return the number of accessible children of the object.
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @param i zero-based index of child
|
||||
* @return the Accessible child of the object
|
||||
* @see #getAccessibleChildrenCount
|
||||
*/
|
||||
public abstract Accessible getAccessibleChild(int i);
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @see #ACCESSIBLE_NAME_PROPERTY
|
||||
* @see #ACCESSIBLE_DESCRIPTION_PROPERTY
|
||||
* @see #ACCESSIBLE_STATE_PROPERTY
|
||||
* @see #ACCESSIBLE_VALUE_PROPERTY
|
||||
* @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) {
|
||||
accessibleChangeSupport = new PropertyChangeSupport(this);
|
||||
}
|
||||
accessibleChangeSupport.addPropertyChangeListener(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a PropertyChangeListener from the listener list.
|
||||
* This removes a PropertyChangeListener that was registered
|
||||
* for all properties.
|
||||
*
|
||||
* @param listener The PropertyChangeListener to be removed
|
||||
*/
|
||||
public void removePropertyChangeListener(PropertyChangeListener listener) {
|
||||
if (accessibleChangeSupport != null) {
|
||||
accessibleChangeSupport.removePropertyChangeListener(listener);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the AccessibleAction associated with this object that supports
|
||||
* one or more actions.
|
||||
*
|
||||
* @return AccessibleAction if supported by object; else return null
|
||||
* @see AccessibleAction
|
||||
*/
|
||||
public AccessibleAction getAccessibleAction() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the AccessibleComponent associated with this object that has a
|
||||
* graphical representation.
|
||||
*
|
||||
* @return AccessibleComponent if supported by object; else return null
|
||||
* @see AccessibleComponent
|
||||
*/
|
||||
public AccessibleComponent getAccessibleComponent() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the AccessibleSelection associated with this object which allows its
|
||||
* Accessible children to be selected.
|
||||
*
|
||||
* @return AccessibleSelection if supported by object; else return null
|
||||
* @see AccessibleSelection
|
||||
*/
|
||||
public AccessibleSelection getAccessibleSelection() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the AccessibleText associated with this object presenting
|
||||
* text on the display.
|
||||
*
|
||||
* @return AccessibleText if supported by object; else return null
|
||||
* @see AccessibleText
|
||||
*/
|
||||
public AccessibleText getAccessibleText() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the AccessibleEditableText associated with this object
|
||||
* presenting editable text on the display.
|
||||
*
|
||||
* @return AccessibleEditableText if supported by object; else return null
|
||||
* @see AccessibleEditableText
|
||||
* @since 1.4
|
||||
*/
|
||||
public AccessibleEditableText getAccessibleEditableText() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the AccessibleValue associated with this object that supports a
|
||||
* Numerical value.
|
||||
*
|
||||
* @return AccessibleValue if supported by object; else return null
|
||||
* @see AccessibleValue
|
||||
*/
|
||||
public AccessibleValue getAccessibleValue() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the AccessibleIcons associated with an object that has
|
||||
* one or more associated icons
|
||||
*
|
||||
* @return an array of AccessibleIcon if supported by object;
|
||||
* otherwise return null
|
||||
* @see AccessibleIcon
|
||||
* @since 1.3
|
||||
*/
|
||||
public AccessibleIcon [] getAccessibleIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the AccessibleRelationSet associated with an object
|
||||
*
|
||||
* @return an AccessibleRelationSet if supported by object;
|
||||
* otherwise return null
|
||||
* @see AccessibleRelationSet
|
||||
* @since 1.3
|
||||
*/
|
||||
public AccessibleRelationSet getAccessibleRelationSet() {
|
||||
return relationSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the AccessibleTable associated with an object
|
||||
*
|
||||
* @return an AccessibleTable if supported by object;
|
||||
* otherwise return null
|
||||
* @see AccessibleTable
|
||||
* @since 1.3
|
||||
*/
|
||||
public AccessibleTable getAccessibleTable() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @see #addPropertyChangeListener
|
||||
* @see #removePropertyChangeListener
|
||||
* @see #ACCESSIBLE_NAME_PROPERTY
|
||||
* @see #ACCESSIBLE_DESCRIPTION_PROPERTY
|
||||
* @see #ACCESSIBLE_STATE_PROPERTY
|
||||
* @see #ACCESSIBLE_VALUE_PROPERTY
|
||||
* @see #ACCESSIBLE_SELECTION_PROPERTY
|
||||
* @see #ACCESSIBLE_TEXT_PROPERTY
|
||||
* @see #ACCESSIBLE_VISIBLE_DATA_PROPERTY
|
||||
*/
|
||||
public void firePropertyChange(String propertyName,
|
||||
Object oldValue,
|
||||
Object newValue) {
|
||||
if (accessibleChangeSupport != null) {
|
||||
if (newValue instanceof PropertyChangeEvent) {
|
||||
PropertyChangeEvent pce = (PropertyChangeEvent)newValue;
|
||||
accessibleChangeSupport.firePropertyChange(pce);
|
||||
} else {
|
||||
accessibleChangeSupport.firePropertyChange(propertyName,
|
||||
oldValue,
|
||||
newValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
133
jdkSrc/jdk8/javax/accessibility/AccessibleEditableText.java
Normal file
133
jdkSrc/jdk8/javax/accessibility/AccessibleEditableText.java
Normal file
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2006, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.accessibility;
|
||||
|
||||
import java.util.*;
|
||||
import java.awt.*;
|
||||
import javax.swing.text.*;
|
||||
|
||||
/**
|
||||
* <P>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.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
public void setTextContents(String s);
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
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
|
||||
* @return the text string between the indices
|
||||
*/
|
||||
public String getTextRange(int startIndex, int endIndex);
|
||||
|
||||
/**
|
||||
* Deletes the text between two indices
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
public void cut(int startIndex, int endIndex);
|
||||
|
||||
/**
|
||||
* Pastes the text from the system clipboard into the text
|
||||
* starting at the specified index.
|
||||
*
|
||||
* @param startIndex the starting index in the text
|
||||
*/
|
||||
public void paste(int startIndex);
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
* @see AttributeSet
|
||||
*/
|
||||
public void setAttributes(int startIndex, int endIndex, AttributeSet as);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2006, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
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.
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @return the tool tip text, if supported, of the object;
|
||||
* otherwise, null
|
||||
*/
|
||||
public String getToolTipText();
|
||||
|
||||
/**
|
||||
* Returns the titled border text
|
||||
*
|
||||
* @return the titled border text, if supported, of the object;
|
||||
* otherwise, null
|
||||
*/
|
||||
public String getTitledBorderText();
|
||||
|
||||
/**
|
||||
* Returns key bindings associated with this object
|
||||
*
|
||||
* @return the key bindings, if supported, of the object;
|
||||
* otherwise, null
|
||||
* @see AccessibleKeyBinding
|
||||
*/
|
||||
public AccessibleKeyBinding getAccessibleKeyBinding();
|
||||
}
|
||||
73
jdkSrc/jdk8/javax/accessibility/AccessibleExtendedTable.java
Normal file
73
jdkSrc/jdk8/javax/accessibility/AccessibleExtendedTable.java
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2013, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* 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
|
||||
*/
|
||||
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 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);
|
||||
}
|
||||
142
jdkSrc/jdk8/javax/accessibility/AccessibleExtendedText.java
Normal file
142
jdkSrc/jdk8/javax/accessibility/AccessibleExtendedText.java
Normal file
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2006, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.accessibility;
|
||||
|
||||
|
||||
import java.util.*;
|
||||
import java.awt.*;
|
||||
import javax.swing.text.*;
|
||||
|
||||
|
||||
/**
|
||||
* <P>The AccessibleExtendedText interface contains additional methods
|
||||
* not provided by the AccessibleText 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.
|
||||
*
|
||||
* @see Accessible
|
||||
* @see Accessible#getAccessibleContext
|
||||
* @see AccessibleContext
|
||||
* @see AccessibleContext#getAccessibleText
|
||||
*
|
||||
* @author Peter Korn
|
||||
* @author Lynn Monsanto
|
||||
* @since 1.5
|
||||
*/
|
||||
public interface AccessibleExtendedText {
|
||||
|
||||
/**
|
||||
* Constant used to indicate that the part of the text that should be
|
||||
* retrieved is a line of text.
|
||||
*
|
||||
* @see AccessibleText#getAtIndex
|
||||
* @see AccessibleText#getAfterIndex
|
||||
* @see AccessibleText#getBeforeIndex
|
||||
*/
|
||||
public static final int LINE = 4; // BugID: 4849720
|
||||
|
||||
/**
|
||||
* Constant used to indicate that the part of the text that should be
|
||||
* retrieved is contiguous text with the same text attributes.
|
||||
*
|
||||
* @see AccessibleText#getAtIndex
|
||||
* @see AccessibleText#getAfterIndex
|
||||
* @see AccessibleText#getBeforeIndex
|
||||
*/
|
||||
public static final int ATTRIBUTE_RUN = 5; // BugID: 4849720
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public String getTextRange(int startIndex, int endIndex);
|
||||
|
||||
/**
|
||||
* Returns the <code>AccessibleTextSequence</code> at a given index.
|
||||
*
|
||||
* @param part the <code>CHARACTER</code>, <code>WORD</code>,
|
||||
* <code>SENTENCE</code>, <code>LINE</code> or <code>ATTRIBUTE_RUN</code>
|
||||
* to retrieve
|
||||
* @param index an index within the text
|
||||
* @return an <code>AccessibleTextSequence</code> specifying the text
|
||||
* if part and index are valid. Otherwise, null is returned.
|
||||
*
|
||||
* @see AccessibleText#CHARACTER
|
||||
* @see AccessibleText#WORD
|
||||
* @see AccessibleText#SENTENCE
|
||||
*/
|
||||
public AccessibleTextSequence getTextSequenceAt(int part, int index);
|
||||
|
||||
/**
|
||||
* Returns the <code>AccessibleTextSequence</code> after a given index.
|
||||
*
|
||||
* @param part the <code>CHARACTER</code>, <code>WORD</code>,
|
||||
* <code>SENTENCE</code>, <code>LINE</code> or <code>ATTRIBUTE_RUN</code>
|
||||
* to retrieve
|
||||
* @param index an index within the text
|
||||
* @return an <code>AccessibleTextSequence</code> specifying the text
|
||||
* if part and index are valid. Otherwise, null is returned.
|
||||
*
|
||||
* @see AccessibleText#CHARACTER
|
||||
* @see AccessibleText#WORD
|
||||
* @see AccessibleText#SENTENCE
|
||||
*/
|
||||
public AccessibleTextSequence getTextSequenceAfter(int part, int index);
|
||||
|
||||
/**
|
||||
* Returns the <code>AccessibleTextSequence</code> before a given index.
|
||||
*
|
||||
* @param part the <code>CHARACTER</code>, <code>WORD</code>,
|
||||
* <code>SENTENCE</code>, <code>LINE</code> or <code>ATTRIBUTE_RUN</code>
|
||||
* to retrieve
|
||||
* @param index an index within the text
|
||||
* @return an <code>AccessibleTextSequence</code> specifying the text
|
||||
* if part and index are valid. Otherwise, null is returned.
|
||||
*
|
||||
* @see AccessibleText#CHARACTER
|
||||
* @see AccessibleText#WORD
|
||||
* @see AccessibleText#SENTENCE
|
||||
*/
|
||||
public AccessibleTextSequence getTextSequenceBefore(int part, int index);
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @return the bounding rectangle of the text if the indices are valid.
|
||||
* Otherwise, null is returned.
|
||||
*/
|
||||
public Rectangle getTextBounds(int startIndex, int endIndex);
|
||||
}
|
||||
140
jdkSrc/jdk8/javax/accessibility/AccessibleHyperlink.java
Normal file
140
jdkSrc/jdk8/javax/accessibility/AccessibleHyperlink.java
Normal file
@@ -0,0 +1,140 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2000, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
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
|
||||
*
|
||||
* @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();
|
||||
|
||||
/**
|
||||
* 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 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);
|
||||
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
80
jdkSrc/jdk8/javax/accessibility/AccessibleHypertext.java
Normal file
80
jdkSrc/jdk8/javax/accessibility/AccessibleHypertext.java
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2000, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.accessibility;
|
||||
|
||||
|
||||
import java.util.*;
|
||||
import java.awt.*;
|
||||
import javax.swing.text.*;
|
||||
|
||||
|
||||
/**
|
||||
* <P>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.
|
||||
*
|
||||
* @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.
|
||||
*/
|
||||
public abstract int getLinkCount();
|
||||
|
||||
/**
|
||||
* Returns the nth Link of this Hypertext document.
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* @param charIndex index within the text
|
||||
* @return index into the set of hyperlinks for this hypertext doc.
|
||||
*/
|
||||
public abstract int getLinkIndex(int charIndex);
|
||||
}
|
||||
82
jdkSrc/jdk8/javax/accessibility/AccessibleIcon.java
Normal file
82
jdkSrc/jdk8/javax/accessibility/AccessibleIcon.java
Normal file
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2006, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
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.
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* @param description the description of the icon
|
||||
*/
|
||||
public void setAccessibleIconDescription(String description);
|
||||
|
||||
/**
|
||||
* Gets the width of the icon
|
||||
*
|
||||
* @return the width of the icon.
|
||||
*/
|
||||
public int getAccessibleIconWidth();
|
||||
|
||||
/**
|
||||
* Gets the height of the icon
|
||||
*
|
||||
* @return the height of the icon.
|
||||
*/
|
||||
public int getAccessibleIconHeight();
|
||||
|
||||
}
|
||||
63
jdkSrc/jdk8/javax/accessibility/AccessibleKeyBinding.java
Normal file
63
jdkSrc/jdk8/javax/accessibility/AccessibleKeyBinding.java
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2006, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.accessibility;
|
||||
|
||||
/**
|
||||
* The 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.
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @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
|
||||
* 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
|
||||
* @see #getAccessibleKeyBindingCount
|
||||
*/
|
||||
public java.lang.Object getAccessibleKeyBinding(int i);
|
||||
}
|
||||
369
jdkSrc/jdk8/javax/accessibility/AccessibleRelation.java
Normal file
369
jdkSrc/jdk8/javax/accessibility/AccessibleRelation.java
Normal file
@@ -0,0 +1,369 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2006, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.accessibility;
|
||||
|
||||
import java.util.Vector;
|
||||
import java.util.Locale;
|
||||
import java.util.MissingResourceException;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
/**
|
||||
* <P>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.
|
||||
* <p>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.
|
||||
* <p>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
|
||||
* @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.
|
||||
*/
|
||||
private Object [] target = new Object[0];
|
||||
|
||||
/**
|
||||
* Indicates an object is a label for one or more target objects.
|
||||
*
|
||||
* @see #getTarget
|
||||
* @see #CONTROLLER_FOR
|
||||
* @see #CONTROLLED_BY
|
||||
* @see #LABELED_BY
|
||||
* @see #MEMBER_OF
|
||||
*/
|
||||
public static final String LABEL_FOR = new String("labelFor");
|
||||
|
||||
/**
|
||||
* Indicates an object is labeled by one or more target objects.
|
||||
*
|
||||
* @see #getTarget
|
||||
* @see #CONTROLLER_FOR
|
||||
* @see #CONTROLLED_BY
|
||||
* @see #LABEL_FOR
|
||||
* @see #MEMBER_OF
|
||||
*/
|
||||
public static final String LABELED_BY = new String("labeledBy");
|
||||
|
||||
/**
|
||||
* Indicates an object is a member of a group of one or more
|
||||
* target objects.
|
||||
*
|
||||
* @see #getTarget
|
||||
* @see #CONTROLLER_FOR
|
||||
* @see #CONTROLLED_BY
|
||||
* @see #LABEL_FOR
|
||||
* @see #LABELED_BY
|
||||
*/
|
||||
public static final String MEMBER_OF = new String("memberOf");
|
||||
|
||||
/**
|
||||
* Indicates an object is a controller for one or more target
|
||||
* objects.
|
||||
*
|
||||
* @see #getTarget
|
||||
* @see #CONTROLLED_BY
|
||||
* @see #LABEL_FOR
|
||||
* @see #LABELED_BY
|
||||
* @see #MEMBER_OF
|
||||
*/
|
||||
public static final String CONTROLLER_FOR = new String("controllerFor");
|
||||
|
||||
/**
|
||||
* Indicates an object is controlled by one or more target
|
||||
* objects.
|
||||
*
|
||||
* @see #getTarget
|
||||
* @see #CONTROLLER_FOR
|
||||
* @see #LABEL_FOR
|
||||
* @see #LABELED_BY
|
||||
* @see #MEMBER_OF
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final String FLOWS_FROM = "flowsFrom";
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final String PARENT_WINDOW_OF = "parentWindowOf";
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final String EMBEDDED_BY = "embeddedBy";
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public static final String LABEL_FOR_PROPERTY = "labelForProperty";
|
||||
|
||||
/**
|
||||
* Identifies that the objects that are doing the labeling have changed
|
||||
*/
|
||||
public static final String LABELED_BY_PROPERTY = "labeledByProperty";
|
||||
|
||||
/**
|
||||
* Identifies that group membership has changed.
|
||||
*/
|
||||
public static final String MEMBER_OF_PROPERTY = "memberOfProperty";
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public static final String CONTROLLED_BY_PROPERTY = "controlledByProperty";
|
||||
|
||||
/**
|
||||
* Indicates the 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.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final String FLOWS_FROM_PROPERTY = "flowsFromProperty";
|
||||
|
||||
/**
|
||||
* Indicates the SUBWINDOW_OF relation between two or more objects
|
||||
* has changed.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final String SUBWINDOW_OF_PROPERTY = "subwindowOfProperty";
|
||||
|
||||
/**
|
||||
* Indicates the 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.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final String EMBEDS_PROPERTY = "embedsProperty";
|
||||
|
||||
/**
|
||||
* Indicates the EMBEDDED_BY relation between two or more objects
|
||||
* has changed.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final String EMBEDDED_BY_PROPERTY = "embeddedByProperty";
|
||||
|
||||
/**
|
||||
* Indicates the CHILD_NODE_OF relation between two or more objects
|
||||
* has changed.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @param key the locale independent name of the relation.
|
||||
* @see AccessibleBundle#toDisplayString
|
||||
*/
|
||||
public AccessibleRelation(String key) {
|
||||
this.key = key;
|
||||
this.target = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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) {
|
||||
this.key = key;
|
||||
this.target = new Object[1];
|
||||
this.target[0] = target;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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) {
|
||||
this.key = key;
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the key for this relation
|
||||
*
|
||||
* @return the key for this relation
|
||||
*
|
||||
* @see #CONTROLLER_FOR
|
||||
* @see #CONTROLLED_BY
|
||||
* @see #LABEL_FOR
|
||||
* @see #LABELED_BY
|
||||
* @see #MEMBER_OF
|
||||
*/
|
||||
public String getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the target objects for this relation
|
||||
*
|
||||
* @return an array containing the target objects for this relation
|
||||
*/
|
||||
public Object [] getTarget() {
|
||||
if (target == null) {
|
||||
target = new Object[0];
|
||||
}
|
||||
Object [] retval = new Object[target.length];
|
||||
for (int i = 0; i < target.length; i++) {
|
||||
retval[i] = target[i];
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the target object for this relation
|
||||
*
|
||||
* @param target the target object for this relation
|
||||
*/
|
||||
public void setTarget(Object target) {
|
||||
this.target = new Object[1];
|
||||
this.target[0] = target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets 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;
|
||||
}
|
||||
}
|
||||
244
jdkSrc/jdk8/javax/accessibility/AccessibleRelationSet.java
Normal file
244
jdkSrc/jdk8/javax/accessibility/AccessibleRelationSet.java
Normal file
@@ -0,0 +1,244 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2013, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
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.
|
||||
*
|
||||
* @see AccessibleRelation
|
||||
*
|
||||
* @author Lynn Monsanto
|
||||
* @since 1.3
|
||||
*/
|
||||
public class AccessibleRelationSet {
|
||||
|
||||
/**
|
||||
* Each entry in the Vector represents an AccessibleRelation.
|
||||
* @see #add
|
||||
* @see #addAll
|
||||
* @see #remove
|
||||
* @see #contains
|
||||
* @see #get
|
||||
* @see #size
|
||||
* @see #toArray
|
||||
* @see #clear
|
||||
*/
|
||||
protected Vector<AccessibleRelation> relations = null;
|
||||
|
||||
/**
|
||||
* Creates a new empty relation set.
|
||||
*/
|
||||
public AccessibleRelationSet() {
|
||||
relations = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public AccessibleRelationSet(AccessibleRelation[] relations) {
|
||||
if (relations.length != 0) {
|
||||
this.relations = new Vector(relations.length);
|
||||
for (int i = 0; i < relations.length; i++) {
|
||||
add(relations[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public boolean add(AccessibleRelation relation) {
|
||||
if (relations == null) {
|
||||
relations = new Vector();
|
||||
}
|
||||
|
||||
// Merge the relation targets if the key exists
|
||||
AccessibleRelation existingRelation = get(relation.getKey());
|
||||
if (existingRelation == null) {
|
||||
relations.addElement(relation);
|
||||
return true;
|
||||
} else {
|
||||
Object [] existingTarget = existingRelation.getTarget();
|
||||
Object [] newTarget = relation.getTarget();
|
||||
int mergedLength = existingTarget.length + newTarget.length;
|
||||
Object [] mergedTarget = new Object[mergedLength];
|
||||
for (int i = 0; i < existingTarget.length; i++) {
|
||||
mergedTarget[i] = existingTarget[i];
|
||||
}
|
||||
for (int i = existingTarget.length, j = 0;
|
||||
i < mergedLength;
|
||||
i++, j++) {
|
||||
mergedTarget[i] = newTarget[j];
|
||||
}
|
||||
existingRelation.setTarget(mergedTarget);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds all of the relations to the existing relation set. Duplicate
|
||||
* entries are ignored.
|
||||
*
|
||||
* @param relations AccessibleRelation array describing the relation set.
|
||||
*/
|
||||
public void addAll(AccessibleRelation[] relations) {
|
||||
if (relations.length != 0) {
|
||||
if (this.relations == null) {
|
||||
this.relations = new Vector(relations.length);
|
||||
}
|
||||
for (int i = 0; i < relations.length; i++) {
|
||||
add(relations[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
public boolean remove(AccessibleRelation relation) {
|
||||
if (relations == null) {
|
||||
return false;
|
||||
} else {
|
||||
return relations.removeElement(relation);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all the relations from the current relation set.
|
||||
*/
|
||||
public void clear() {
|
||||
if (relations != null) {
|
||||
relations.removeAllElements();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of relations in the relation set.
|
||||
* @return the number of relations in the relation set
|
||||
*/
|
||||
public int size() {
|
||||
if (relations == null) {
|
||||
return 0;
|
||||
} else {
|
||||
return relations.size();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public boolean contains(String key) {
|
||||
return get(key) != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the relation that matches the specified key.
|
||||
* @param key the AccessibleRelation key
|
||||
* @return the relation, if one exists, that matches the specified key.
|
||||
* Otherwise, null is returned.
|
||||
*/
|
||||
public AccessibleRelation get(String key) {
|
||||
if (relations == null) {
|
||||
return null;
|
||||
} else {
|
||||
int len = relations.size();
|
||||
for (int i = 0; i < len; i++) {
|
||||
AccessibleRelation relation =
|
||||
(AccessibleRelation)relations.elementAt(i);
|
||||
if (relation != null && relation.getKey().equals(key)) {
|
||||
return relation;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current relation set as an array of AccessibleRelation
|
||||
* @return AccessibleRelation array contacting the current relation.
|
||||
*/
|
||||
public AccessibleRelation[] toArray() {
|
||||
if (relations == null) {
|
||||
return new AccessibleRelation[0];
|
||||
} else {
|
||||
AccessibleRelation[] relationArray
|
||||
= new AccessibleRelation[relations.size()];
|
||||
for (int i = 0; i < relationArray.length; i++) {
|
||||
relationArray[i] = (AccessibleRelation) relations.elementAt(i);
|
||||
}
|
||||
return relationArray;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a localized String representing all the relations in the set
|
||||
* using the default locale.
|
||||
*
|
||||
* @return comma separated localized String
|
||||
* @see AccessibleBundle#toDisplayString
|
||||
*/
|
||||
public String toString() {
|
||||
String ret = "";
|
||||
if ((relations != null) && (relations.size() > 0)) {
|
||||
ret = ((AccessibleRelation) (relations.elementAt(0))).toDisplayString();
|
||||
for (int i = 1; i < relations.size(); i++) {
|
||||
ret = ret + ","
|
||||
+ ((AccessibleRelation) (relations.elementAt(i))).
|
||||
toDisplayString();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
152
jdkSrc/jdk8/javax/accessibility/AccessibleResourceBundle.java
Normal file
152
jdkSrc/jdk8/javax/accessibility/AccessibleResourceBundle.java
Normal file
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2006, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.accessibility;
|
||||
|
||||
import java.util.ListResourceBundle;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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.
|
||||
*/
|
||||
public Object[][] getContents() {
|
||||
// The table holding the mapping between the programmatic keys
|
||||
// and the display strings for the en_US locale.
|
||||
return new Object[][] {
|
||||
|
||||
// LOCALIZE THIS
|
||||
// Role names
|
||||
// { "application","application" },
|
||||
// { "border","border" },
|
||||
// { "checkboxmenuitem","check box menu item" },
|
||||
// { "choice","choice" },
|
||||
// { "column","column" },
|
||||
// { "cursor","cursor" },
|
||||
// { "document","document" },
|
||||
// { "grouping","grouping" },
|
||||
// { "image","image" },
|
||||
// { "indicator","indicator" },
|
||||
// { "radiobuttonmenuitem","radio button menu item" },
|
||||
// { "row","row" },
|
||||
// { "tablecell","table cell" },
|
||||
// { "treenode","tree node" },
|
||||
{ "alert","alert" },
|
||||
{ "awtcomponent","AWT component" },
|
||||
{ "checkbox","check box" },
|
||||
{ "colorchooser","color chooser" },
|
||||
{ "columnheader","column header" },
|
||||
{ "combobox","combo box" },
|
||||
{ "canvas","canvas" },
|
||||
{ "desktopicon","desktop icon" },
|
||||
{ "desktoppane","desktop pane" },
|
||||
{ "dialog","dialog" },
|
||||
{ "directorypane","directory pane" },
|
||||
{ "glasspane","glass pane" },
|
||||
{ "filechooser","file chooser" },
|
||||
{ "filler","filler" },
|
||||
{ "frame","frame" },
|
||||
{ "internalframe","internal frame" },
|
||||
{ "label","label" },
|
||||
{ "layeredpane","layered pane" },
|
||||
{ "list","list" },
|
||||
{ "listitem","list item" },
|
||||
{ "menubar","menu bar" },
|
||||
{ "menu","menu" },
|
||||
{ "menuitem","menu item" },
|
||||
{ "optionpane","option pane" },
|
||||
{ "pagetab","page tab" },
|
||||
{ "pagetablist","page tab list" },
|
||||
{ "panel","panel" },
|
||||
{ "passwordtext","password text" },
|
||||
{ "popupmenu","popup menu" },
|
||||
{ "progressbar","progress bar" },
|
||||
{ "pushbutton","push button" },
|
||||
{ "radiobutton","radio button" },
|
||||
{ "rootpane","root pane" },
|
||||
{ "rowheader","row header" },
|
||||
{ "scrollbar","scroll bar" },
|
||||
{ "scrollpane","scroll pane" },
|
||||
{ "separator","separator" },
|
||||
{ "slider","slider" },
|
||||
{ "splitpane","split pane" },
|
||||
{ "swingcomponent","swing component" },
|
||||
{ "table","table" },
|
||||
{ "text","text" },
|
||||
{ "tree","tree" },
|
||||
{ "togglebutton","toggle button" },
|
||||
{ "toolbar","tool bar" },
|
||||
{ "tooltip","tool tip" },
|
||||
{ "unknown","unknown" },
|
||||
{ "viewport","viewport" },
|
||||
{ "window","window" },
|
||||
// Relations
|
||||
{ "labelFor","label for" },
|
||||
{ "labeledBy","labeled by" },
|
||||
{ "memberOf","member of" },
|
||||
{ "controlledBy","controlledBy" },
|
||||
{ "controllerFor","controllerFor" },
|
||||
// State modes
|
||||
{ "active","active" },
|
||||
{ "armed","armed" },
|
||||
{ "busy","busy" },
|
||||
{ "checked","checked" },
|
||||
{ "collapsed", "collapsed" },
|
||||
{ "editable","editable" },
|
||||
{ "expandable", "expandable" },
|
||||
{ "expanded", "expanded" },
|
||||
{ "enabled","enabled" },
|
||||
{ "focusable","focusable" },
|
||||
{ "focused","focused" },
|
||||
{ "iconified", "iconified" },
|
||||
{ "modal", "modal" },
|
||||
{ "multiline", "multiple line" },
|
||||
{ "multiselectable","multiselectable" },
|
||||
{ "opaque", "opaque" },
|
||||
{ "pressed","pressed" },
|
||||
{ "resizable", "resizable" },
|
||||
{ "selectable","selectable" },
|
||||
{ "selected","selected" },
|
||||
{ "showing","showing" },
|
||||
{ "singleline", "single line" },
|
||||
{ "transient", "transient" },
|
||||
{ "visible","visible" },
|
||||
{ "vertical","vertical" },
|
||||
{ "horizontal","horizontal" }
|
||||
// END OF MATERIAL TO LOCALIZE
|
||||
};
|
||||
}
|
||||
}
|
||||
661
jdkSrc/jdk8/javax/accessibility/AccessibleRole.java
Normal file
661
jdkSrc/jdk8/javax/accessibility/AccessibleRole.java
Normal file
@@ -0,0 +1,661 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2005, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.accessibility;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.MissingResourceException;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
/**
|
||||
* <P>Class AccessibleRole determines the role of a component. The role of a
|
||||
* component describes its generic function. (E.G.,
|
||||
* "push button," "table," or "list.")
|
||||
* <p>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.
|
||||
* <p>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
|
||||
*/
|
||||
public class AccessibleRole extends AccessibleBundle {
|
||||
|
||||
// If you add or remove anything from here, make sure you
|
||||
// update AccessibleResourceBundle.java.
|
||||
|
||||
/**
|
||||
* Object is used to alert the user about something.
|
||||
*/
|
||||
public static final AccessibleRole ALERT
|
||||
= new AccessibleRole("alert");
|
||||
|
||||
/**
|
||||
* The header for a column of data.
|
||||
*/
|
||||
public static final AccessibleRole COLUMN_HEADER
|
||||
= new AccessibleRole("columnheader");
|
||||
|
||||
/**
|
||||
* Object that can be drawn into and is used to trap
|
||||
* events.
|
||||
* @see #FRAME
|
||||
* @see #GLASS_PANE
|
||||
* @see #LAYERED_PANE
|
||||
*/
|
||||
public static final AccessibleRole CANVAS
|
||||
= new AccessibleRole("canvas");
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @see #DESKTOP_PANE
|
||||
* @see #INTERNAL_FRAME
|
||||
*/
|
||||
public static final AccessibleRole DESKTOP_ICON
|
||||
= new AccessibleRole("desktopicon");
|
||||
|
||||
/**
|
||||
* An object containing a collection of <code>Accessibles</code> that
|
||||
* together represents <code>HTML</code> content. The child
|
||||
* <code>Accessibles</code> would include objects implementing
|
||||
* <code>AccessibleText</code>, <code>AccessibleHypertext</code>,
|
||||
* <code>AccessibleIcon</code>, and other interfaces.
|
||||
* @see #HYPERLINK
|
||||
* @see AccessibleText
|
||||
* @see AccessibleHypertext
|
||||
* @see AccessibleHyperlink
|
||||
* @see AccessibleIcon
|
||||
* @since 1.6
|
||||
*/
|
||||
public static final AccessibleRole HTML_CONTAINER
|
||||
= 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.
|
||||
* @see #DESKTOP_ICON
|
||||
* @see #DESKTOP_PANE
|
||||
* @see #FRAME
|
||||
*/
|
||||
public static final AccessibleRole INTERNAL_FRAME
|
||||
= new AccessibleRole("internalframe");
|
||||
|
||||
/**
|
||||
* A pane that supports internal frames and
|
||||
* iconified versions of those internal frames.
|
||||
* @see #DESKTOP_ICON
|
||||
* @see #INTERNAL_FRAME
|
||||
*/
|
||||
public static final AccessibleRole DESKTOP_PANE
|
||||
= new AccessibleRole("desktoppane");
|
||||
|
||||
/**
|
||||
* A specialized pane whose primary use is inside a DIALOG
|
||||
* @see #DIALOG
|
||||
*/
|
||||
public static final AccessibleRole OPTION_PANE
|
||||
= new AccessibleRole("optionpane");
|
||||
|
||||
/**
|
||||
* A top level window with no title or border.
|
||||
* @see #FRAME
|
||||
* @see #DIALOG
|
||||
*/
|
||||
public static final AccessibleRole WINDOW
|
||||
= 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.
|
||||
* @see #DIALOG
|
||||
* @see #CANVAS
|
||||
* @see #WINDOW
|
||||
*/
|
||||
public static final AccessibleRole FRAME
|
||||
= 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.
|
||||
* @see #FRAME
|
||||
* @see #WINDOW
|
||||
*/
|
||||
public static final AccessibleRole DIALOG
|
||||
= new AccessibleRole("dialog");
|
||||
|
||||
/**
|
||||
* A specialized pane that lets the user choose a color.
|
||||
*/
|
||||
public static final AccessibleRole COLOR_CHOOSER
|
||||
= new AccessibleRole("colorchooser");
|
||||
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @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.
|
||||
*/
|
||||
public static final AccessibleRole FILLER
|
||||
= new AccessibleRole("filler");
|
||||
|
||||
/**
|
||||
* A hypertext anchor
|
||||
*/
|
||||
public static final AccessibleRole HYPERLINK
|
||||
= new AccessibleRole("hyperlink");
|
||||
|
||||
/**
|
||||
* A small fixed size picture, typically used to decorate components.
|
||||
*/
|
||||
public static final AccessibleRole ICON
|
||||
= new AccessibleRole("icon");
|
||||
|
||||
/**
|
||||
* An object used to present an icon or short string in an interface.
|
||||
*/
|
||||
public static final AccessibleRole LABEL
|
||||
= new AccessibleRole("label");
|
||||
|
||||
/**
|
||||
* A specialized pane that has a glass pane and a layered pane as its
|
||||
* children.
|
||||
* @see #GLASS_PANE
|
||||
* @see #LAYERED_PANE
|
||||
*/
|
||||
public static final AccessibleRole ROOT_PANE
|
||||
= new AccessibleRole("rootpane");
|
||||
|
||||
/**
|
||||
* A pane that is guaranteed to be painted on top
|
||||
* of all panes beneath it.
|
||||
* @see #ROOT_PANE
|
||||
* @see #CANVAS
|
||||
*/
|
||||
public static final AccessibleRole GLASS_PANE
|
||||
= new AccessibleRole("glasspane");
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @see #GLASS_PANE
|
||||
* @see #ROOT_PANE
|
||||
*/
|
||||
public static final AccessibleRole LAYERED_PANE
|
||||
= 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.
|
||||
* @see #SCROLL_PANE
|
||||
* @see #LIST_ITEM
|
||||
*/
|
||||
public static final AccessibleRole LIST
|
||||
= new AccessibleRole("list");
|
||||
|
||||
/**
|
||||
* An object that presents an element in a list. A list is usually
|
||||
* contained within a scroll pane.
|
||||
* @see #SCROLL_PANE
|
||||
* @see #LIST
|
||||
*/
|
||||
public static final AccessibleRole LIST_ITEM
|
||||
= 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."
|
||||
* @see #MENU
|
||||
* @see #POPUP_MENU
|
||||
* @see #LAYERED_PANE
|
||||
*/
|
||||
public static final AccessibleRole MENU_BAR
|
||||
= 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.
|
||||
* @see #MENU
|
||||
* @see #MENU_ITEM
|
||||
*/
|
||||
public static final AccessibleRole POPUP_MENU
|
||||
= 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."
|
||||
* @see #MENU_BAR
|
||||
* @see #MENU_ITEM
|
||||
* @see #SEPARATOR
|
||||
* @see #RADIO_BUTTON
|
||||
* @see #CHECK_BOX
|
||||
* @see #POPUP_MENU
|
||||
*/
|
||||
public static final AccessibleRole MENU
|
||||
= 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.
|
||||
* @see #MENU_BAR
|
||||
* @see #SEPARATOR
|
||||
* @see #POPUP_MENU
|
||||
*/
|
||||
public static final AccessibleRole MENU_ITEM
|
||||
= 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.
|
||||
* @see #MENU
|
||||
* @see #MENU_ITEM
|
||||
*/
|
||||
public static final AccessibleRole SEPARATOR
|
||||
= 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.
|
||||
* @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.
|
||||
* @see #PAGE_TAB_LIST
|
||||
*/
|
||||
public static final AccessibleRole PAGE_TAB
|
||||
= new AccessibleRole("pagetab");
|
||||
|
||||
/**
|
||||
* A generic container that is often used to group objects.
|
||||
*/
|
||||
public static final AccessibleRole PANEL
|
||||
= new AccessibleRole("panel");
|
||||
|
||||
/**
|
||||
* An object used to indicate how much of a task has been completed.
|
||||
*/
|
||||
public static final AccessibleRole PROGRESS_BAR
|
||||
= new AccessibleRole("progressbar");
|
||||
|
||||
/**
|
||||
* 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");
|
||||
|
||||
/**
|
||||
* An object the user can manipulate to tell the application to do
|
||||
* something.
|
||||
* @see #CHECK_BOX
|
||||
* @see #TOGGLE_BUTTON
|
||||
* @see #RADIO_BUTTON
|
||||
*/
|
||||
public static final AccessibleRole PUSH_BUTTON
|
||||
= new AccessibleRole("pushbutton");
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public static final AccessibleRole TOGGLE_BUTTON
|
||||
= new AccessibleRole("togglebutton");
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public static final AccessibleRole CHECK_BOX
|
||||
= 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.
|
||||
* @see #PUSH_BUTTON
|
||||
* @see #TOGGLE_BUTTON
|
||||
* @see #CHECK_BOX
|
||||
*/
|
||||
public static final AccessibleRole RADIO_BUTTON
|
||||
= new AccessibleRole("radiobutton");
|
||||
|
||||
/**
|
||||
* The header for a row of data.
|
||||
*/
|
||||
public static final AccessibleRole ROW_HEADER
|
||||
= 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.
|
||||
* @see #SCROLL_BAR
|
||||
* @see #VIEWPORT
|
||||
*/
|
||||
public static final AccessibleRole SCROLL_PANE
|
||||
= 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.
|
||||
* @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.
|
||||
* @see #SCROLL_PANE
|
||||
*/
|
||||
public static final AccessibleRole VIEWPORT
|
||||
= new AccessibleRole("viewport");
|
||||
|
||||
/**
|
||||
* 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
|
||||
= new AccessibleRole("slider");
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
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.
|
||||
* @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.
|
||||
*/
|
||||
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
|
||||
* 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.
|
||||
*/
|
||||
public static final AccessibleRole TOOL_TIP
|
||||
= new AccessibleRole("tooltip");
|
||||
|
||||
/**
|
||||
* An AWT component, but nothing else is known about it.
|
||||
* @see #SWING_COMPONENT
|
||||
* @see #UNKNOWN
|
||||
*/
|
||||
public static final AccessibleRole AWT_COMPONENT
|
||||
= new AccessibleRole("awtcomponent");
|
||||
|
||||
/**
|
||||
* A Swing component, but nothing else is known about it.
|
||||
* @see #AWT_COMPONENT
|
||||
* @see #UNKNOWN
|
||||
*/
|
||||
public static final AccessibleRole SWING_COMPONENT
|
||||
= new AccessibleRole("swingcomponent");
|
||||
|
||||
/**
|
||||
* The object contains some Accessible information, but its role is
|
||||
* not known.
|
||||
* @see #AWT_COMPONENT
|
||||
* @see #SWING_COMPONENT
|
||||
*/
|
||||
public static final AccessibleRole UNKNOWN
|
||||
= new AccessibleRole("unknown");
|
||||
|
||||
/**
|
||||
* A 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
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
public static final AccessibleRole SPIN_BOX
|
||||
= new AccessibleRole("spinbox");
|
||||
|
||||
/**
|
||||
* A 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.
|
||||
*/
|
||||
public static final AccessibleRole GROUP_BOX
|
||||
= new AccessibleRole("groupbox");
|
||||
|
||||
/**
|
||||
* A text header
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final AccessibleRole HEADER =
|
||||
new AccessibleRole("header");
|
||||
|
||||
/**
|
||||
* A text footer
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final AccessibleRole FOOTER =
|
||||
new AccessibleRole("footer");
|
||||
|
||||
/**
|
||||
* A text paragraph
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final AccessibleRole PARAGRAPH =
|
||||
new AccessibleRole("paragraph");
|
||||
|
||||
/**
|
||||
* A ruler is an object used to measure distance
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final AccessibleRole RULER =
|
||||
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.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
static public final AccessibleRole EDITBAR =
|
||||
new AccessibleRole("editbar");
|
||||
|
||||
/**
|
||||
* A role indicating the object monitors the progress
|
||||
* of some operation.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
static public final AccessibleRole PROGRESS_MONITOR =
|
||||
new AccessibleRole("progressMonitor");
|
||||
|
||||
|
||||
// The following are all under consideration for potential future use.
|
||||
|
||||
// public static final AccessibleRole APPLICATION
|
||||
// = new AccessibleRole("application");
|
||||
|
||||
// public static final AccessibleRole BORDER
|
||||
// = new AccessibleRole("border");
|
||||
|
||||
// public static final AccessibleRole CHECK_BOX_MENU_ITEM
|
||||
// = new AccessibleRole("checkboxmenuitem");
|
||||
|
||||
// public static final AccessibleRole CHOICE
|
||||
// = new AccessibleRole("choice");
|
||||
|
||||
// public static final AccessibleRole COLUMN
|
||||
// = new AccessibleRole("column");
|
||||
|
||||
// public static final AccessibleRole CURSOR
|
||||
// = new AccessibleRole("cursor");
|
||||
|
||||
// public static final AccessibleRole DOCUMENT
|
||||
// = new AccessibleRole("document");
|
||||
|
||||
// public static final AccessibleRole IMAGE
|
||||
// = new AccessibleRole("Image");
|
||||
|
||||
// public static final AccessibleRole INDICATOR
|
||||
// = new AccessibleRole("indicator");
|
||||
|
||||
// public static final AccessibleRole RADIO_BUTTON_MENU_ITEM
|
||||
// = new AccessibleRole("radiobuttonmenuitem");
|
||||
|
||||
// public static final AccessibleRole ROW
|
||||
// = new AccessibleRole("row");
|
||||
|
||||
// public static final AccessibleRole TABLE_CELL
|
||||
// = new AccessibleRole("tablecell");
|
||||
|
||||
// public static final AccessibleRole TREE_NODE
|
||||
// = 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
|
||||
* the constants in this file to make it a strongly typed enumeration.
|
||||
* Subclasses of this class should enforce similar policy.
|
||||
* <p>
|
||||
* 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.
|
||||
*
|
||||
* @param key the locale independent name of the role.
|
||||
* @see AccessibleBundle#toDisplayString
|
||||
*/
|
||||
protected AccessibleRole(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
}
|
||||
114
jdkSrc/jdk8/javax/accessibility/AccessibleSelection.java
Normal file
114
jdkSrc/jdk8/javax/accessibility/AccessibleSelection.java
Normal file
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 1999, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
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.
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* @return the number of items currently selected.
|
||||
*/
|
||||
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.
|
||||
* <p>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
|
||||
* @return the i-th selected child
|
||||
* @see #getAccessibleSelectionCount
|
||||
*/
|
||||
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.
|
||||
* @see AccessibleContext#getAccessibleChild
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @param i the zero-based index of the child
|
||||
* @see AccessibleContext#getAccessibleChild
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @param i the zero-based index of the child
|
||||
* @see AccessibleContext#getAccessibleChild
|
||||
*/
|
||||
public void removeAccessibleSelection(int i);
|
||||
|
||||
/**
|
||||
* Clears the selection in the object, so that no children in the
|
||||
* object are selected.
|
||||
*/
|
||||
public void clearAccessibleSelection();
|
||||
|
||||
/**
|
||||
* Causes every child of the object to be selected
|
||||
* if the object supports multiple selections.
|
||||
*/
|
||||
public void selectAllAccessibleSelection();
|
||||
}
|
||||
375
jdkSrc/jdk8/javax/accessibility/AccessibleState.java
Normal file
375
jdkSrc/jdk8/javax/accessibility/AccessibleState.java
Normal file
@@ -0,0 +1,375 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2004, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.accessibility;
|
||||
|
||||
import java.util.Vector;
|
||||
import java.util.Locale;
|
||||
import java.util.MissingResourceException;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
/**
|
||||
* <P>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.
|
||||
* <p>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.
|
||||
* <p>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
|
||||
*/
|
||||
public class AccessibleState extends AccessibleBundle {
|
||||
|
||||
// If you add or remove anything from here, make sure you
|
||||
// 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.
|
||||
* @see AccessibleRole#WINDOW
|
||||
* @see AccessibleRole#FRAME
|
||||
* @see AccessibleRole#DIALOG
|
||||
*/
|
||||
public static final AccessibleState ACTIVE
|
||||
= 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.
|
||||
* @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.
|
||||
* @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.
|
||||
* @see AccessibleRole#PROGRESS_BAR
|
||||
* @see AccessibleRole#SCROLL_BAR
|
||||
* @see AccessibleRole#SLIDER
|
||||
*/
|
||||
public static final AccessibleState BUSY
|
||||
= new AccessibleState("busy");
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public static final AccessibleState CHECKED
|
||||
= 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.
|
||||
* @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.
|
||||
* @see #EXPANDED
|
||||
* @see #COLLAPSED
|
||||
* @see AccessibleRole#TREE
|
||||
*/
|
||||
public static final AccessibleState EXPANDABLE
|
||||
= new AccessibleState("expandable");
|
||||
|
||||
/**
|
||||
* Indicates this object is collapsed. This is usually paired with the
|
||||
* EXPANDABLE state and is used on objects that provide progressive
|
||||
* disclosure such as trees.
|
||||
* @see #EXPANDABLE
|
||||
* @see #EXPANDED
|
||||
* @see AccessibleRole#TREE
|
||||
*/
|
||||
public static final AccessibleState COLLAPSED
|
||||
= new AccessibleState("collapsed");
|
||||
|
||||
/**
|
||||
* Indicates this object is expanded. This is usually paired with the
|
||||
* EXPANDABLE state and is used on objects that provide progressive
|
||||
* disclosure such as trees.
|
||||
* @see #EXPANDABLE
|
||||
* @see #COLLAPSED
|
||||
* @see AccessibleRole#TREE
|
||||
*/
|
||||
public static final AccessibleState EXPANDED
|
||||
= 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.
|
||||
*/
|
||||
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.
|
||||
* @see #FOCUSED
|
||||
*/
|
||||
public static final AccessibleState FOCUSABLE
|
||||
= new AccessibleState("focusable");
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @see AccessibleRole#FRAME
|
||||
* @see AccessibleRole#INTERNAL_FRAME
|
||||
*/
|
||||
public static final AccessibleState ICONIFIED
|
||||
= 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.
|
||||
* @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.
|
||||
* @see Accessible#getAccessibleContext
|
||||
* @see AccessibleContext#getAccessibleComponent
|
||||
* @see AccessibleComponent#getBounds
|
||||
*/
|
||||
public static final AccessibleState OPAQUE
|
||||
= new AccessibleState("opaque");
|
||||
|
||||
/**
|
||||
* Indicates the size of this object is not fixed.
|
||||
* @see Accessible#getAccessibleContext
|
||||
* @see AccessibleContext#getAccessibleComponent
|
||||
* @see AccessibleComponent#getSize
|
||||
* @see AccessibleComponent#setSize
|
||||
*/
|
||||
public static final AccessibleState RESIZABLE
|
||||
= new AccessibleState("resizable");
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public static final AccessibleState MULTISELECTABLE
|
||||
= 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.
|
||||
* @see #SELECTED
|
||||
* @see Accessible#getAccessibleContext
|
||||
* @see AccessibleContext#getAccessibleSelection
|
||||
* @see AccessibleSelection
|
||||
*/
|
||||
public static final AccessibleState SELECTABLE
|
||||
= 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.
|
||||
* @see #SELECTABLE
|
||||
* @see Accessible#getAccessibleContext
|
||||
* @see AccessibleContext#getAccessibleSelection
|
||||
* @see AccessibleSelection
|
||||
*/
|
||||
public static final AccessibleState SELECTED
|
||||
= 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.
|
||||
* @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.
|
||||
* @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.
|
||||
* @see #VERTICAL
|
||||
* @see AccessibleRole#SCROLL_BAR
|
||||
* @see AccessibleRole#SLIDER
|
||||
* @see AccessibleRole#PROGRESS_BAR
|
||||
*/
|
||||
public static final AccessibleState VERTICAL
|
||||
= new AccessibleState("vertical");
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @see AccessibleRole#PROGRESS_BAR
|
||||
*/
|
||||
public static final AccessibleState HORIZONTAL
|
||||
= new AccessibleState("horizontal");
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
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).
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final AccessibleState MANAGES_DESCENDANTS
|
||||
= 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.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final AccessibleState INDETERMINATE
|
||||
= 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.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
static public final AccessibleState TRUNCATED
|
||||
= 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
|
||||
* the constants in this file to make it a strongly typed enumeration.
|
||||
* Subclasses of this class should enforce similar policy.
|
||||
* <p>
|
||||
* 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.
|
||||
*
|
||||
* @param key the locale independent name of the state.
|
||||
* @see AccessibleBundle#toDisplayString
|
||||
*/
|
||||
protected AccessibleState(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
}
|
||||
199
jdkSrc/jdk8/javax/accessibility/AccessibleStateSet.java
Normal file
199
jdkSrc/jdk8/javax/accessibility/AccessibleStateSet.java
Normal file
@@ -0,0 +1,199 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2004, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
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.
|
||||
*
|
||||
* @see AccessibleState
|
||||
*
|
||||
* @author Willie Walker
|
||||
*/
|
||||
public class AccessibleStateSet {
|
||||
|
||||
/**
|
||||
* Each entry in the Vector represents an AccessibleState.
|
||||
* @see #add
|
||||
* @see #addAll
|
||||
* @see #remove
|
||||
* @see #contains
|
||||
* @see #toArray
|
||||
* @see #clear
|
||||
*/
|
||||
protected Vector<AccessibleState> states = null;
|
||||
|
||||
/**
|
||||
* Creates a new empty state set.
|
||||
*/
|
||||
public AccessibleStateSet() {
|
||||
states = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public AccessibleStateSet(AccessibleState[] states) {
|
||||
if (states.length != 0) {
|
||||
this.states = new Vector(states.length);
|
||||
for (int i = 0; i < states.length; i++) {
|
||||
if (!this.states.contains(states[i])) {
|
||||
this.states.addElement(states[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public boolean add(AccessibleState state) {
|
||||
// [[[ PENDING: WDW - the implementation of this does not need
|
||||
// to always use a vector of states. It could be improved by
|
||||
// caching the states as a bit set.]]]
|
||||
if (states == null) {
|
||||
states = new Vector();
|
||||
}
|
||||
|
||||
if (!states.contains(state)) {
|
||||
states.addElement(state);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds all of the states to the existing state set. Duplicate entries
|
||||
* are ignored.
|
||||
* @param states AccessibleState array describing the state set.
|
||||
*/
|
||||
public void addAll(AccessibleState[] states) {
|
||||
if (states.length != 0) {
|
||||
if (this.states == null) {
|
||||
this.states = new Vector(states.length);
|
||||
}
|
||||
for (int i = 0; i < states.length; i++) {
|
||||
if (!this.states.contains(states[i])) {
|
||||
this.states.addElement(states[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
public boolean remove(AccessibleState state) {
|
||||
if (states == null) {
|
||||
return false;
|
||||
} else {
|
||||
return states.removeElement(state);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all the states from the current state set.
|
||||
*/
|
||||
public void clear() {
|
||||
if (states != null) {
|
||||
states.removeAllElements();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public boolean contains(AccessibleState state) {
|
||||
if (states == null) {
|
||||
return false;
|
||||
} else {
|
||||
return states.contains(state);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current state set as an array of AccessibleState
|
||||
* @return AccessibleState array containing the current state.
|
||||
*/
|
||||
public AccessibleState[] toArray() {
|
||||
if (states == null) {
|
||||
return new AccessibleState[0];
|
||||
} else {
|
||||
AccessibleState[] stateArray = new AccessibleState[states.size()];
|
||||
for (int i = 0; i < stateArray.length; i++) {
|
||||
stateArray[i] = (AccessibleState) states.elementAt(i);
|
||||
}
|
||||
return stateArray;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a localized String representing all the states in the set
|
||||
* using the default locale.
|
||||
*
|
||||
* @return comma separated localized String
|
||||
* @see AccessibleBundle#toDisplayString
|
||||
*/
|
||||
public String toString() {
|
||||
String ret = null;
|
||||
if ((states != null) && (states.size() > 0)) {
|
||||
ret = ((AccessibleState) (states.elementAt(0))).toDisplayString();
|
||||
for (int i = 1; i < states.size(); i++) {
|
||||
ret = ret + ","
|
||||
+ ((AccessibleState) (states.elementAt(i))).
|
||||
toDisplayString();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
65
jdkSrc/jdk8/javax/accessibility/AccessibleStreamable.java
Normal file
65
jdkSrc/jdk8/javax/accessibility/AccessibleStreamable.java
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2006, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.accessibility;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.awt.datatransfer.DataFlavor;
|
||||
|
||||
/**
|
||||
*
|
||||
* The <code>AccessibleStreamable</code> interface should be implemented
|
||||
* by the <code>AccessibleContext</code> 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</code> 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
|
||||
* @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);
|
||||
}
|
||||
222
jdkSrc/jdk8/javax/accessibility/AccessibleTable.java
Normal file
222
jdkSrc/jdk8/javax/accessibility/AccessibleTable.java
Normal file
@@ -0,0 +1,222 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2013, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.accessibility;
|
||||
|
||||
/**
|
||||
* Class AccessibleTable describes a user-interface component that
|
||||
* presents data in a two-dimensional table format.
|
||||
*
|
||||
* @author Lynn Monsanto
|
||||
* @since 1.3
|
||||
*/
|
||||
public interface AccessibleTable {
|
||||
|
||||
/**
|
||||
* Returns the caption for the table.
|
||||
*
|
||||
* @return the caption for the table
|
||||
*/
|
||||
public Accessible getAccessibleCaption();
|
||||
|
||||
/**
|
||||
* Sets the caption for the table.
|
||||
*
|
||||
* @param a the caption for the table
|
||||
*/
|
||||
public void setAccessibleCaption(Accessible a);
|
||||
|
||||
/**
|
||||
* Returns the summary description of the table.
|
||||
*
|
||||
* @return the summary description of the table
|
||||
*/
|
||||
public Accessible getAccessibleSummary();
|
||||
|
||||
/**
|
||||
* Sets the summary description of the table
|
||||
*
|
||||
* @param a the summary description of the table
|
||||
*/
|
||||
public void setAccessibleSummary(Accessible a);
|
||||
|
||||
/**
|
||||
* Returns the number of rows in the table.
|
||||
*
|
||||
* @return the number of rows in the table
|
||||
*/
|
||||
public int getAccessibleRowCount();
|
||||
|
||||
/**
|
||||
* Returns the number of columns in the table.
|
||||
*
|
||||
* @return the number of columns in the table
|
||||
*/
|
||||
public int getAccessibleColumnCount();
|
||||
|
||||
/**
|
||||
* Returns the 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
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @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)
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
public int getAccessibleColumnExtentAt(int r, int c);
|
||||
|
||||
/**
|
||||
* Returns the row headers as an AccessibleTable.
|
||||
*
|
||||
* @return an AccessibleTable representing the row
|
||||
* headers
|
||||
*/
|
||||
public AccessibleTable getAccessibleRowHeader();
|
||||
|
||||
/**
|
||||
* Sets the row headers.
|
||||
*
|
||||
* @param table an AccessibleTable representing the
|
||||
* row headers
|
||||
*/
|
||||
public void setAccessibleRowHeader(AccessibleTable table);
|
||||
|
||||
/**
|
||||
* Returns the column headers as an AccessibleTable.
|
||||
*
|
||||
* @return an AccessibleTable representing the column
|
||||
* headers
|
||||
*/
|
||||
public AccessibleTable getAccessibleColumnHeader();
|
||||
|
||||
/**
|
||||
* Sets the column headers.
|
||||
*
|
||||
* @param table an 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
|
||||
* @return the description of the row
|
||||
*/
|
||||
public Accessible getAccessibleRowDescription(int r);
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
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
|
||||
* @return the text description of the column
|
||||
*/
|
||||
public Accessible getAccessibleColumnDescription(int c);
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public void setAccessibleColumnDescription(int c, Accessible a);
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public boolean isAccessibleSelected(int r, int c);
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public boolean isAccessibleRowSelected(int r);
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
public int [] getSelectedAccessibleColumns();
|
||||
}
|
||||
105
jdkSrc/jdk8/javax/accessibility/AccessibleTableModelChange.java
Normal file
105
jdkSrc/jdk8/javax/accessibility/AccessibleTableModelChange.java
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2013, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
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:
|
||||
* <ul>
|
||||
* <li> public int getType()
|
||||
* <li> public int getFirstRow();
|
||||
* <li> public int getLastRow();
|
||||
* <li> public int getFirstColumn();
|
||||
* <li> public int getLastColumn();
|
||||
* </ul>
|
||||
* The model change type returned by getType() will be one of:
|
||||
* <ul>
|
||||
* <li> INSERT - one or more rows and/or columns have been inserted
|
||||
* <li> UPDATE - some of the table data has changed
|
||||
* <li> DELETE - one or more rows and/or columns have been deleted
|
||||
* </ul>
|
||||
* The affected area of the table can be determined by the other
|
||||
* four methods which specify ranges of rows and columns
|
||||
*
|
||||
* @see Accessible
|
||||
* @see Accessible#getAccessibleContext
|
||||
* @see AccessibleContext
|
||||
* @see AccessibleContext#getAccessibleTable
|
||||
*
|
||||
* @author Lynn Monsanto
|
||||
* @since 1.3
|
||||
*/
|
||||
public interface AccessibleTableModelChange {
|
||||
|
||||
/**
|
||||
* Identifies the insertion of new rows and/or columns.
|
||||
*/
|
||||
public static final int INSERT = 1;
|
||||
|
||||
/**
|
||||
* Identifies a change to existing data.
|
||||
*/
|
||||
public static final int UPDATE = 0;
|
||||
|
||||
/**
|
||||
* Identifies the deletion of rows and/or columns.
|
||||
*/
|
||||
public static final int DELETE = -1;
|
||||
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
188
jdkSrc/jdk8/javax/accessibility/AccessibleText.java
Normal file
188
jdkSrc/jdk8/javax/accessibility/AccessibleText.java
Normal file
@@ -0,0 +1,188 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.accessibility;
|
||||
|
||||
|
||||
import java.util.*;
|
||||
import java.awt.*;
|
||||
import javax.swing.text.*;
|
||||
|
||||
|
||||
/**
|
||||
* <P>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.
|
||||
*
|
||||
* @see Accessible
|
||||
* @see Accessible#getAccessibleContext
|
||||
* @see AccessibleContext
|
||||
* @see AccessibleContext#getAccessibleText
|
||||
*
|
||||
* @author Peter Korn
|
||||
*/
|
||||
public interface AccessibleText {
|
||||
|
||||
/**
|
||||
* Constant used to indicate that the part of the text that should be
|
||||
* retrieved is a character.
|
||||
*
|
||||
* @see #getAtIndex
|
||||
* @see #getAfterIndex
|
||||
* @see #getBeforeIndex
|
||||
*/
|
||||
public static final int CHARACTER = 1;
|
||||
|
||||
/**
|
||||
* Constant used to indicate that the part of the text that should be
|
||||
* retrieved is a word.
|
||||
*
|
||||
* @see #getAtIndex
|
||||
* @see #getAfterIndex
|
||||
* @see #getBeforeIndex
|
||||
*/
|
||||
public static final int WORD = 2;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @see #getAtIndex
|
||||
* @see #getAfterIndex
|
||||
* @see #getBeforeIndex
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @param p the Point in local coordinates
|
||||
* @return the zero-based index of the character under 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.
|
||||
*
|
||||
* @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)
|
||||
*
|
||||
* @return the number of characters
|
||||
*/
|
||||
public int getCharCount();
|
||||
|
||||
/**
|
||||
* 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).
|
||||
* @return the zero-based offset of the caret.
|
||||
*/
|
||||
public int getCaretPosition();
|
||||
|
||||
/**
|
||||
* Returns the String at a given index.
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @param i the zero-based index into the text
|
||||
* @return the 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.
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* @return the index into the text of the end of the selection
|
||||
*/
|
||||
public int getSelectionEnd();
|
||||
|
||||
/**
|
||||
* Returns the portion of the text that is selected.
|
||||
*
|
||||
* @return the String portion of the text that is selected
|
||||
*/
|
||||
public String getSelectedText();
|
||||
}
|
||||
76
jdkSrc/jdk8/javax/accessibility/AccessibleTextSequence.java
Normal file
76
jdkSrc/jdk8/javax/accessibility/AccessibleTextSequence.java
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2013, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package javax.accessibility;
|
||||
|
||||
|
||||
/**
|
||||
* <P>The AccessibleTextSequence provides information about
|
||||
* a contiguous sequence of text.
|
||||
*
|
||||
* @see Accessible
|
||||
* @see Accessible#getAccessibleContext
|
||||
* @see AccessibleContext
|
||||
* @see AccessibleContext#getAccessibleText
|
||||
* @see AccessibleAttributeSequence
|
||||
*
|
||||
* @author Lynn Monsanto
|
||||
*/
|
||||
|
||||
/**
|
||||
* This class collects together key details of a span of text. It
|
||||
* is used by implementors of the class <code>AccessibleExtendedText</code> in
|
||||
* order to return the requested triplet of a <code>String</code>, and the
|
||||
* start and end indicies/offsets into a larger body of text that the
|
||||
* <code>String</code> comes from.
|
||||
*
|
||||
* @see javax.accessibility.AccessibleExtendedText
|
||||
*/
|
||||
public class AccessibleTextSequence {
|
||||
|
||||
/** The start index of the text sequence */
|
||||
public int startIndex;
|
||||
|
||||
/** The end index of the text sequence */
|
||||
public int endIndex;
|
||||
|
||||
/** The text */
|
||||
public String text;
|
||||
|
||||
/**
|
||||
* Constructs an <code>AccessibleTextSequence</code> 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</code> shared by this text span
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public AccessibleTextSequence(int start, int end, String txt) {
|
||||
startIndex = start;
|
||||
endIndex = end;
|
||||
text = txt;
|
||||
}
|
||||
};
|
||||
93
jdkSrc/jdk8/javax/accessibility/AccessibleValue.java
Normal file
93
jdkSrc/jdk8/javax/accessibility/AccessibleValue.java
Normal file
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
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.
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* @return value of the object
|
||||
* @see #setCurrentAccessibleValue
|
||||
*/
|
||||
public Number getCurrentAccessibleValue();
|
||||
|
||||
/**
|
||||
* Set the value of this object as a Number.
|
||||
*
|
||||
* @param n the number to use for the value
|
||||
* @return True if the value was set; else 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 minimum value of this object as a Number.
|
||||
*
|
||||
* @return Minimum value of the object; 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.
|
||||
*
|
||||
* @return Maximum value of the object; null if this object does not
|
||||
* have a maximum value
|
||||
* @see #getMinimumAccessibleValue
|
||||
*/
|
||||
public Number getMaximumAccessibleValue();
|
||||
}
|
||||
Reference in New Issue
Block a user