summaryrefslogtreecommitdiff
path: root/javax
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2008-01-14 10:43:55 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2008-01-14 10:43:55 +0000
commite748c1b80be905f6e9be369f10c21323e62b3be1 (patch)
tree33d9e77f37362a0b4b5aec84ac0c3e5359c78d1e /javax
parentffa90f13753ccc51f21145eb6cc38e3f449c23ec (diff)
downloadclasspath-e748c1b80be905f6e9be369f10c21323e62b3be1.tar.gz
2008-01-14 Andrew John Hughes <gnu_andrew@member.fsf.org>
* javax/accessibility/AccessibleAttributeSequence.java: (AccessibleAttributeSequence(int,int,AttributeSet)): Implemented. * javax/accessibility/AccessibleTextSequence.java: (AccessibleTextSequence(int,int,String)): Likewise.
Diffstat (limited to 'javax')
-rw-r--r--javax/accessibility/AccessibleAttributeSequence.java22
-rw-r--r--javax/accessibility/AccessibleTextSequence.java17
2 files changed, 33 insertions, 6 deletions
diff --git a/javax/accessibility/AccessibleAttributeSequence.java b/javax/accessibility/AccessibleAttributeSequence.java
index 5ee50e5d7..de8edcb97 100644
--- a/javax/accessibility/AccessibleAttributeSequence.java
+++ b/javax/accessibility/AccessibleAttributeSequence.java
@@ -41,8 +41,12 @@ package javax.accessibility;
import javax.swing.text.AttributeSet;
/**
- * This is a convenience class that represents an accessible
- * attribute sequence.
+ * This is a convenience class that wraps together a sequence
+ * of text with the attributes applied to it. This allows a single
+ * object to be used when
+ * {@link AccessibleContext#ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED}
+ * events are fired.
+ *
* @since 1.5
*/
public class AccessibleAttributeSequence
@@ -63,9 +67,19 @@ public class AccessibleAttributeSequence
public int endIndex;
/**
- * Create a new instance.
+ * Creates a new instance using the specified attributes
+ * and the supplied start and end indicies.
+ *
+ * @param start the index of the start of the text.
+ * @param end the index of the end of the text.
+ * @param attr the attributes applied to the text sequence.
+ * @since 1.6
*/
- public AccessibleAttributeSequence()
+ public AccessibleAttributeSequence(int start, int end, AttributeSet attr)
{
+ startIndex = start;
+ endIndex = end;
+ attributes = attr;
}
+
}
diff --git a/javax/accessibility/AccessibleTextSequence.java b/javax/accessibility/AccessibleTextSequence.java
index 88fa4c2b8..b400160aa 100644
--- a/javax/accessibility/AccessibleTextSequence.java
+++ b/javax/accessibility/AccessibleTextSequence.java
@@ -39,7 +39,10 @@ exception statement from your version. */
package javax.accessibility;
/**
- * This is a convenience class that encapsulates a String and a range.
+ * This is a convenience class that encapsulates a string of text
+ * and a range specifying where, within a larger body of text, the
+ * string may be found.
+ *
* @since 1.5
*/
public class AccessibleTextSequence
@@ -61,8 +64,18 @@ public class AccessibleTextSequence
/**
* Create a new instance.
+ *
+ * @param start the initial index of the text within a larger
+ * body of text.
+ * @param end the final index of the text within a larger body
+ * of text.
+ * @param txt the text itself.
+ * @since 1.6
*/
- public AccessibleTextSequence()
+ public AccessibleTextSequence(int start, int end, String txt)
{
+ startIndex = start;
+ endIndex = end;
+ text = txt;
}
}