Index: javax/swing/JViewport.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JViewport.java,v
retrieving revision 1.25
diff -u -r1.25 JViewport.java
--- javax/swing/JViewport.java 2 Aug 2005 19:25:34 -0000 1.25
+++ javax/swing/JViewport.java 7 Sep 2005 15:20:13 -0000
@@ -49,6 +49,9 @@
import java.awt.event.ComponentEvent;
import java.io.Serializable;
+import javax.accessibility.Accessible;
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleRole;
import javax.swing.border.Border;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
@@ -95,8 +98,34 @@
* the underlying child at position (-VX,-VY)
JViewport
.
+ *
+ * @author Roman Kennke (address@hidden)
+ */
+ protected class AccessibleJViewport extends AccessibleJComponent
+ {
+ /**
+ * Creates a new instance of AccessibleJViewport
.
+ */
+ public AccessibleJViewport()
+ {
+ // Nothing to do here.
+ }
+
+ /**
+ * Returns the accessible role of JViewport
, which is
+ * address@hidden AccessibleRole#VIEWPORT}.
+ *
+ * @return the accessible role of JViewport
+ */
+ public AccessibleRole getAccessibleRole()
+ {
+ return AccessibleRole.VIEWPORT;
+ }
+ }
/**
* A address@hidden java.awt.event.ComponentListener} that listens for
@@ -189,6 +218,11 @@
*/
ViewListener viewListener;
+ /**
+ * The accessible context of this JViewport
.
+ */
+ AccessibleContext accessibleContext;
+
public JViewport()
{
setOpaque(true);
@@ -527,5 +561,18 @@
-viewBounds.x + portBounds.width)
setViewPosition (new Point(contentRect.x -
(portBounds.width - contentRect.width), pos.y));
+ }
+
+ /**
+ * Returns the accessible context for this JViewport
. This
+ * will be an instance of address@hidden AccessibleJViewport}.
+ *
+ * @return the accessible context for this JViewport
+ */
+ public AccessibleContext getAccessibleContext()
+ {
+ if (accessibleContext == null)
+ accessibleContext = new AccessibleJViewport();
+ return accessibleContext;
}
}