summaryrefslogtreecommitdiff
path: root/javax/accessibility
diff options
context:
space:
mode:
Diffstat (limited to 'javax/accessibility')
-rw-r--r--javax/accessibility/AccessibleAttributeSequence.java71
-rw-r--r--javax/accessibility/AccessibleContext.java29
-rw-r--r--javax/accessibility/AccessibleExtendedText.java108
-rw-r--r--javax/accessibility/AccessibleRelation.java106
-rw-r--r--javax/accessibility/AccessibleStreamable.java62
-rw-r--r--javax/accessibility/AccessibleText.java2
-rw-r--r--javax/accessibility/AccessibleTextSequence.java68
7 files changed, 440 insertions, 6 deletions
diff --git a/javax/accessibility/AccessibleAttributeSequence.java b/javax/accessibility/AccessibleAttributeSequence.java
new file mode 100644
index 000000000..5ee50e5d7
--- /dev/null
+++ b/javax/accessibility/AccessibleAttributeSequence.java
@@ -0,0 +1,71 @@
+/* AccessibleAttributeSequence.java
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.accessibility;
+
+import javax.swing.text.AttributeSet;
+
+/**
+ * This is a convenience class that represents an accessible
+ * attribute sequence.
+ * @since 1.5
+ */
+public class AccessibleAttributeSequence
+{
+ /**
+ * The attributes of the text.
+ */
+ public AttributeSet attributes;
+
+ /**
+ * The starting index.
+ */
+ public int startIndex;
+
+ /**
+ * The ending index.
+ */
+ public int endIndex;
+
+ /**
+ * Create a new instance.
+ */
+ public AccessibleAttributeSequence()
+ {
+ }
+}
diff --git a/javax/accessibility/AccessibleContext.java b/javax/accessibility/AccessibleContext.java
index 129e19728..972f4feae 100644
--- a/javax/accessibility/AccessibleContext.java
+++ b/javax/accessibility/AccessibleContext.java
@@ -249,6 +249,35 @@ public abstract class AccessibleContext
= "AccessibleHypertextOffset";
/**
+ * Constant used when a component's bounds have changed. The old and
+ * new bounds are given in the event.
+ * @since 1.5
+ */
+ public static final String ACCESSIBLE_COMPONENT_BOUNDS_CHANGED
+ = "accessibleComponentBoundsChanged";
+
+ /**
+ * Constant used when the state of child objects changes. The old
+ * value in the event is always null, and the new value is the component
+ * whose children have changed.
+ * @since 1.5
+ */
+ public static final String ACCESSIBLE_INVALIDATE_CHILDREN
+ = "accessibleInvalidateChildren";
+
+ /**
+ * Constant used when the attributes of some text have changed.
+ * On insertion, the old value is null and the new value is an
+ * {@link AccessibleAttributeSequence} describing the insertion.
+ * On deletion, the old value is an {@link AccessibleAttributeSequence}
+ * and the new value is null. For replacement, both the old
+ * and new values are {@link AccessibleAttributeSequence} objects.
+ * @since 1.5
+ */
+ public static final String ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED
+ = "accessibleTextAttributesChanged";
+
+ /**
* The accessible parent of this object.
*
* @see #getAccessibleParent()
diff --git a/javax/accessibility/AccessibleExtendedText.java b/javax/accessibility/AccessibleExtendedText.java
new file mode 100644
index 000000000..f40fa0fd2
--- /dev/null
+++ b/javax/accessibility/AccessibleExtendedText.java
@@ -0,0 +1,108 @@
+/* AccessibleExtendedText.java
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.accessibility;
+
+import java.awt.Rectangle;
+
+/**
+ * This interface provides extended text functionality, similar
+ * to AccessibleText.
+ * @see AccessibleText
+ * @since 1.5
+ */
+public interface AccessibleExtendedText
+{
+ /**
+ * This constant indicates that the retrieved text should be a
+ * complete line.
+ */
+ int LINE = 4;
+
+ /**
+ * This constant indicates that the retrieved text should consist
+ * of a run with identical attributes.
+ */
+ int ATTRIBUTE_RUN = 5;
+
+ /**
+ * Determines the bounding box of some text held by this object.
+ * @param start the starting index
+ * @param end the ending index
+ * @return the bounding box
+ * @see AccessibleText#getCharacterBounds(int)
+ */
+ Rectangle getTextBounds(int start, int end);
+
+ /**
+ * Return a range of text from the underlying object.
+ * @param start the starting index
+ * @param end the ending index
+ */
+ String getTextRange(int start, int end);
+
+ /**
+ * Return a text sequence from the underlying object. The part
+ * parameter describes the type of sequence to return; it is one
+ * of the constants from {@link AccessibleText} or from this
+ * class.
+ * @param part the type of the sequence to return
+ * @param index start of the sequence
+ */
+ AccessibleTextSequence getTextSequenceAfter(int part, int index);
+
+ /**
+ * Return a text sequence from the underlying object. The part
+ * parameter describes the type of sequence to return; it is one
+ * of the constants from {@link AccessibleText} or from this
+ * class.
+ * @param part the type of the sequence to return
+ * @param index start of the sequence
+ */
+ AccessibleTextSequence getTextSequenceAt(int part, int index);
+
+ /**
+ * Return a text sequence from the underlying object. The part
+ * parameter describes the type of sequence to return; it is one
+ * of the constants from {@link AccessibleText} or from this
+ * class.
+ * @param part the type of the sequence to return
+ * @param index end of the sequence
+ */
+ AccessibleTextSequence getTextSequenceBefore(int part, int index);
+}
diff --git a/javax/accessibility/AccessibleRelation.java b/javax/accessibility/AccessibleRelation.java
index fae69efc4..3d515fd57 100644
--- a/javax/accessibility/AccessibleRelation.java
+++ b/javax/accessibility/AccessibleRelation.java
@@ -61,7 +61,7 @@ public class AccessibleRelation extends AccessibleBundle
* @see #LABELED_BY
* @see #MEMBER_OF
*/
- public static final String LABEL_FOR = "labelFor";
+ public static final String LABEL_FOR;
/**
* Indicates the object is labeled by other objects.
@@ -72,7 +72,7 @@ public class AccessibleRelation extends AccessibleBundle
* @see #LABEL_FOR
* @see #MEMBER_OF
*/
- public static final String LABELED_BY = "labeledBy";
+ public static final String LABELED_BY;
/**
* Indicates an object is a member of a group of target objects.
@@ -83,7 +83,7 @@ public class AccessibleRelation extends AccessibleBundle
* @see #LABEL_FOR
* @see #LABELED_BY
*/
- public static final String MEMBER_OF = "memberOf";
+ public static final String MEMBER_OF;
/**
* Indicates an object is a controller for other objects.
@@ -94,7 +94,7 @@ public class AccessibleRelation extends AccessibleBundle
* @see #LABELED_BY
* @see #MEMBER_OF
*/
- public static final String CONTROLLER_FOR = "controllerFor";
+ public static final String CONTROLLER_FOR;
/**
* Indicates an object is controlled by other objects.
@@ -105,7 +105,7 @@ public class AccessibleRelation extends AccessibleBundle
* @see #LABELED_BY
* @see #MEMBER_OF
*/
- public static final String CONTROLLED_BY = "controlledBy";
+ public static final String CONTROLLED_BY;
/** Indicates that the label target group has changed. */
public static final String LABEL_FOR_PROPERTY = "labelForProperty";
@@ -122,8 +122,104 @@ public class AccessibleRelation extends AccessibleBundle
/** Indicates that the controlling objects have changed. */
public static final String CONTROLLED_BY_PROPERTY = "controlledByProperty";
+ /**
+ * Indicates that an object is a child of another object.
+ * @since 1.5
+ */
+ public static final String CHILD_NODE_OF = "childNodeOf";
+
+ /**
+ * Indicates that the ancestry relationship has changed.
+ * @since 1.5
+ */
+ public static final String CHILD_NODE_OF_PROPERTY = "childNodeOfProperty";
+
+ /**
+ * Indicates that an object is embedded by another object.
+ * @since 1.5
+ */
+ public static final String EMBEDDED_BY = "embeddedBy";
+
+ /**
+ * Indicates that the {@link #EMBEDDED_BY} property changed.
+ * @since 1.5
+ */
+ public static final String EMBEDDED_BY_PROPERTY = "embeddedByProperty";
+
+ /**
+ * Indicates that an object embeds another object.
+ * @since 1.5
+ */
+ public static final String EMBEDS = "embeds";
+
+ /**
+ * Indicates that the {@link #EMBEDS} property changed.
+ * @since 1.5
+ */
+ public static final String EMBEDS_PROPERTY = "embedsProperty";
+
+ /**
+ * Indicates that one object directly follows another object,
+ * as in a paragraph flow.
+ * @since 1.5
+ */
+ public static final String FLOWS_FROM = "flowsFrom";
+
+ /**
+ * Indicates that the {@link #FLOWS_FROM} property changed.
+ * @since 1.5
+ */
+ public static final String FLOWS_FROM_PROPERTY = "flowsFromProperty";
+
+ /**
+ * Indicates that one object comes directly before another object,
+ * as in a paragraph flow.
+ * @since 1.5
+ */
+ public static final String FLOWS_TO = "flowsTo";
+
+ /**
+ * Indicates that the {@link #FLOWS_TO} property changed.
+ * @since 1.5
+ */
+ public static final String FLOWS_TO_PROPERTY = "flowsToProperty";
+
+ /**
+ * Indicates that one object is a parent window of another object.
+ * @since 1.5
+ */
+ public static final String PARENT_WINDOW_OF = "parentWindowOf";
+
+ /**
+ * Indicates that the {@link #PARENT_WINDOW_OF} property changed.
+ * @since 1.5
+ */
+ public static final String PARENT_WINDOW_OF_PROPERTY = "parentWindowOfProperty";
+
+ /**
+ * Indicates that one object is a subwindow of another object.
+ * @since 1.5
+ */
+ public static final String SUBWINDOW_OF = "subwindowOf";
+
+ /**
+ * Indicates that the {@link #SUBWINDOW_OF} property changed.
+ * @since 1.5
+ */
+ public static final String SUBWINDOW_OF_PROPERTY = "subwindowOfProperty";
+
/** An empty set of targets. */
private static final Object[] EMPTY_TARGETS = { };
+
+ static
+ {
+ // not constants in JDK
+ LABEL_FOR = "labelFor";
+ LABELED_BY = "labeledBy";
+ MEMBER_OF = "memberOf";
+ CONTROLLER_FOR = "controllerFor";
+ CONTROLLED_BY = "controlledBy";
+ }
/**
* The related objects.
diff --git a/javax/accessibility/AccessibleStreamable.java b/javax/accessibility/AccessibleStreamable.java
new file mode 100644
index 000000000..cbeedf783
--- /dev/null
+++ b/javax/accessibility/AccessibleStreamable.java
@@ -0,0 +1,62 @@
+/* AccessibleStreamable.java
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.accessibility;
+
+import java.awt.datatransfer.DataFlavor;
+import java.io.InputStream;
+
+/**
+ * This interface represents a streamable accessible object.
+ * @since 1.5
+ */
+public interface AccessibleStreamable
+{
+ /**
+ * Return an array of the data flavors supported by this object.
+ */
+ DataFlavor[] getMimeTypes();
+
+ /**
+ * Return an input stream that yields the contents of this object,
+ * using the given data flavor. If the given data flavor cannot
+ * be used, returns null.
+ * @param flavor the data flavor
+ */
+ InputStream getStream(DataFlavor flavor);
+}
diff --git a/javax/accessibility/AccessibleText.java b/javax/accessibility/AccessibleText.java
index 88aee1495..be5f45c7e 100644
--- a/javax/accessibility/AccessibleText.java
+++ b/javax/accessibility/AccessibleText.java
@@ -92,7 +92,7 @@ public interface AccessibleText
* Given a point in the coordinate system of this object, return the
* 0-based index of the character at that point, or -1 if there is none.
*
- * @param p the point to look at
+ * @param point the point to look at
* @return the character index, or -1
*/
int getIndexAtPoint(Point point);
diff --git a/javax/accessibility/AccessibleTextSequence.java b/javax/accessibility/AccessibleTextSequence.java
new file mode 100644
index 000000000..88fa4c2b8
--- /dev/null
+++ b/javax/accessibility/AccessibleTextSequence.java
@@ -0,0 +1,68 @@
+/* AccessibleTextSequence.java
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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 for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.accessibility;
+
+/**
+ * This is a convenience class that encapsulates a String and a range.
+ * @since 1.5
+ */
+public class AccessibleTextSequence
+{
+ /**
+ * The text of the sequence.
+ */
+ public String text;
+
+ /**
+ * The starting index.
+ */
+ public int startIndex;
+
+ /**
+ * The ending index.
+ */
+ public int endIndex;
+
+ /**
+ * Create a new instance.
+ */
+ public AccessibleTextSequence()
+ {
+ }
+}